-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
52 lines (52 loc) · 2.11 KB
/
.eslintrc.js
File metadata and controls
52 lines (52 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: { ecmaVersion: 2021, sourceType: "module", ecmaFeatures: { jsx: true } },
settings: { react: { version: "detect" } },
env: { es2021: true, browser: true, jest: true, node: true },
plugins: ["import", "simple-import-sort", "react-hooks"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"prettier",
],
rules: {
"no-console": ["error", { allow: ["warn", "info", "error"] }],
"no-restricted-syntax": ["error", { selector: "TSEnumDeclaration", message: "Don't declare enums" }],
"prefer-arrow-callback": "error",
"func-style": ["error", "expression"],
"arrow-body-style": ["error", "always"],
"no-restricted-imports": ["error", { paths: [{ name: "react", importNames: ["default"] }] }],
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/display-name": "error",
"react/jsx-handler-names": [
"error",
{
eventHandlerPrefix: "handle",
eventHandlerPropPrefix: "on",
checkLocalVariables: true,
checkInlineFunction: true,
},
],
"react/destructuring-assignment": ["error", "never"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/newline-after-import": "error",
"import/no-default-export": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/consistent-type-imports": ["warn", { prefer: "type-imports" }],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"jsx-a11y/anchor-is-valid": [
"error",
{ components: ["Link"], specialLink: ["hrefLeft", "hrefRight"], aspects: ["invalidHref", "preferButton"] },
],
},
overrides: [{ files: ["src/pages/**/*.tsx"], rules: { "import/no-default-export": "off" } }],
};