From 9755c28da2008f8b3c80b2efd57b27f9c114c886 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 21 Oct 2020 14:38:36 +0800 Subject: [PATCH] chore!: update --- packages/basic/index.js | 53 ++++++++++++++++++++---------------- packages/typescript/index.js | 9 ++++-- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/packages/basic/index.js b/packages/basic/index.js index f20b4e9..9cf80cc 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -4,15 +4,8 @@ module.exports = { browser: true, node: true, }, - extends: [ - 'standard', - 'plugin:import/errors', - 'plugin:import/warnings', - ], - plugins: [ - 'html', - 'unicorn', - ], + extends: ['standard', 'plugin:import/errors', 'plugin:import/warnings'], + plugins: ['html', 'unicorn'], settings: { 'import/resolver': { node: { extensions: ['.js', '.mjs'] }, @@ -45,7 +38,11 @@ module.exports = { 'no-cond-assign': ['error', 'always'], 'func-call-spacing': ['off', 'never'], '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': [ 'error', 'DebuggerStatement', @@ -56,22 +53,32 @@ module.exports = { 'no-spaced-func': 'error', 'object-curly-spacing': ['error', 'always'], 'no-return-await': 'off', - 'space-before-function-paren': ['error', 'never'], + 'space-before-function-paren': 'error', // es6 'no-var': 'error', - 'prefer-const': ['error', { - destructuring: 'any', - ignoreReadBeforeAssign: true, - }], - 'prefer-arrow-callback': ['error', { - allowNamedFunctions: false, - allowUnboundThis: true, - }], - 'object-shorthand': ['error', 'always', { - ignoreConstructors: false, - avoidQuotes: true, - }], + 'prefer-const': [ + 'error', + { + destructuring: 'any', + ignoreReadBeforeAssign: true, + }, + ], + 'prefer-arrow-callback': [ + 'error', + { + allowNamedFunctions: false, + allowUnboundThis: true, + }, + ], + 'object-shorthand': [ + 'error', + 'always', + { + ignoreConstructors: false, + avoidQuotes: true, + }, + ], 'prefer-rest-params': 'error', 'prefer-spread': 'error', 'prefer-template': 'error', diff --git a/packages/typescript/index.js b/packages/typescript/index.js index 54e18b5..cf58587 100644 --- a/packages/typescript/index.js +++ b/packages/typescript/index.js @@ -4,18 +4,23 @@ module.exports = { ], parser: '@typescript-eslint/parser', extends: [ - 'plugin:@typescript-eslint/recommended', '@antfu/eslint-config-basic', + 'plugin:@typescript-eslint/recommended', ], rules: { // TS 'no-useless-constructor': 'off', '@typescript-eslint/semi': ['error', 'never'], - '@typescript-eslint/no-unused-vars': [2, { args: 'none' }], '@typescript-eslint/indent': ['error', 2], '@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }], '@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 '@typescript-eslint/camelcase': 'off', '@typescript-eslint/explicit-function-return-type': 'off',