This is an Eslint sharable configuration that contains an opinionated take on best practices in writing and formatting JavaScript code. I reviewed the eslint recommended settings, the standard configuration, and the Airbnb configuration and carefully considered their recommendations balanced with my own experience developing with JavaScript.
This config itself extends the eslint:recommended
ruleset.
This is the result. It leans towards minimalism (no semicolons or other unnecessary punctuation with a few exceptions), the Allman/BSD style of indentation for maximum clarity, tabs for indentation, organized import statements, etc.
If you generally like this approach but with some small modifications, you can extend this and provide rule overrides.
This package also follows the bluejava approach of small, simple, single-purpose, minimal tooling - so it would be easy to clone this and make changes or rip out any valuable bits for your own sharable configuration.
To use this package, simply install it:
npm install --save-dev eslint-config-bluejava
or
yarn add --dev eslint-config-bluejava
and then, in your package.json
, add the following:
"eslintConfig": {
"extends": "bluejava"
},
Once configured you can check your code via the command line (eslint <src>
) or more commonly, via an eslint plugin for your browser.
You can learn more about Shareable Configs on the official ESLint website.
For help in integrating with your editor, see Integrations.
The final resulting ruleset created by this configuration can be seen in the rules-report.json file in this repository.
See the LICENSE file for license rights and limitations (MIT).