12345678910111213141516171819202122232425262728293031323334353637 |
- module.exports = {
- root: true,
- env: {
- browser: true,
- es2024: true,
- node: true,
- },
- extends: [
- 'eslint:recommended',
- 'plugin:vue/vue3-recommended',
- '@vue/eslint-config-typescript',
- '@vue/eslint-config-prettier',
- ],
- parserOptions: {
- ecmaVersion: 'latest',
- parser: '@typescript-eslint/parser',
- sourceType: 'module',
- },
- plugins: ['vue', '@typescript-eslint'],
- rules: {
- // 自定义规则
- 'vue/multi-word-component-names': 'off', // 允许单文件组件使用单个单词
- '@typescript-eslint/no-explicit-any': 'off', // 允许使用 any 类型
- 'vue/html-self-closing': [
- 'error',
- {
- // 自闭合标签配置
- html: {
- void: 'always',
- normal: 'always',
- component: 'always',
- },
- },
- ],
- 'prettier/prettier': ['error', { endOfLine: 'auto' }],
- },
- }
|