eslint-config/packages/vue/index.js

98 lines
3.3 KiB
JavaScript
Raw Normal View History

2019-07-18 03:27:54 +08:00
module.exports = {
2021-03-15 01:53:40 +08:00
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
'no-unused-vars': 'off',
2021-07-05 11:09:47 +08:00
'no-undef': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
2021-03-15 01:53:40 +08:00
},
],
2019-07-18 03:27:54 +08:00
extends: [
2020-08-12 19:24:32 +08:00
'plugin:vue/vue3-recommended',
2019-07-18 04:43:03 +08:00
'@antfu/eslint-config-ts',
2019-07-18 03:27:54 +08:00
],
2019-07-19 15:32:43 +08:00
rules: {
2021-12-27 17:04:52 +08:00
'vue/max-attributes-per-line': 'off',
2021-03-15 01:53:40 +08:00
'vue/no-v-html': 'off',
2021-09-13 11:31:02 +08:00
'vue/require-prop-types': 'off',
'vue/require-default-prop': 'off',
'vue/multi-word-component-names': 'off',
// reactivity transform
'vue/no-setup-props-destructure': 'off',
2022-03-30 04:20:16 +08:00
'vue/component-tags-order': ['error', {
order: ['script', 'template', 'style'],
}],
2022-05-03 01:07:25 +08:00
'vue/block-tag-newline': ['error', {
singleline: 'always',
multiline: 'always',
}],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/component-options-name-casing': ['error', 'PascalCase'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/define-macros-order': ['error', {
order: ['defineProps', 'defineEmits'],
}],
'vue/html-comment-content-spacing': ['error', 'always', {
exceptions: ['-'],
}],
'vue/no-restricted-v-bind': ['error', '/^v-/'],
'vue/no-useless-v-bind': 'error',
'vue/no-v-text-v-html-on-component': 'error',
'vue/padding-line-between-blocks': ['error', 'always'],
'vue/prefer-separate-static-class': 'error',
// extensions
'vue/array-bracket-spacing': ['error', 'never'],
'vue/arrow-spacing': ['error', { before: true, after: true }],
'vue/block-spacing': ['error', 'always'],
'vue/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'vue/comma-dangle': ['error', 'always-multiline'],
'vue/comma-spacing': ['error', { before: false, after: true }],
'vue/comma-style': ['error', 'last'],
'vue/dot-location': ['error', 'property'],
'vue/dot-notation': ['error', { allowKeywords: true }],
'vue/eqeqeq': ['error', 'smart'],
// 'vue/func-call-spacing': ['off', 'never'],
'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],
'vue/keyword-spacing': ['error', { before: true, after: true }],
'vue/no-constant-condition': 'warn',
'vue/no-empty-pattern': 'error',
'vue/no-extra-parens': ['error', 'functions'],
'vue/no-irregular-whitespace': 'error',
'vue/no-loss-of-precision': 'error',
'vue/no-restricted-syntax': [
'error',
'DebuggerStatement',
'LabeledStatement',
'WithStatement',
],
'vue/no-sparse-arrays': 'error',
'vue/object-curly-newline': ['error', { multiline: true, consistent: true }],
'vue/object-curly-spacing': ['error', 'always'],
'vue/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
'vue/object-shorthand': [
'error',
'always',
{
ignoreConstructors: false,
avoidQuotes: true,
},
],
'vue/operator-linebreak': ['error', 'before'],
'vue/prefer-template': 'error',
'vue/quote-props': ['error', 'consistent-as-needed'],
'vue/space-in-parens': ['error', 'never'],
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': ['error', { words: true, nonwords: false }],
'vue/template-curly-spacing': 'error',
2020-08-12 19:24:32 +08:00
},
2019-07-18 03:27:54 +08:00
}