forked from xt0rted/dotnet-format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
116 lines (116 loc) · 2.92 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
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
rules: {
"array-bracket-spacing": "error",
"comma-dangle": ["error", "always-multiline"],
eqeqeq: ["error", "smart"],
indent: ["error", 2],
"object-curly-newline": ["error", {
ExportDeclaration: {
multiline: true,
minProperties: 2,
},
ImportDeclaration: {
multiline: true,
minProperties: 2,
},
ObjectExpression: {
multiline: true,
minProperties: 2,
},
ObjectPattern: { consistent: true },
}],
"object-shorthand": "error",
quotes: ["error", "double"],
"quote-props": ["error", "as-needed"],
semi: "error",
// strings
"no-nonoctal-decimal-escape": "error",
// variables
"no-const-assign": "error",
"no-var": "error",
"prefer-const": "error",
// arrow functions
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["error", "always"],
"arrow-spacing": ["error", {
before: true, after: true,
}],
"implicit-arrow-linebreak": ["error", "beside"],
"prefer-arrow-callback": "error",
// classes
"class-methods-use-this": "error",
"no-dupe-class-members": "error",
"no-useless-constructor": "error",
// modules
"no-duplicate-imports": ["error", { includeExports: true }],
},
overrides: [
{
files: ["*.ts"],
extends: [
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
},
rules: {
camelcase: "off",
indent: "off",
quotes: "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/naming-convention": [
"error",
// eslint defaults
{
selector: "default",
format: ["camelCase"],
},
{
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
},
{
selector: "memberLike",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
},
{
selector: "typeLike",
format: ["PascalCase"],
},
// project specific settings
{
selector: "enumMember",
format: ["StrictPascalCase"],
},
{
selector: "property",
format: null,
},
],
"@typescript-eslint/quotes": ["error", "double"],
},
},
],
};