-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
81 lines (75 loc) · 1.7 KB
/
.eslintrc.js
File metadata and controls
81 lines (75 loc) · 1.7 KB
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
const mainRules = {
"import/order": [
1,
{
groups: ["builtin", "external", "internal", ["parent", "sibling"]],
pathGroups: [
{
pattern: "nodejs",
group: "external",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["builtin"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
"linebreak-style": 0,
"no-tabs": 0,
"implicit-arrow-linebreak": 0,
"operator-linebreak": 0,
"object-curly-newline": 0,
"no-nested-ternary": 0,
"no-bitwise": 1,
"no-empty": 0,
};
const typescriptRules = {
"@typescript-eslint/comma-dangle": 0,
"@typescript-eslint/indent": 0,
"@typescript-eslint/quotes": 0,
"@typescript-eslint/no-unused-vars": 1,
"@typescript-eslint/comma-dangle": 0,
"@typescript-eslint/no-misused-promises": 0,
};
module.exports = {
extends: [
"eslint:recommended",
"prettier",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:sonarjs/recommended",
"plugin:promise/recommended",
],
ignorePatterns: ["build/", "*rc.*", "*config.*", "*.min.*"],
rules: mainRules,
plugins: ["prettier", "import", "sonarjs", "promise"],
env: {
browser: true,
},
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: ".",
},
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"airbnb-typescript/base",
],
plugins: ["@typescript-eslint"],
rules: Object.assign(typescriptRules, mainRules),
},
{
files: "*.js",
parser: "esprima",
},
],
};