generated from moontai0724/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
113 lines (108 loc) · 2.73 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
109
110
111
112
113
module.exports = {
root: true,
// ESLint ignores dot files by default, we need to exclude them.
// https://github.com/eslint/eslint/issues/12348#issuecomment-536946429
ignorePatterns: [
".*.cjs",
"**/*.json",
"node_modules",
"dist",
"build",
"docs",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:typescript-sort-keys/recommended",
"prettier",
],
plugins: [
"@typescript-eslint/eslint-plugin",
"simple-import-sort",
"import",
"typescript-sort-keys",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
},
rules: {
"no-console": "off",
"sort-imports": "off",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"import/no-unresolved": "error",
"import/prefer-default-export": "off",
// additional rules
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
fixStyle: "inline-type-imports",
disallowTypeAnnotations: false,
},
],
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "*", next: "return" },
{
blankLine: "always",
prev: ["const", "let", "var", "multiline-expression"],
next: "*",
},
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"],
},
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true },
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "error",
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: ["./tsconfig.json"],
},
},
},
overrides: [
{
files: ["./*.ts"],
rules: {
"import/no-extraneous-dependencies": "off",
},
parserOptions: {
project: "e2e/tsconfig.json",
},
},
{
files: ["e2e/**/*.ts", "*.test.ts", "*.spec.ts"],
rules: {
"import/no-extraneous-dependencies": "off",
},
parserOptions: {
project: "e2e/tsconfig.json",
},
},
],
};