-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
103 lines (100 loc) · 3.09 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/typescript",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react", "@typescript-eslint", "jsx-a11y"],
"rules": {
"no-undef": ["off"],
// >>> typescript-eslint extension rules needed to support TS versions of rules
// see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-use-before-define": "off",
// 'nofunc' option means function hoisting is still allowed
"@typescript-eslint/no-use-before-define": ["error", "nofunc"],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "class", "format": ["PascalCase"] }
],
"@typescript-eslint/unified-signatures": ["warn"],
"@typescript-eslint/member-ordering": [
"warn",
{
"default": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
// enforce unix line breaks
"linebreak-style": ["error", "unix"],
"@typescript-eslint/ban-ts-comment": ["warn"],
"@typescript-eslint/no-empty-interface": ["warn"],
"consistent-return": ["warn"],
"dot-notation": ["warn"],
"no-else-return": ["warn", { "allowElseIf": true }],
"no-nested-ternary": ["warn"],
"no-param-reassign": ["warn"],
"no-restricted-globals": ["warn"],
"no-await-in-loop": ["warn"],
"no-multiple-empty-lines": ["warn", { "max": 1 }],
"object-shorthand": ["warn"],
// >>> overly opinionated rules to disable
"arrow-body-style": ["off"],
"camelcase": ["off"],
"import/extensions": ["off"],
"import/prefer-default-export": ["off"],
"lines-between-class-members": ["off"],
"max-classes-per-file": ["off"],
"prefer-destructuring": ["off"],
"prefer-object-spread": ["off"],
"prefer-template": ["off"],
"prefer-arrow-callback": ["off"],
"no-console": ["off"],
"no-plusplus": ["off"],
"no-underscore-dangle": ["off"],
"spaced-comment": ["off"],
"@typescript-eslint/no-inferrable-types": ["off"],
"@typescript-eslint/no-empty-function": ["off"],
"react/display-name": ["off"],
"react/prop-types": ["off"],
// suppress errors for missing 'import React' in files
"react/react-in-jsx-scope": "off"
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true
}
},
"react": {
"version": "17.0.2"
}
},
"ignorePatterns": ["src/stories", "*.cjs"]
}