-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
107 lines (107 loc) · 2.65 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
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:prettier/recommended",
"plugin:no-unsanitized/DOM"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["unicorn", "react-hooks", "no-unsanitized", "header", "import"],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"react/display-name": "off",
"react/no-danger": "error",
"react/no-unstable-nested-components": [
"error",
{
"allowAsProps": true
}
],
"react/forbid-component-props": [
"warn",
{
"forbid": ["className", "id"]
}
],
"react/jsx-boolean-value": ["error", "always"],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": ["PascalCase"]
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": ["error"],
"unicorn/filename-case": "error",
"curly": "error",
"dot-notation": "error",
"eqeqeq": "error",
"no-return-await": "error",
"require-await": "error",
"header/header": [
"error",
"line",
[" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.", " SPDX-License-Identifier: Apache-2.0"]
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "react",
"importNames": ["default"],
"message": "Prefer named imports."
},
{
"name": "@cloudscape-design/components",
"message": "Prefer subpath imports."
}
]
}
],
"sort-imports": ["error", { "ignoreDeclarationSort": true }],
"import/order": ["error", { "alphabetize": { "order": "asc" } }],
"import/no-useless-path-segments": [
"warn",
{
"noUselessIndex": true
}
]
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"es6": true
},
"overrides": [
{
"files": ["**/__integ__/**", "./test/**"],
"rules": {
// useBrowser is not a React hook
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off"
},
"env": {
"jest": true
}
}
]
}