eslint-config-severe
v1.1.0
Published
Severe, reusable config for ESLint.
Downloads
156
Readme
What is this?
An unrelentingly harsh ESLint configuration that incorporates the following:
- ESLint core rules
eslint-plugin-array-func
eslint-plugin-eslint-comments
eslint-plugin-filenames
eslint-plugin-import
eslint-plugin-jest
eslint-plugin-jsx-a11y
eslint-plugin-lean-imports
eslint-plugin-prettier
eslint-plugin-promise
eslint-plugin-react
What problem does it solve?
You probably don't need this. It's a maximally severe linting setup that enables most of the rules defined by ESLint, along with those rules defined by the above plugins. It helps when collaborators who have minimal experience with JS come crashing into your code and you find yourself with an urgent need to automate some good practices and consistent formatting.
Installation
eslint-config-severe
is intended to be installed from NPM and then configured into a React project. Its dependencies are peer dependencies and must be installed explicitly in the project where you're using it.
yarn add eslint-config-severe babel-eslint eslint eslint-config-prettier eslint-plugin-array-func eslint-plugin-eslint-comments eslint-plugin-filenames eslint-plugin-import eslint-plugin-jest eslint-plugin-jsx-a11y eslint-plugin-lean-imports eslint-plugin-promise eslint-plugin-react
Once installation is complete, in the root of your project, create an .eslintrc.js
file containing this:
module.exports = {
extends: ['severe'],
};
Of course, in .eslintrc.js
you can add whatever other configuration items you want. You can include other plugins, for example, or override any of the rules coming from severe
. If you're not sure how this works, check out the ESLint configuration docs.
Usage
I write code in Atom, and I configure the atom-prettier
package to run Prettier and then ESLint every time I hit save. This works well enough for me, but of course there are many other ways to do it. Perhaps you prefer some other one. Merry linting!