forked from innocenzi/eslint-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypescript.js
108 lines (104 loc) · 3.01 KB
/
typescript.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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const basic = require('./basic')
module.exports = {
plugins: ['@typescript-eslint', 'unused-imports'],
extends: ['@innocenzi/eslint-config/basic', 'plugin:@typescript-eslint/recommended'],
overrides: basic.overrides,
rules: {
// TS
'no-useless-constructor': 'off',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }],
'@typescript-eslint/type-annotation-spacing': ['error', {}],
'@typescript-eslint/no-unused-vars': 'warn',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/space-infix-ops': ['error', { int32Hint: false }],
// off
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
// other
'no-console': ['warn'],
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'no-tabs': 'off',
'@typescript-eslint/no-tabs': 'off',
'arrow-parens': ['error', 'always'],
indent: 'off',
'@typescript-eslint/indent': ['error', 'tab'],
'no-multi-spaces': ['error'],
'@typescript-eslint/no-inferrable-types': 'off',
curly: ['error', 'all'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
'object-curly-spacing': 'off',
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{
enums: false,
typedefs: false,
ignoreTypeReferences: false,
functions: false,
},
],
'standard/no-callback-literal': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['block', 'block-like', 'class'],
next: 'return',
},
{
blankLine: 'never',
prev: 'block',
next: 'block',
},
],
'object-property-newline': 'error',
'object-curly-newline': [
'error',
{
ObjectExpression: {
multiline: true,
consistent: true,
},
ObjectPattern: {
multiline: true,
consistent: true,
},
ImportDeclaration: {
multiline: true,
consistent: true,
},
ExportDeclaration: {
multiline: true,
consistent: true,
},
},
],
'array-bracket-spacing': ['error', 'never'],
'space-in-parens': ['error', 'never'],
},
}