mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
e9e56d5938
* chore: remove unused ts-node * chore: upgrade lodash * chore: upgrade eslint * perf: remove side effects in computed * refactor: follow eslint rules * chore: remove vue-template-compiler * style: enhance eslint format rule * style: format code
84 lines
2.1 KiB
JavaScript
84 lines
2.1 KiB
JavaScript
module.exports = {
|
|
parser: 'vue-eslint-parser',
|
|
parserOptions: {
|
|
parser: '@typescript-eslint/parser',
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
tsx: true,
|
|
},
|
|
},
|
|
env: {
|
|
browser: true,
|
|
node: true,
|
|
},
|
|
plugins: [
|
|
'@typescript-eslint',
|
|
],
|
|
extends: [
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:vue/vue3-recommended',
|
|
],
|
|
rules: {
|
|
// style
|
|
'block-spacing': 'error',
|
|
'eol-last': 'error',
|
|
'no-trailing-spaces': 'error',
|
|
'comma-style': ['error', 'last'],
|
|
'comma-dangle': ['error', 'always-multiline'],
|
|
'no-multi-spaces': 'error',
|
|
semi: ['error', 'never'],
|
|
'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' }],
|
|
'@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,
|
|
},
|
|
},
|
|
],
|
|
|
|
// vue
|
|
'vue/no-v-html': 'off',
|
|
'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,
|
|
}],
|
|
'vue/require-default-prop': 'off',
|
|
'vue/html-closing-bracket-spacing': 'error',
|
|
},
|
|
}
|