-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
88 lines (88 loc) · 3.55 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'prettier', 'simple-import-sort'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['dist', '.eslintrc.js', 'jest.config.js'],
rules: {
'simple-import-sort/imports': 'warn',
'no-console': 'warn',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'var', next: 'block-like' },
{ blankLine: 'always', prev: 'const', next: 'block-like' },
{ blankLine: 'always', prev: 'let', next: 'block-like' },
],
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },
{ selector: 'classProperty', format: ['camelCase'] },
{ selector: 'classProperty', modifiers: ['private'], format: ['camelCase'], leadingUnderscore: 'allow' },
{ selector: 'classProperty', modifiers: ['protected'], format: ['camelCase'], leadingUnderscore: 'allow' },
{ selector: 'objectLiteralProperty', format: ['camelCase'] },
{ selector: 'parameterProperty', format: ['camelCase'] },
{ selector: 'parameterProperty', modifiers: ['readonly'], format: ['StrictPascalCase'], leadingUnderscore: 'allow' },
{ selector: 'classMethod', format: ['camelCase'] },
{ selector: 'objectLiteralMethod', format: ['camelCase'] },
{ selector: 'typeMethod', format: ['camelCase'] },
{ selector: 'accessor', format: ['camelCase'] },
{ selector: 'enumMember', format: ['UPPER_CASE'] },
{ selector: 'class', format: ['PascalCase'] },
{ selector: 'interface', format: ['PascalCase'] },
{ selector: 'typeAlias', format: ['PascalCase'] },
{ selector: 'enum', format: ['PascalCase'] },
{ selector: 'typeParameter', format: ['PascalCase'] },
],
'@typescript-eslint/method-signature-style': ['error', 'method'],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
multilineDetection: 'brackets',
},
],
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: false,
},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'no-public',
},
],
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
'@typescript-eslint/class-literal-property-style': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'prettier/prettier': ['error'],
'max-len': 'off'
},
};