-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
126 lines (126 loc) · 4.11 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
115
116
117
118
119
120
121
122
123
124
125
126
/* eslint max-len: 0 */
module.exports = {
root: true,
env: {
es2023: true,
browser: true,
node: true,
jest: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:react/jsx-runtime',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'simple-import-sort'],
settings: {
react: {
version: '17.0.2',
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['./packages/*/tsconfig.json'],
},
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
// tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 'latest',
alwaysTryTypes: true,
project: ['./tsconfig.base.json', './packages/*/tsconfig.json'],
},
overrides: [
{
files: ['*.js'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
},
],
rules: {
'linebreak-style': 0,
'multiline-comment-style': ['error', 'starred-block'],
'import/no-cycle': 0,
'import/prefer-default-export': 0,
'simple-import-sort/imports': [
'error',
{
groups: [
// `react` related packages & side effect imports come first.
['^react', '^\\u0000'],
/*
* Node.js builtins. You could also generate this regex if you use a `.js` config.
* For example: `^(${require("module").builtinModules.join("|")})(/|$)`
*/
[
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
],
// Other packages.
['^\\w', '^@\\w'],
// internal package
[
'^(@|@assets|assets|@styles|styles|@static|static|@utils|utils|@tools|tools|@hooks|hooks|@pages|pages|@components|components|@component|component|@service|service|@services|services|@constants|@store|store|@types|types|@src|src|@providers|providers|@containers|containers|@layout|layout)(/.*|$)',
],
[
// Parent imports. Put `..` last.
'^\\.\\.(?!/?$)',
'^\\.\\./?$',
// Other relative imports. Put same-folder imports and `.` last.
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$',
],
[
// Image imports.
'^.+\\.(gif|png|jpg|jpeg|webp|svg)$',
// Style imports.
'^.+\\.(sass|scss|less|css)$',
],
],
},
],
'simple-import-sort/exports': 'error',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-shadow': 0,
'no-underscore-dangle': 0,
'import/no-extraneous-dependencies': 0,
'max-len': ['error', { code: 200, tabWidth: 2 }],
'no-param-reassign': 0,
'no-restricted-syntax': 0,
'react/require-default-props': 0,
'react/no-array-index-key': 0,
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
'react/function-component-definition': 0,
'react/jsx-props-no-spreading': 0,
'react-hooks/exhaustive-deps': 0,
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_|draft' }],
'@typescript-eslint/triple-slash-reference': 0,
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unsafe-enum-comparison': 0,
'@typescript-eslint/no-unsafe-call': 0,
'global-require': 0,
},
};