-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.json
74 lines (74 loc) · 2.33 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
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"extends": ["eslint:recommended", "airbnb", "plugin:@typescript-eslint/recommended", "plugin:react/jsx-runtime", "plugin:jsx-a11y/recommended", "plugin:react/recommended", "prettier"],
"plugins": ["@typescript-eslint", "react", "jsx-a11y"],
"ignorePatterns": ["dist", "node_modules", ".git"],
"rules": {
"arrow-parens": [
"error",
"as-needed",
{
"requireForBlockBody": true
}
],
"no-invalid-this": "error",
"react/require-default-props": "off",
"react/function-component-definition": [
"error",
{
"namedComponents": "function-declaration",
"unnamedComponents": "arrow-function"
}
],
"no-restricted-syntax": [
"error",
// The following four selectors prevent the usage of async/await
{
"selector": "AwaitExpression",
"message": "async/await is not allowed"
},
{
"selector": "FunctionDeclaration[async=true]",
"message": "async functions are not allowed"
},
{
"selector": "FunctionExpression[async=true]",
"message": "async functions are not allowed"
},
{
"selector": "ArrowFunctionExpression[async=true]",
"message": "async functions are not allowed"
},
{
"selector": "MethodDefinition[async=true]",
"message": "async methods are not allowed"
}
]
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"extends": ["plugin:@typescript-eslint/recommended-type-checked", "airbnb-typescript", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
}
}
],
"settings": {
"react": {
"version": "detect"
}
}
}