2025-10-30 19:30:06 +08:00
|
|
|
import { globalIgnores } from 'eslint/config';
|
|
|
|
|
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript';
|
|
|
|
|
import pluginVue from 'eslint-plugin-vue';
|
|
|
|
|
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
|
|
|
|
|
|
|
|
|
|
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
|
|
|
|
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
|
|
|
|
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
|
|
|
|
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
|
|
|
|
|
|
|
|
|
export default defineConfigWithVueTs(
|
|
|
|
|
{
|
|
|
|
|
name: 'app/files-to-lint',
|
|
|
|
|
files: ['**/*.{ts,mts,tsx,vue}'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']),
|
|
|
|
|
|
|
|
|
|
pluginVue.configs['flat/essential'],
|
|
|
|
|
vueTsConfigs.recommended,
|
|
|
|
|
skipFormatting,
|
|
|
|
|
{
|
|
|
|
|
rules: {
|
2025-12-02 14:47:10 +08:00
|
|
|
'arrow-spacing': ['error', { before: true, after: true }],
|
|
|
|
|
'comma-dangle': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
arrays: 'always-multiline',
|
|
|
|
|
objects: 'always-multiline',
|
|
|
|
|
imports: 'always-multiline',
|
|
|
|
|
exports: 'always-multiline',
|
|
|
|
|
functions: 'never',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'comma-spacing': ['error', { before: false, after: true }],
|
2025-12-02 15:14:00 +08:00
|
|
|
indent: 'off',
|
2025-12-02 14:47:10 +08:00
|
|
|
'key-spacing': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
beforeColon: false,
|
|
|
|
|
afterColon: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'keyword-spacing': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
before: true,
|
|
|
|
|
after: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'no-multiple-empty-lines': ['error', { max: 1 }],
|
2025-10-30 19:30:06 +08:00
|
|
|
'no-multi-spaces': 'error',
|
|
|
|
|
'no-trailing-spaces': 'error',
|
|
|
|
|
'object-curly-spacing': ['error', 'always'],
|
|
|
|
|
'padding-line-between-statements': [
|
|
|
|
|
'error',
|
|
|
|
|
{ blankLine: 'always', prev: 'import', next: '*' },
|
|
|
|
|
{ blankLine: 'never', prev: 'import', next: 'import' },
|
|
|
|
|
],
|
2025-12-02 14:47:10 +08:00
|
|
|
quotes: ['error', 'single'],
|
|
|
|
|
semi: ['error', 'always'],
|
2025-10-30 19:30:06 +08:00
|
|
|
'space-before-blocks': ['error', 'always'],
|
2025-12-02 14:47:10 +08:00
|
|
|
'spaced-comment': [
|
|
|
|
|
'error',
|
|
|
|
|
'always',
|
|
|
|
|
{
|
|
|
|
|
line: { markers: ['/'], exceptions: ['/'] },
|
|
|
|
|
block: { exceptions: ['*'], balanced: true },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'space-infix-ops': ['error', { int32Hint: false }],
|
|
|
|
|
'vue/html-closing-bracket-newline': 'off',
|
|
|
|
|
'vue/html-indent': 'off',
|
2025-10-30 19:30:06 +08:00
|
|
|
'vue/first-attribute-linebreak': ['error', { singleline: 'ignore', multiline: 'below' }],
|
2025-12-02 14:47:10 +08:00
|
|
|
'vue/max-attributes-per-line': 'off',
|
2025-10-30 19:30:06 +08:00
|
|
|
'vue/multi-word-component-names': 'off',
|
|
|
|
|
'vue/mustache-interpolation-spacing': ['error', 'always'],
|
|
|
|
|
'vue/no-multi-spaces': 'error',
|
|
|
|
|
'vue/no-static-inline-styles': 'error',
|
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
);
|