|
| 1 | +const { defineConfig } = require('eslint-define-config'); |
| 2 | + |
| 3 | +module.exports = defineConfig({ |
| 4 | + root: true, |
| 5 | + parser: 'vue-eslint-parser', |
| 6 | + parserOptions: { |
| 7 | + sourceType: 'module', |
| 8 | + ecmaFeatures: { |
| 9 | + jsx: true, |
| 10 | + }, |
| 11 | + }, |
| 12 | + env: { |
| 13 | + browser: true, |
| 14 | + node: true, |
| 15 | + }, |
| 16 | + extends: [ |
| 17 | + 'plugin:vue/recommended', |
| 18 | + ], |
| 19 | + rules: { |
| 20 | + // js |
| 21 | + 'eol-last': 'error', |
| 22 | + 'no-trailing-spaces': 'error', |
| 23 | + 'comma-style': ['error', 'last'], |
| 24 | + 'comma-dangle': ['error', 'always-multiline'], |
| 25 | + 'no-multi-spaces': 'error', |
| 26 | + quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }], |
| 27 | + 'object-curly-spacing': ['error', 'always'], |
| 28 | + 'arrow-parens': ['error', 'as-needed'], |
| 29 | + 'spaced-comment': ['error', 'always'], |
| 30 | + 'semi': [2, 'always'], |
| 31 | + // vue |
| 32 | + 'vue/no-v-html': 'off', |
| 33 | + 'vue/singleline-html-element-content-newline': 'off', |
| 34 | + 'vue/multi-word-component-names': 'off', |
| 35 | + 'vue/max-attributes-per-line': ['error', { singleline: 3, multiline: 1 }], |
| 36 | + 'vue/script-indent': ['error', 2, { baseIndent: 1, switchCase: 1 }], |
| 37 | + 'vue/order-in-components': 'off', |
| 38 | + 'vue/require-default-prop': 'off', |
| 39 | + 'vue/html-closing-bracket-spacing': 'error', |
| 40 | + 'vue/require-prop-types': 'off', |
| 41 | + 'vue/prop-name-casing': 'off', |
| 42 | + 'vue/no-template-shadow': 'off', |
| 43 | + 'vue/no-side-effects-in-computed-properties': 'off', |
| 44 | + 'vue/no-mutating-props': 'off', |
| 45 | + 'vue/no-use-v-if-with-v-for': 'off', |
| 46 | + 'vue/require-v-for-key': 'off', |
| 47 | + 'vue/valid-v-for': 'off', |
| 48 | + 'vue/no-unused-vars': 'off', |
| 49 | + 'vue/no-v-model-argument': 'off', |
| 50 | + 'vue/no-multiple-template-root': 'off', |
| 51 | + }, |
| 52 | +}); |
0 commit comments