-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
59 lines (55 loc) · 2.39 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
require('@rushstack/eslint-patch/modern-module-resolution')
/** @ts-check @type import('eslint-config-standard-typescript-prettier/types').TsEslintConfig */
module.exports = {
rules: {
'camelcase': ['off'],
'no-unused-expressions': ['off'],
'newline-before-return': ['off'], // When enabled formatting gets jumbled up
'no-use-before-define': ['off'], // Disabled because manual order in module scope is useful
'unused-imports/no-unused-imports-ts': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/camelcase': ['off'],
'@typescript-eslint/ban-types': ['off'],
'@typescript-eslint/explicit-module-boundary-types': ['off'],
// https://eslint.org/docs/rules/padding-line-between-statements
'padding-line-between-statements': [
'error',
{ prev: '*', next: 'import', blankLine: 'always' },
{ prev: '*', next: 'import', blankLine: 'always' },
{ prev: 'import', next: 'import', blankLine: 'never' },
{ prev: '*', next: 'multiline-block-like', blankLine: 'always' },
{ prev: 'multiline-block-like', next: '*', blankLine: 'always' },
{ prev: '*', next: 'block-like', blankLine: 'always' },
{ prev: 'block-like', next: '*', blankLine: 'always' },
{ prev: '*', next: 'multiline-expression', blankLine: 'always' },
{ prev: 'multiline-expression', next: '*', blankLine: 'always' },
{ prev: 'if', next: '*', blankLine: 'always' },
{ prev: '*', next: 'if', blankLine: 'always' },
{ prev: 'if', next: 'if', blankLine: 'any' },
{
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
next: ['*'],
blankLine: 'always',
},
{
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
next: ['singleline-const', 'singleline-let', 'singleline-var'],
blankLine: 'never',
},
{
prev: ['singleline-const', 'singleline-let', 'singleline-var'],
next: ['multiline-const', 'multiline-let', 'multiline-var'],
blankLine: 'never',
},
],
},
plugins: ['eslint-plugin-unused-imports', 'eslint-plugin-only-warn'],
extends: ['eslint-config-standard-typescript-prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: 'tsconfig.json',
},
}