This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
115 lines (113 loc) · 2.52 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
const path = require("path")
const fs = require("fs")
// see https://github.com/import-js/eslint-plugin-import/issues/1174
const packageDirs = ["packages"]
const packageDir = []
for (const dir of packageDirs) {
for (const d of fs
.readdirSync(path.resolve(__dirname, dir))
.filter(
(entry) =>
entry.slice(0, 1) !== "." &&
fs.lstatSync(path.resolve(__dirname, dir, entry)).isDirectory()
)) {
const fullpath = path.resolve(__dirname, dir, d)
if (fs.existsSync(`${fullpath}/package.json`)) {
packageDir.push(fullpath)
}
}
}
const noExtraneousRule = [
"error",
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
packageDir,
},
]
module.exports = {
ignorePatterns: ["**/build/*"],
settings: {
"import/resolver": {
alias: true,
},
},
extends: ["airbnb-base", "prettier", "plugin:jest/recommended"],
plugins: ["prettier", "import", "jest"],
rules: {
"node/no-extraneous-require": [0],
"import/no-commonjs": [0],
"import/no-dynamic-require": [0],
"import/no-extraneous-dependencies": noExtraneousRule,
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"index",
"sibling",
"object",
],
pathGroups: [
{
group: "internal",
pattern: "~/**",
},
{
group: "internal",
pattern: "~**",
},
],
pathGroupsExcludedImportTypes: [],
},
],
"global-require": [0],
"no-restricted-syntax": [0],
"no-async-promise-executor": [0],
"no-nested-ternary": [0],
"no-loop-func": [0],
"no-new": [0],
"func-names": [0],
"no-plusplus": [0],
"no-param-reassign": [0],
"no-continue": [0],
"no-unused-vars": [
2,
{
vars: "all",
args: "after-used",
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"no-console": [0],
"no-throw-literal": [0],
"no-await-in-loop": [0],
"consistent-return": [0],
semi: ["error", "never"],
"prettier/prettier": [
"error",
{
semi: false,
// printWidth: 80,
// tabWidth: 2,
// useTabs: false,
// singleQuote: false,
// bracketSpacing: true,
},
],
},
parserOptions: {
ecmaVersion: "latest",
sourceType: "script",
env: [
{
node: true,
},
],
},
}