-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
55 lines (55 loc) · 1.64 KB
/
.eslintrc
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
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 13,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
// disables the no-unused-vars rule
"no-unused-vars": ["off"],
// forces the use of const or let instead of var
"no-var": ["error"],
// no unreadable exports/imports
"object-curly-newline": ["error", { "multiline": true }],
// use 2 spaces for indentation
"indent": ["error", 2],
// use double quotes
"quotes": ["error", "double"],
// dont move comma to new line
"comma-dangle": ["error", "never"],
// use unix linebreaks
"linebreak-style": ["error", "unix"],
// add a space before and after brackets
"array-bracket-spacing": ["error", "always"],
// adds a space before and after curly braces
"object-curly-spacing": ["error", "always"],
// moves the dot before a function call to the next line
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }],
// ensures that functions are defined before they are used
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
// new line for ternary operator
"multiline-ternary": ["error", "always-multiline"],
// new line for function arguments
"function-call-argument-newline": ["error", "consistent"]
},
// rules for typescript files only
"overrides": [
{
"files": ["*.ts"],
"rules": {
// force type imports to be used
"@typescript-eslint/consistent-type-imports": [
"error",
{ "prefer": "type-imports" }
]
}
}
]
}