-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy path.eslintrc
118 lines (118 loc) · 3.27 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
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["react-hooks", "react", "header", "@eslint-react/eslint-plugin", "eslint-plugin-simple-import-sort"],
"rules": {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": ["error", { "caughtErrors": "none" }],
"curly": "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: MIT-0"]
],
"react/display-name": "off",
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"es6": true,
"browser": true
},
"globals": {
"process": true
},
"overrides": [
{
"files": ["*.json"],
"rules": {
"header/header": "off"
}
},
{
"files": ["./*.js", "./scripts/**/*.js"],
"env": {
"node": true,
"browser": false
},
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["test/**/*.ts"],
"env": {
"jest": true
},
"rules": {
"react-hooks/rules-of-hooks": "off"
}
},
{
"files": ["src/**/*.{js,jsx,ts,tsx}"],
"rules": {
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-empty-function": "warn",
"react/display-name": "warn",
"@eslint-react/no-class-component": "warn",
"@eslint-react/naming-convention/filename": ["warn", { "rule": "kebab-case" }],
"@eslint-react/naming-convention/filename-extension": ["warn", "as-needed"],
"simple-import-sort/imports": [
"warn",
{
"groups": [
// External packages come first.
["^react", "^(?!@cloudscape)@?\\w"],
// Cloudscape packages.
["^@cloudscape"],
// Things that start with a letter (or digit or underscore), or `~` followed by a letter.
["^~\\w"],
// Anything not matched in another group.
["^"],
// Styles come last.
["^.+\\.?(css)$", "^.+\\.?(css.js)$", "^.+\\.?(scss)$", "^.+\\.?(selectors.js)$"]
]
}
]
}
},
{
"files": ["./*.js", "./scripts/**/*.js"],
"env": {
"node": true,
"browser": false
},
"rules": {
"@typescript-eslint/no-require-imports": "off"
}
}
]
}