123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- module.exports = {
- root: true,
- env: {
- node: true,
- },
- extends: [
- 'vue-global-api',
- 'plugin:vue/vue3-recommended',
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- '@vue/typescript/recommended',
- 'plugin:prettier/recommended',
- ],
- parser: 'vue-eslint-parser',
- parserOptions: {
- parser: {
- js: 'espree',
- ts: '@typescript-eslint/parser',
- '<template>': 'espree',
- },
- sourceType: 'module',
- ecmaFeatures: {
- jsx: true,
- tsx: true,
- },
- warnOnUnsupportedTypeScriptVersion: false,
- },
- rules: {
- 'no-undef': 'off',
- 'no-console': 'off',
- 'no-debugger': 'off',
- 'prettier/prettier': 'warn',
- 'vue/no-reserved-component-names': 'off',
- '@typescript-eslint/no-this-alias': 'off',
- '@typescript-eslint/no-explicit-any': 'off',
- '@typescript-eslint/no-var-requires': 'off',
- '@typescript-eslint/no-empty-function': 'off',
- '@typescript-eslint/ban-ts-comment': 'off',
- 'vue/no-v-html': 'off',
- 'vue/html-self-closing': [
- 'error',
- {
- html: {
- void: 'any',
- normal: 'any',
- component: 'always',
- },
- svg: 'always',
- math: 'always',
- },
- ],
- // 多字组件名称
- 'vue/multi-word-component-names': 'off',
- // Vue.js风格指南(https://cn.vuejs.org/v2/style-guide/)
- // Vue组件排序
- 'vue/order-in-components': [
- 'warn',
- {
- order: [
- 'el',
- 'name',
- 'key',
- 'parent',
- 'functional',
- ['delimiters', 'comments'],
- ['components', 'directives', 'filters'],
- 'extends',
- 'mixins',
- ['provide', 'inject'],
- 'ROUTER_GUARDS',
- 'layout',
- 'middleware',
- 'validate',
- 'scrollToTop',
- 'transition',
- 'loading',
- 'inheritAttrs',
- 'model',
- ['props', 'propsData'],
- 'emits',
- 'setup',
- 'fetch',
- 'asyncData',
- 'data',
- 'head',
- 'computed',
- 'watch',
- 'watchQuery',
- 'LIFECYCLE_HOOKS',
- 'methods',
- ['template', 'render'],
- 'renderError',
- ],
- },
- ],
- // Vue属性排序
- 'vue/attributes-order': [
- 'warn',
- {
- order: [
- 'DEFINITION',
- 'LIST_RENDERING',
- 'CONDITIONALS',
- 'RENDER_MODIFIERS',
- 'GLOBAL',
- 'UNIQUE',
- 'TWO_WAY_BINDING',
- 'OTHER_DIRECTIVES',
- 'OTHER_ATTR',
- 'EVENTS',
- 'CONTENT',
- ],
- alphabetical: true, //字母顺序
- },
- ],
- },
- overrides: [
- {
- files: [
- '**/__tests__/*.{j,t}s?(x)',
- '**/tests/unit/**/*.spec.{j,t}s?(x)',
- ],
- env: {
- jest: true,
- },
- },
- {
- files: [
- '**/__tests__/*.{j,t}s?(x)',
- '**/tests/unit/**/*.spec.{j,t}s?(x)',
- ],
- env: {
- jest: true,
- },
- },
- ],
- }
|