2.1.0 • Published 5 years ago

eslint-config-zeal v2.1.0

Weekly downloads
74
License
MIT
Repository
github
Last release
5 years ago

eslint-config-zeal

npm version CircleCI License Greenkeeper badge

A shareable ESLint config for Zeal's coding style.

Zeal's JavaScript coding style is still evolving as we do more projects, but this represents our current thinking.

Install

To make use of this configuration, install eslint, babel-eslint, eslint-plugin-import, eslint-plugin-import-order-alphabetical and this package as development dependencies of your project:

npm install eslint babel-eslint eslint-plugin-import eslint-plugin-import-order-alphabetical eslint-config-zeal --save-dev

These packages are marked as peer dependencies, so you will get a warning if they're not installed.

Usage

Add this to your .eslintrc file:

{
  "extends": "zeal"
}

Note: ESLint assumes the eslint-config- prefix, so we can omit it.

You can override settings from the configuration(s) by adding them directly to your .eslintrc file.

We have added some additional optional configurations that you can add on top of the base zeal config:

  • zeal/ramda: Adds rules for Ramda.js development. You'll need to install eslint-plugin-ramda to use this configuration.
  • zeal/react: Adds rules for React development. You'll need to install eslint-plugin-react, eslint-plugin-react-hooks, and eslint-plugin-jsx-a11y to use this configuration.
  • zeal/react-native: Adds rules for React Native development. You'll need to install eslint-plugin-react-native to use this configuration.
  • zeal/mocha: Overrides rules for use with Mocha. We recommend creating a separate .eslintrc file in the directory containing your tests and extending this config there.
  • zeal/chai: Overrides rules for use with Chai. We recommend creating a separate .eslintrc file in the directory containing your tests and extending this config there.
  • zeal/jest: Adds and overrides rules for use with Jest. You'll have to install eslint-plugin-jest to use this configuration. We recommend creating a separate .estlintrc file in the directory containing your tests and extending this config there.

You can extend multiple configurations using an array:

{
  "extends": ["zeal", "zeal/react"]
}

See the ESLint configuration documentation for more information on configuring ESLint.

Usage with Ramda

If you're using Ramda.js in your project, make sure you have eslint-plugin-ramda installed as well:

npm install eslint-plugin-ramda --save-dev

Then, in your .eslintrc file, extend both the zeal and zeal/ramda configurations:

{
  "extends": ["zeal", "zeal/ramda"]
}

Usage With React

If you're using this package in a React project, make sure you have eslint-plugin-react, eslint-plugin-react-hooks and eslint-plugin-jsx-a11y installed as well:

npm install eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y --save-dev

Then, in your .eslintrc file, extend both the zeal and zeal/react configurations:

{
  "extends": ["zeal", "zeal/react"]
}

Usage with React Native

If you're using this package in a React Native project, make sure you have both eslint-plugin-react and eslint-plugin-react-native installed as well:

npm install eslint-plugin-react eslint-plugin-react-native --save-dev

Then, in your .eslintrc file, extend the zeal, zeal/react, and zeal/react-native configurations:

{
  "extends": ["zeal", "zeal/react", "zeal/react-native"]
}

Usage With Webpack

This configuration uses eslint-plugin-import. If your project uses Webpack, you'll need to add eslint-import-resolver-webpack:

npm install eslint-import-resolver-webpack

You'll also need to add the following to your .eslintrc:

"settings": {
  "import/resolver": "webpack"
}

or, if your webpack config file is not in the default location:

"settings": {
  "import/resolver": {
    "webpack": { "config": "path/to/webpack.config.js" }
  }
}

Usage With Prettier

To use this configuration with prettier, use eslint-config-prettier to override any conflicting rules:

npm install eslint-config-prettier --save-dev

Then, in your .eslintrc file, extend the prettier (and prettier/react) configurations after any zeal configurations. For example:

{
  "extends": ["zeal", "zeal/react", "prettier", "prettier/react"]
}

That way, the prettier configurations will override any zeal configurations that would otherwise conflict with prettier's formatting.

Supported Versions

This plugin contains all of the rules available in:

License

Authored by the Engineering Team of Coding ZEAL

Copyright (c) 2016 - 2019 Zeal, LLC. Licensed under the MIT license.

2.1.0

5 years ago

2.0.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.21.0

7 years ago

0.20.2

7 years ago

0.20.1

7 years ago

0.20.0

7 years ago

0.19.0

7 years ago

0.18.0

7 years ago

0.17.0

7 years ago

0.16.0

7 years ago

0.15.0

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.0

7 years ago

0.12.1

8 years ago

0.12.0

8 years ago

0.11.0

8 years ago

0.10.0

8 years ago

0.9.0

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago