-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
120 lines (120 loc) · 3.25 KB
/
.eslintrc
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["sonarjs", "@typescript-eslint", "deprecation", "import"],
"ignorePatterns": ["node_modules", "out"],
"settings": {
"import/resolver": {
"typescript": {
"project": ["tsconfig.json"],
},
},
"react": {
"version": "detect",
},
},
"extends": [
"eslint:recommended",
"plugin:sonarjs/recommended-legacy",
"plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended-requiring-type-checking", // Rules requiring type checking that take extra computing power
"plugin:react-hooks/recommended",
"plugin:@next/next/recommended",
"plugin:styled-components-a11y/recommended",
],
"env": {
"browser": true,
"amd": true,
"node": true,
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json",
},
"rules": {
"import/no-duplicates": "error",
"import/no-self-import": "error",
"import/newline-after-import": "error",
"import/no-extraneous-dependencies": "error",
"no-console": "error",
"no-debugger": "error",
"no-irregular-whitespace": "error",
"no-nested-ternary": "error",
"arrow-body-style": "error",
"no-return-await": "error",
"@typescript-eslint/no-empty-interface": [
"error",
{
"allowSingleExtends": true,
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false,
},
],
"@typescript-eslint/ban-ts-comment": [
"error",
{
"ts-ignore": "allow-with-description",
"minimumDescriptionLength": 10,
},
],
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/jsx-fragments": "error",
"react/jsx-pascal-case": ["error", { "allowAllCaps": true }],
"react/no-array-index-key": "warn",
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true,
},
],
"react/jsx-no-useless-fragment": ["error", { "allowExpressions": true }],
"styled-components-a11y/label-has-for": [
"error",
{
"required": {
"some": ["nesting", "id"],
},
},
],
"deprecation/deprecation": "error",
"sonarjs/prefer-read-only-props": "warn",
"sonarjs/no-clear-text-protocols": "warn",
"sonarjs/todo-tag": "warn",
},
"overrides": [
{
"files": ["**/*.tsx"],
"rules": {
"react/prop-types": "off",
},
},
{
"files": ["**/*.js"],
"parserOptions": {
"project": "./tsconfig.eslint.json",
},
},
],
}