-
Notifications
You must be signed in to change notification settings - Fork 29
/
.eslintrc.cjs
94 lines (94 loc) · 1.85 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
es2020: true,
jest: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime",
"airbnb",
"airbnb-typescript/base",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
project: "./tsconfig.json",
},
plugins: [
"@typescript-eslint",
"react",
"react-refresh",
"unused-imports",
"prefer-arrow",
"prettier",
],
rules: {
"prettier/prettier": ["error"],
"react-refresh/only-export-components": "warn",
"@typescript-eslint/no-unused-vars": ["error"],
"react/jsx-filename-extension": [
1,
{
extensions: [".tsx"],
},
],
"react/jsx-props-no-spreading": "off",
"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"import/prefer-default-export": "warn",
"import/extensions": [
"error",
"never",
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never",
styled: "ignorePackages",
json: "ignorePackages",
},
],
"no-plusplus": "off",
"react/react-in-jsx-scope": 0,
"react/jsx-uses-react": 0,
radix: ["error", "as-needed"],
"no-restricted-syntax": "off",
"@typescript-eslint/explicit-function-return-type": "warn",
"unused-imports/no-unused-imports": "error",
"prefer-arrow/prefer-arrow-functions": [
"warn",
{
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
},
],
"prefer-arrow-callback": [
"warn",
{
allowNamedFunctions: true,
},
],
"func-style": [
"warn",
"expression",
{
allowArrowFunctions: true,
},
],
},
};