Sharable configs for ESLint to avoid copy-pasting rule files over and over again. Very opinionated but allows to skip Prettier, yay!
-
amalitsky/recommended
- default set. Doesn't extend but is commonly used on top ofeslint:recommended
,google
andplugin:@typescript-eslint/recommended
. Sets parser to@typescript-eslint/parser
. -
amalitsky/imports
- linting rules for file imports. -
amalitsky/newlines
- rules for padding code blocks with empty lines. Based onobject-curly-newline
andpadding-line-between-statements
rules. -
amalitsky/naming
- rules for naming variables, properties, classes and interfaces. Based on@typescript-eslint/naming-convention
rule. -
amalitsky/react
- rules for projects with React. Supposed to be used withreact/recommended
andreact-hooks/recommended
.
Recommended
set does not include any other rule set present in the package.
Run npm install -D eslint-config-amalitsky
to install the package.
Then include rule sets you are interested in with extends
property of .eslintrc.js
file.
I.e. extends: ['eslint:recommended', 'google', 'amalitsky/recommended', 'amalitsky/imports']
.
Feel free to use local eslintrc file as an example. Yep, this project code is linted with the same rule sets it is exporting. Recursion at its best!
This rule set doesn't split JS specific rules from TS specific rules, which might be problematic for some JS heavy projects.
- Not surprisingly,
eslint
typescript
since@typescript-eslint/parser
is being used@typescript-eslint/parser
@typescript-eslint/eslint-plugin
eslint-plugin-react
andeslint-plugin-react-hooks
for thereact
seteslint-plugin-import
forimports
set
Happy linting!