Skip to content

madarche/eslint-config-usecases

Repository files navigation

eslint-config-usecases

NPM version Build Status

ESLint configs by usecase with a strong bias towards quality, strictness and the decision to ban useless semicolons (;) for legibility and efficiency (cf. the "semi" never rule).

Those ESLint configs are devised around some specific use cases of JavaScript:

All those usecases have their special env and rules set, while inheriting some common properties.

Usage

If not already present, install the eslint package locally in your project:

$ npm install eslint --save-dev

Then, still in your project, locally install the eslint-config-usecases package:

$ npm install eslint-config-usecases --save-dev

And finally, you have to add an .eslintrc.js file at the root of your project with the following content:

module.exports = {
    extends: 'usecases/usecase/nodejs'
}

And you can change usecases/usecase/nodejs to the value of the corresponding usecase.

Note that you can add many different .eslintrc.js files in the tree structure of your project depending on what is inside each directory.

For more information read ESLint Shareable Configs

Note

Because JavaScript is more powerful, flexible and expressive, I prefer to use JavaScript ESLint configuration files over JSON or YML. That's why there isn't any .eslintrc, .eslintrc.json or .eslintrc.yml files.

Contributions

Those use cases are focusing only on some needs on purpose. Exhaustiveness is not intended. Feel free to contribute if you have similar needs.