feat: update ts rules, enforce import type

This commit is contained in:
Anthony Fu 2021-12-12 08:17:49 +08:00
parent 7993f922db
commit dd76d5d8d9
2 changed files with 6 additions and 1 deletions

View File

@ -228,5 +228,6 @@ module.exports = {
'no-use-before-define': ['error', { functions: false, classes: false, variables: true }], 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
'eslint-comments/disable-enable-pair': 'off', 'eslint-comments/disable-enable-pair': 'off',
'import/no-named-as-default-member': 'off',
}, },
} }

View File

@ -11,17 +11,21 @@ module.exports = {
'import/named': 'off', 'import/named': 'off',
// TS // TS
'no-useless-constructor': 'off',
'@typescript-eslint/semi': ['error', 'never'], '@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }], '@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }],
'@typescript-eslint/type-annotation-spacing': ['error', {}], '@typescript-eslint/type-annotation-spacing': ['error', {}],
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }],
// Override JS
'no-useless-constructor': 'off',
'indent': 'off', 'indent': 'off',
'@typescript-eslint/indent': ['error', 2], '@typescript-eslint/indent': ['error', 2],
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/no-unused-vars': 'error',
'no-redeclare': 'off', 'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-redeclare': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
// off // off
'@typescript-eslint/camelcase': 'off', '@typescript-eslint/camelcase': 'off',