forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
114 lines (114 loc) · 3.62 KB
/
.eslintrc.js
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
module.exports = {
extends: [
"react-app",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:css-modules/recommended",
"plugin:jsx-a11y/recommended",
],
plugins: ["react", "@typescript-eslint", "prettier", "unused-imports", "css-modules", "jsx-a11y"],
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
rules: {
"jsx-a11y/label-has-associated-control": "error",
curly: "warn",
"css-modules/no-undef-class": "off",
"css-modules/no-unused-class": ["error", { camelCase: true }],
"dot-location": "warn",
"dot-notation": "warn",
eqeqeq: "error",
"prettier/prettier": "warn",
"unused-imports/no-unused-imports": "warn",
"no-else-return": "warn",
"no-lonely-if": "warn",
"no-inner-declarations": "off",
"no-unused-vars": "off",
"no-useless-computed-key": "warn",
"no-useless-return": "warn",
"no-var": "warn",
"object-shorthand": ["warn", "always"],
"prefer-arrow-callback": "warn",
"prefer-const": "warn",
"prefer-destructuring": ["warn", { AssignmentExpression: { array: true } }],
"prefer-object-spread": "warn",
"prefer-template": "warn",
"spaced-comment": ["warn", "always", { markers: ["/"] }],
yoda: "warn",
"import/order": [
"warn",
{
"newlines-between": "always",
groups: ["type", "builtin", "external", "internal", ["parent", "sibling"], "index"],
pathGroupsExcludedImportTypes: ["builtin"],
pathGroups: [
{
pattern: "components{/**,}",
group: "internal",
},
{
pattern: "+(config|core|hooks|locales|packages|pages|services|types|utils|views){/**,}",
group: "internal",
position: "after",
},
],
alphabetize: {
order: "asc" /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
caseInsensitive: true /* ignore case. Options: [true, false] */,
},
},
],
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
"@typescript-eslint/ban-ts-comment": [
"warn",
{
"ts-expect-error": "allow-with-description",
},
],
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/consistent-indexed-object-style": ["warn", "record"],
"@typescript-eslint/consistent-type-definitions": ["warn", "interface"],
"@typescript-eslint/no-unused-vars": "warn",
"react/function-component-definition": [
"warn",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"jest/consistent-test-it": ["warn", { fn: "it", withinDescribe: "it" }],
"react/jsx-boolean-value": "warn",
"react/jsx-curly-brace-presence": "warn",
"react/jsx-fragments": "warn",
"react/jsx-no-useless-fragment": ["warn", { allowExpressions: true }],
"react/self-closing-comp": "warn",
},
parser: "@typescript-eslint/parser",
overrides: [
{
files: ["scripts/**/*"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
{
// Only applies to files in src. Rules should be in here that are requiring type information
// and thus require the below parserOptions.
files: ["src/**/*"],
parserOptions: {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
rules: {
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
},
},
],
};