1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| function getRules() { const { version = '' } = require('eslint-plugin-vue/package.json') const rules = { 'vue/array-bracket-spacing': 2, 'vue/arrow-spacing': 2, 'vue/block-spacing': 2, 'vue/brace-style': 2, 'vue/camelcase': 2, 'vue/comma-dangle': 2, 'vue/component-name-in-template-casing': 2, 'vue/eqeqeq': 2, 'vue/html-indent': [2, 4], 'vue/html-quotes': [2, 'double'], 'vue/html-self-closing': [__ERROR__], 'vue/key-spacing': 2, 'vue/match-component-file-name': [1, { extensions: ['jsx', 'tsx', 'vue'], shouldMatchCase: false, }], 'vue/max-attributes-per-line': [2, { singleline: 2, multiline: { max: 1, }, }], 'vue/no-unused-components': [__WARN__], 'vue/no-unused-vars': 0, 'vue/no-reserved-component-names': [2, { disallowVueBuiltInComponents: true, disallowVue3BuiltInComponents: true, }], 'vue/object-curly-spacing': 2, 'vue/padding-line-between-blocks': [2], 'vue/require-default-prop': [0], 'vue/require-name-property': [2], 'vue/static-class-names-order': [2], 'vue/v-for-delimiter-style': [2, 'in'], }
if (versionCompare(version, '7.20.0') >= 0) { rules['vue/multi-word-component-names'] = [1] } if (versionCompare(version, '8.4.0') >= 0) { rules['vue/no-v-text-v-html-on-component'] = [1] } return rules }
|