2020-07-27 16:17:41 +08:00
|
|
|
module.exports = {
|
|
|
|
parser: 'vue-eslint-parser',
|
|
|
|
parserOptions: {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
sourceType: 'module',
|
2020-09-15 12:28:12 +08:00
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
tsx: true,
|
|
|
|
},
|
2020-07-27 16:17:41 +08:00
|
|
|
},
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint',
|
|
|
|
],
|
|
|
|
extends: [
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:vue/vue3-recommended',
|
|
|
|
],
|
|
|
|
rules: {
|
2021-08-27 17:46:06 +08:00
|
|
|
// style
|
|
|
|
'block-spacing': 'error',
|
2020-07-27 16:17:41 +08:00
|
|
|
'eol-last': 'error',
|
|
|
|
'no-trailing-spaces': 'error',
|
|
|
|
'comma-style': ['error', 'last'],
|
|
|
|
'comma-dangle': ['error', 'always-multiline'],
|
2021-06-25 16:25:54 +08:00
|
|
|
'no-multi-spaces': 'error',
|
2020-07-27 16:17:41 +08:00
|
|
|
semi: ['error', 'never'],
|
2021-08-27 17:46:06 +08:00
|
|
|
'arrow-parens':['error', 'as-needed'],
|
|
|
|
'array-bracket-spacing': ['error', 'never'],
|
|
|
|
|
|
|
|
'indent': 'off',
|
|
|
|
'@typescript-eslint/indent':['error', 2, { SwitchCase: 1 }],
|
|
|
|
|
|
|
|
'object-curly-spacing': 'off',
|
|
|
|
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
|
|
|
|
|
|
|
quotes: 'off',
|
|
|
|
'@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
|
|
|
|
|
|
|
|
'space-infix-ops': 'off',
|
|
|
|
'@typescript-eslint/space-infix-ops': ['error', { 'int32Hint': false }],
|
|
|
|
|
|
|
|
'@typescript-eslint/type-annotation-spacing': ['error', {}],
|
|
|
|
|
|
|
|
// js/ts
|
|
|
|
camelcase: ['error', { properties: 'never' }],
|
2020-08-19 21:35:40 +08:00
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
'@typescript-eslint/member-delimiter-style': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
multiline: {
|
|
|
|
delimiter: 'none',
|
|
|
|
requireLast: false,
|
|
|
|
},
|
|
|
|
singleline: {
|
|
|
|
delimiter: 'semi',
|
|
|
|
requireLast: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2021-08-27 17:46:06 +08:00
|
|
|
|
2020-07-27 16:17:41 +08:00
|
|
|
// vue
|
2020-08-19 21:35:40 +08:00
|
|
|
'vue/no-v-html': 'off',
|
2020-07-27 16:17:41 +08:00
|
|
|
'vue/singleline-html-element-content-newline': 'off',
|
|
|
|
'vue/html-self-closing': ['error', {
|
|
|
|
html: {
|
|
|
|
void: 'never',
|
|
|
|
normal: 'never',
|
|
|
|
component: 'always',
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
'vue/max-attributes-per-line': ['error', {
|
|
|
|
singleline: 3,
|
|
|
|
multiline: 1,
|
|
|
|
}],
|
2020-08-19 21:35:40 +08:00
|
|
|
'vue/require-default-prop': 'off',
|
2020-07-27 16:17:41 +08:00
|
|
|
'vue/html-closing-bracket-spacing': 'error',
|
|
|
|
},
|
|
|
|
}
|