This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.json
112 lines (110 loc) · 2.75 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
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
{
"extends": ["plugin:@typescript-eslint/recommended", "plugin:jest/recommended", "prettier"],
"ignorePatterns": [".eslintrc.json"],
"plugins": [
"react",
"@typescript-eslint",
"jest",
"simple-import-sort",
"prefer-arrow",
"sort-destructure-keys",
"sort-keys-fix"
],
"env": {
"browser": true,
"es6": true,
"jest": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"overrides": [
{
"files": ["*.ts", "*.tsx"], // Your TypeScript files extension
"parserOptions": {
"project": ["./tsconfig.json"] // Specify it only for TypeScript files
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"indent": ["error", 2],
"linebreak-style": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"simple-import-sort/imports": [
"error",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Packages. `react` related packages come first.
["^react", "^@?\\w"],
// Internal packages.
[
"^(@|@company|@ui|components|utils|config|vendored-lib|layouts|pages|providers|routes|assets|locales|services|store|style|types)(/.*|$)"
],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// Style imports.
["^.+\\.s?css$"]
]
}
],
"simple-import-sort/exports": "error",
"sort-keys-fix/sort-keys-fix": [
"error",
"asc",
{
"caseSensitive": false,
"natural": true
}
],
"sort-destructure-keys/sort-destructure-keys": [
"error",
{
"caseSensitive": false
}
],
"sort-vars": "error",
"no-nested-ternary": 0,
"prefer-arrow/prefer-arrow-functions": [
"error",
{
"disallowPrototype": true,
"singleReturnOnly": true,
"classPropertiesAllowed": false
}
],
"arrow-body-style": ["error", "as-needed"],
"react/jsx-sort-default-props": "error",
"react/jsx-sort-props": "error",
"react/jsx-props-no-spreading": "off",
"prefer-destructuring": [
"error",
{
"array": false,
"object": true
}
],
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
}