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,
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', {
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: true,
}],
'prefer-arrow-callback': ['error', {
},
],
'prefer-arrow-callback': [
'error',
{
allowNamedFunctions: false,
allowUnboundThis: true,
}],
'object-shorthand': ['error', 'always', {
},
],
'object-shorthand': [
'error',
'always',
{
ignoreConstructors: false,
avoidQuotes: true,
}],
},
],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',

View File

@ -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',