Skip to content

Instantly share code, notes, and snippets.

@tripolskypetr
Created March 5, 2024 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripolskypetr/7348324273219ee1f25bdfc0d8dc20bf to your computer and use it in GitHub Desktop.
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
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