1.1.1 • Published 19 days ago

@payloadcms/eslint-config v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
19 days ago

NPM Bundle Size

Payload CMS ESLint Config

An ESLint Config for Payload CMS projects.

Installation

$ npm i --save-dev @payloadcms/eslint-config
$ npm info @payloadcms/eslint-config peerDependencies
$ npm i --save-dev <dependency>@<version> # for each dependency in the above output
$ # or
$ yarn add --dev @payloadcms/eslint-config
$ yarn info @payloadcms/eslint-config peerDependencies
$ yarn add --dev <dependency>@<version> # for each dependency in the above output

Usage

There are a number of configurations for consumption, all of which are packaged together as the default export or they can be selectively extended, which prevents the path names from being written shorthand.

{
  "extends": "@payloadcms"
  // or selectively extend any config(s)
  // "extends": [
  //   "@payloadcms/eslint-config/configs/base",
  //   "@payloadcms/eslint-config/configs/jest",
  //   "@payloadcms/eslint-config/configs/react",
  // ]
}

If using Webpack, install and configure eslint-loader to have loaded files automatically linted.

{
  test: /\.js$/,
  exclude: /node_modules/,
  loader: 'eslint-loader',
  options: {
    fix: true,
    emitWarning: true,
  },
}

For working examples, see the demo app.

Demo

$ git clone git@github.com:payloadcms/eslint-config.git
$ yarn
$ yarn demo
$ open http://localhost:3000

Contribution

Help us, or let us help you help us.

License

MIT Copyright (c) Payload CMS