chore!: update

This commit is contained in:
Anthony Fu 2020-10-21 14:38:36 +08:00
parent 7ce57bfbf1
commit 9755c28da2
2 changed files with 37 additions and 25 deletions

View File

@ -4,15 +4,8 @@ module.exports = {
browser: true, browser: true,
node: true, node: true,
}, },
extends: [ extends: ['standard', 'plugin:import/errors', 'plugin:import/warnings'],
'standard', plugins: ['html', 'unicorn'],
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: [
'html',
'unicorn',
],
settings: { settings: {
'import/resolver': { 'import/resolver': {
node: { extensions: ['.js', '.mjs'] }, node: { extensions: ['.js', '.mjs'] },
@ -45,7 +38,11 @@ module.exports = {
'no-cond-assign': ['error', 'always'], 'no-cond-assign': ['error', 'always'],
'func-call-spacing': ['off', 'never'], 'func-call-spacing': ['off', 'never'],
'key-spacing': ['error', { beforeColon: false, afterColon: true }], 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
indent: ['error', 2, { SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 }], indent: [
'error',
2,
{ SwitchCase: 1, VariableDeclarator: 1, outerIIFEBody: 1 },
],
'no-restricted-syntax': [ 'no-restricted-syntax': [
'error', 'error',
'DebuggerStatement', 'DebuggerStatement',
@ -56,22 +53,32 @@ module.exports = {
'no-spaced-func': 'error', 'no-spaced-func': 'error',
'object-curly-spacing': ['error', 'always'], 'object-curly-spacing': ['error', 'always'],
'no-return-await': 'off', 'no-return-await': 'off',
'space-before-function-paren': ['error', 'never'], 'space-before-function-paren': 'error',
// es6 // es6
'no-var': 'error', 'no-var': 'error',
'prefer-const': ['error', { 'prefer-const': [
destructuring: 'any', 'error',
ignoreReadBeforeAssign: true, {
}], destructuring: 'any',
'prefer-arrow-callback': ['error', { ignoreReadBeforeAssign: true,
allowNamedFunctions: false, },
allowUnboundThis: true, ],
}], 'prefer-arrow-callback': [
'object-shorthand': ['error', 'always', { 'error',
ignoreConstructors: false, {
avoidQuotes: true, allowNamedFunctions: false,
}], allowUnboundThis: true,
},
],
'object-shorthand': [
'error',
'always',
{
ignoreConstructors: false,
avoidQuotes: true,
},
],
'prefer-rest-params': 'error', 'prefer-rest-params': 'error',
'prefer-spread': 'error', 'prefer-spread': 'error',
'prefer-template': 'error', 'prefer-template': 'error',

View File

@ -4,18 +4,23 @@ module.exports = {
], ],
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
extends: [ extends: [
'plugin:@typescript-eslint/recommended',
'@antfu/eslint-config-basic', '@antfu/eslint-config-basic',
'plugin:@typescript-eslint/recommended',
], ],
rules: { rules: {
// TS // TS
'no-useless-constructor': 'off', 'no-useless-constructor': 'off',
'@typescript-eslint/semi': ['error', 'never'], '@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'@typescript-eslint/indent': ['error', 2], '@typescript-eslint/indent': ['error', 2],
'@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', {}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
// off // off
'@typescript-eslint/camelcase': 'off', '@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-function-return-type': 'off',