Route all feature requests through business API modules, sync generated DTOs, and add communication tests and architecture documentation. BREAKING CHANGE: migrate the client to plural resource paths, canonical snake_case fields, ISO timestamps, and explicit paginated responses.
76 lines
2.1 KiB
JavaScript
76 lines
2.1 KiB
JavaScript
import js from '@eslint/js'
|
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
import prettier from 'eslint-config-prettier/flat'
|
|
import vue from 'eslint-plugin-vue'
|
|
import globals from 'globals'
|
|
import ts from 'typescript-eslint'
|
|
|
|
export default defineConfig([
|
|
globalIgnores([
|
|
'dist/**',
|
|
'dist-ssr/**',
|
|
'coverage/**',
|
|
'.agents/**',
|
|
'.codex/**',
|
|
'.claude/**',
|
|
]),
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,mts,cts,vue}'],
|
|
extends: [js.configs.recommended],
|
|
},
|
|
{
|
|
files: ['**/*.{ts,mts,cts,vue}'],
|
|
extends: [ts.configs.recommended],
|
|
rules: {
|
|
// vue-tsc checks undefined names, including ambient types in Vue scripts.
|
|
'no-undef': 'off',
|
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.vue'],
|
|
extends: [vue.configs['flat/recommended']],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
parser: ts.parser,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ['src/**/*.{js,ts,vue}'],
|
|
languageOptions: {
|
|
globals: globals.browser,
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
'*.{js,mjs,cjs,ts,mts,cts}',
|
|
'scripts/**/*.{js,mjs,cjs,ts,mts,cts}',
|
|
'tests/**/*.mjs',
|
|
],
|
|
languageOptions: {
|
|
globals: globals.node,
|
|
},
|
|
},
|
|
{
|
|
files: ['src/features/**/*.{ts,vue}'],
|
|
ignores: ['src/features/*/api.ts', 'src/features/auth/authClient.ts'],
|
|
rules: {
|
|
'no-restricted-imports': [
|
|
'error',
|
|
{
|
|
paths: [
|
|
{
|
|
name: '@/lib/api',
|
|
importNames: ['apiRequest'],
|
|
message: '请通过所属业务的 api.ts 调用接口。',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
// Keep formatting in Prettier; this must follow the rule presets.
|
|
prettier,
|
|
])
|