-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.cjs
108 lines (108 loc) · 2.78 KB
/
.eslintrc.cjs
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
/**
* @type {import('@types/eslint').Linter.BaseConfig}
*/
module.exports = {
root: true,
plugins: ["@typescript-eslint", "import"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json"],
},
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier",
],
env: {
node: true,
es6: true,
},
ignorePatterns: ["node_modules", ".eslintrc.cjs", "dist", "templates"],
settings: {
"import/extensions": [".ts", ".js", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".js", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json",
},
},
},
rules: {
"no-console": "warn",
"arrow-body-style": ["warn", "as-needed"],
// React
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
// @typescript-eslint
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
// //import
"import/no-default-export": "error",
"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "@api/**",
group: "internal",
position: "before",
},
{
pattern: "@modules/**",
group: "internal",
position: "before",
},
{
pattern: "@plugins/**",
group: "internal",
position: "before",
},
{
pattern: "@utils/**",
group: "internal",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["react"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: [
"./src/modules/**/*.ts",
"./src/internal/**/api/*.ts",
"./src/screens/**/*.tsx",
],
rules: {
"import/no-default-export": "off",
"import/prefer-default-export": "error",
},
},
],
};