forked from SparkDevNetwork/Rock
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.eslintrc.js
More file actions
110 lines (95 loc) · 3.46 KB
/
.eslintrc.js
File metadata and controls
110 lines (95 loc) · 3.46 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
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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
env: {
browser: true,
amd: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: "module"
},
rules: {
// Warn if tabs are used anywhere in a file.
"no-tabs": "warn",
// Warn if single quotes are used instead of double quotes.
quotes: ["warn", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
// Warn if semicolons are omitted.
semi: "off",
"@typescript-eslint/semi": ["error", "always"],
// Warn about unused variables, unless they are prefixed with underscore.
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}],
// Allow things like `value: number = 5`.
"@typescript-eslint/no-inferrable-types": "off",
// Enforce return types be specified on functions.
"@typescript-eslint/explicit-function-return-type": [
1,
{
allowExpressions: true
}
],
// Enforce certain naming conventions on all code.
"@typescript-eslint/naming-convention": [
"error",
// By default everything will use camelCase unless otherwise noted below.
{
selector: "default",
format: ["camelCase"]
},
// Variables and parameters that are unused may also be prefixed with an underscore.
{
selector: ["variable", "parameter"],
format: ["camelCase"],
modifiers: ["unused"],
leadingUnderscore: "allow"
},
// Variables that are exported may use either camelCase or PascalCase.
{
selector: ["variable"],
format: ["camelCase", "PascalCase"],
modifiers: ["exported"]
},
// Enum members should be PascalCase as it is similar to a type.
{
selector: ["enumMember"],
format: ["PascalCase"]
},
// Interfaces must be prefixed with a capital I.
{
selector: ["interface"],
format: ["PascalCase"],
prefix: ["I"]
},
// Allow object literals {} to use any naming since we often use
// these to pass data to 3rd party libraries and don't have a choice.
{
selector: ["objectLiteralProperty", "objectLiteralMethod"],
format: null
},
// Any type-like definitions (types, classes, interfaces, enums, etc.)
// must be PascalCase.
{
selector: "typeLike",
format: ["PascalCase"]
}
],
// Disable JavaScript brace-style in favor of TypeScript support. This
// brace style matches our C# style.
"brace-style": "off",
"@typescript-eslint/brace-style": ["warn", "stroustrup"],
// Make unwanted white-space inside parenthesis an error.
"space-in-parens": ["error", "never"],
// Allow non-null assertion. Use with wisdom.
"@typescript-eslint/no-non-null-assertion": "off"
}
};