-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.cjs
49 lines (49 loc) · 1.15 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
module.exports = {
env: {
browser: true,
commonjs: true,
node: true,
es2021: true,
jest: true,
},
plugins: ["prettier", "import"],
extends: ["plugin:prettier/recommended", "plugin:import/recommended"],
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
},
rules: {
"prettier/prettier": ["error", { endOfLine: "auto", printWidth: 120 }],
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: false,
},
pathGroups: [
{
pattern: "~/**",
group: "external",
},
],
},
],
},
settings: {
"import/resolver": {
/**
* Since using "subpath patterns" makes an eslint error
* https://nodejs.org/api/packages.html#packages_subpath_patterns
* https://github.com/import-js/eslint-plugin-import/issues/1868
* We use custom resolver to solve this issue
* https://www.npmjs.com/package/eslint-import-resolver-custom-alias
*/
"eslint-import-resolver-custom-alias": {
alias: {
"#src": "./src",
},
},
},
},
};