Skip to content

Commit 8f261da

Browse files
committed
style: move typescript-eslint extension rules into own category
1 parent 2cef998 commit 8f261da

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

bases/typescript.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,25 @@ module.exports = {
2121
'import/namespace': 'off',
2222
'import/export': 'off',
2323

24-
// `allowRequire` is covered by @typescript-eslint/no-require-imports
25-
'import/no-commonjs': ['error', { allowRequire: true }],
26-
// Covered by @typescript-eslint/no-require-imports
27-
'global-require': 'off',
28-
// Covered by @typescript-eslint/no-misused-promises
29-
'no-async-promise-executor': 'off',
30-
3124
// TODO: Should be covered by a type-based rule
3225
// 'import/no-deprecated': 'off',
3326

27+
// Extension Rules
28+
'no-array-constructor': 'off',
29+
'@typescript-eslint/no-array-constructor': 'error',
3430
'no-loop-func': 'off',
3531
'@typescript-eslint/no-loop-func': 'error',
32+
'no-unused-expressions': 'off',
33+
'@typescript-eslint/no-unused-expressions': 'error',
34+
'no-useless-constructor': 'off',
35+
'@typescript-eslint/no-useless-constructor': 'error',
36+
quotes: 'off',
37+
'@typescript-eslint/quotes': [
38+
'error',
39+
'single',
40+
{ avoidEscape: true, allowTemplateLiterals: false },
41+
],
42+
3643
'@typescript-eslint/adjacent-overload-signatures': 'error',
3744
'@typescript-eslint/array-type': 'error',
3845
'@typescript-eslint/await-thenable': 'error',
@@ -89,17 +96,19 @@ module.exports = {
8996
custom: { regex: '^I[A-Z]', match: false },
9097
},
9198
],
92-
'no-array-constructor': 'off',
93-
'@typescript-eslint/no-array-constructor': 'error',
9499
'@typescript-eslint/no-empty-interface': 'error',
95100
'@typescript-eslint/no-extra-non-null-assertion': 'error',
96101
'@typescript-eslint/no-extraneous-class': 'error',
97102
'@typescript-eslint/no-floating-promises': 'error',
98103
'@typescript-eslint/no-for-in-array': 'error',
99104
'@typescript-eslint/no-inferrable-types': 'error',
100105
'@typescript-eslint/no-misused-new': 'error',
106+
'no-async-promise-executor': 'off',
101107
'@typescript-eslint/no-misused-promises': 'error',
102108
'@typescript-eslint/no-namespace': 'error',
109+
// `allowRequire` is covered by @typescript-eslint/no-require-imports
110+
'import/no-commonjs': ['error', { allowRequire: true }],
111+
'global-require': 'off',
103112
'@typescript-eslint/no-require-imports': 'error',
104113
'@typescript-eslint/no-this-alias': 'error',
105114
'no-throw-literal': 'off',
@@ -109,10 +118,6 @@ module.exports = {
109118
'@typescript-eslint/no-unnecessary-qualifier': 'error',
110119
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
111120
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
112-
'no-unused-expressions': 'off',
113-
'@typescript-eslint/no-unused-expressions': 'error',
114-
'no-useless-constructor': 'off',
115-
'@typescript-eslint/no-useless-constructor': 'error',
116121
// TODO: Enable instead of unicorn/no-for-loop after https://github.com/typescript-eslint/typescript-eslint/issues/702
117122
// '@typescript-eslint/prefer-for-of': 'off',
118123
'@typescript-eslint/prefer-function-type': 'error',
@@ -124,12 +129,6 @@ module.exports = {
124129
'@typescript-eslint/prefer-readonly': 'error',
125130
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
126131
'@typescript-eslint/promise-function-async': ['error', { checkArrowFunctions: false }],
127-
quotes: 'off',
128-
'@typescript-eslint/quotes': [
129-
'error',
130-
'single',
131-
{ avoidEscape: true, allowTemplateLiterals: false },
132-
],
133132
'@typescript-eslint/require-array-sort-compare': 'error',
134133
'@typescript-eslint/require-await': 'error',
135134
'@typescript-eslint/restrict-plus-operands': ['error', { checkCompoundAssignments: true }],

0 commit comments

Comments
 (0)