|
1 | | -import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' |
2 | | -import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' |
3 | | -import pluginVue from 'eslint-plugin-vue' |
4 | | -import { globalIgnores } from 'eslint/config' |
| 1 | +import antfu from '@antfu/eslint-config'; |
5 | 2 |
|
6 | | -// To allow more languages other than `ts` in `.vue` files, uncomment the following lines: |
7 | | -// import { configureVueProject } from '@vue/eslint-config-typescript' |
8 | | -// configureVueProject({ scriptLangs: ['ts', 'tsx'] }) |
9 | | -// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup |
10 | | - |
11 | | -export default defineConfigWithVueTs( |
12 | | - { |
13 | | - name: 'app/files-to-lint', |
14 | | - files: ['**/*.{ts,mts,tsx,vue}'], |
| 3 | +export default antfu({ |
| 4 | + type: 'lib', |
| 5 | + stylistic: { |
| 6 | + indent: 2, |
| 7 | + quotes: 'single', |
| 8 | + semi: true, |
15 | 9 | }, |
| 10 | + typescript: true, |
| 11 | + vue: true, |
| 12 | + jsonc: false, |
| 13 | + yaml: false, |
| 14 | + ignores: [ |
| 15 | + '**/fixtures', |
| 16 | + ], |
| 17 | +}, { |
| 18 | + // Additional config for more specific rules |
| 19 | + files: ['**/*.vue', '**/*.ts', '**/*.tsx', '**/*.js'], |
| 20 | + rules: { |
| 21 | + // TypeScript unused vars with underscore ignore pattern |
| 22 | + '@typescript-eslint/no-unused-vars': [ |
| 23 | + 'error', |
| 24 | + { |
| 25 | + argsIgnorePattern: '^_', |
| 26 | + varsIgnorePattern: '^_', |
| 27 | + }, |
| 28 | + ], |
16 | 29 |
|
17 | | - globalIgnores(['**/public/**', '**/dist/**', '**/dist-ssr/**', '**/coverage/**']), |
| 30 | + // Vue template formatting |
| 31 | + 'vue/max-attributes-per-line': [ |
| 32 | + 'warn', // Use 'warn' instead of 'error' for less strict enforcement |
| 33 | + { |
| 34 | + singleline: 3, |
| 35 | + multiline: 2, |
| 36 | + }, |
| 37 | + ], |
| 38 | + 'vue/first-attribute-linebreak': ['warn', { |
| 39 | + singleline: 'ignore', |
| 40 | + multiline: 'below', |
| 41 | + }], |
| 42 | + 'vue/html-closing-bracket-newline': ['warn', { |
| 43 | + singleline: 'never', |
| 44 | + multiline: 'always', |
| 45 | + }], |
18 | 46 |
|
19 | | - pluginVue.configs['flat/essential'], |
20 | | - vueTsConfigs.recommended, |
21 | | - skipFormatting, |
22 | | -) |
| 47 | + 'vue/custom-event-name-casing': ['error', 'kebab-case'], |
| 48 | + 'node/prefer-global/process': ['warn'], |
| 49 | + 'no-console': ['warn'], |
| 50 | + }, |
| 51 | +}); |
0 commit comments