fix: complete typescript overrides (#87)

* fix: complete typescript overrides

* chore: typo
This commit is contained in:
QiroNT 2022-05-01 08:53:21 +08:00 committed by GitHub
parent 6080d3f74d
commit a2de527401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 5 deletions

View File

@ -205,10 +205,10 @@ module.exports = {
'space-before-function-paren': [ 'space-before-function-paren': [
'error', 'error',
{ {
'anonymous': 'always', anonymous: 'always',
'named': 'never', named: 'never',
'asyncArrow': 'always' asyncArrow: 'always',
} },
], ],
'space-in-parens': ['error', 'never'], 'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error', 'space-infix-ops': 'error',

View File

@ -17,7 +17,6 @@ module.exports = {
'import/named': 'off', 'import/named': 'off',
// TS // TS
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }], '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }],
'@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', {}],
@ -76,6 +75,43 @@ module.exports = {
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'], '@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'object-curly-spacing': 'off', 'object-curly-spacing': 'off',
'@typescript-eslint/object-curly-spacing': ['error', 'always'], '@typescript-eslint/object-curly-spacing': ['error', 'always'],
'semi': 'off',
'@typescript-eslint/semi': ['error', 'never'],
'quotes': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'space-before-blocks': 'off',
'@typescript-eslint/space-before-blocks': ['error', 'always'],
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': [
'error',
{
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
},
],
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': 'error',
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': ['error', { before: true, after: true }],
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': ['error', { before: false, after: true }],
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': ['error', 'functions'],
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
// The following rule overrides require a parser service, aka. require a `typescript.json` path.
// This needs to be done individually for each project, and it slows down linting significantly.
// 'no-throw-literal': 'off',
// '@typescript-eslint/no-throw-literal': 'error',
// 'no-implied-eval': 'off',
// '@typescript-eslint/no-implied-eval': 'error',
// 'dot-notation': 'off',
// '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
// off // off
'@typescript-eslint/camelcase': 'off', '@typescript-eslint/camelcase': 'off',