Created
March 5, 2024 21:48
-
-
Save tripolskypetr/7348324273219ee1f25bdfc0d8dc20bf to your computer and use it in GitHub Desktop.
Minimal eslint config which allow freedom to senior developers and prevent juniors to shitcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
env: { browser: true, es2020: true }, | |
extends: [ | |
"eslint:recommended", | |
"plugin:prettier/recommended", | |
"plugin:react-hooks/recommended", | |
], | |
rules: { | |
"react-hooks/rules-of-hooks": "error", | |
"no-undef": "off", | |
"no-redeclare": "off", | |
"no-comments/disallowComments": [ | |
"error", | |
{ | |
allow: [ | |
"TODO", | |
"FIXME", | |
"NOTE", | |
"DEBUG", | |
"eslint-disable-next-line", | |
"eslint-disable no-unused-vars", | |
], | |
}, | |
], | |
"no-loss-of-precision": "off", | |
"no-async-promise-executor": "off", | |
"no-unsafe-finally": "off", | |
"no-unused-vars": "off", | |
"@typescript-eslint/no-unused-vars": ["error"], | |
"@typescript-eslint/naming-convention": [ | |
"error", | |
{ | |
"selector": "variable", | |
"format": [ | |
"camelCase", | |
"PascalCase", | |
"UPPER_CASE", | |
'snake_case' | |
] | |
}, | |
{ | |
"selector": "function", | |
"format": [ | |
"camelCase", | |
"PascalCase" | |
] | |
}, | |
{ | |
"selector": "typeLike", | |
"format": [ | |
"PascalCase", | |
"snake_case", | |
"UPPER_CASE", | |
] | |
} | |
], | |
"prettier/prettier": ["error", { endOfLine: "auto" }], | |
}, | |
ignorePatterns: ["build", ".eslintrc.cjs", "*.d.ts"], | |
parser: "@typescript-eslint/parser", | |
plugins: ["prettier", "no-comments", "@typescript-eslint"], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment