Files
RawMark/web/eslint.config.js
T
eezd 6b537c03e0 refactor(web): align resource APIs and forms with the starter conventions
Centralize typed resource functions under common/apis and return complete JSON envelopes while preserving raw responses, bearer session isolation, and single-owner errors.

Keep settings state and queues inside the setup store. Use Element Plus forms and dialogs for login, settings, imports, moves, and images; preserve editor interactions and themes. Update callers, tests, generated declarations, and request import constraints together.
2026-10-26 11:53:37 +08:00

55 lines
1.9 KiB
JavaScript

import antfu from '@antfu/eslint-config'
// 更多自定义配置可查阅仓库:https://github.com/antfu/eslint-config
export default antfu(
{
// 使用外部格式化程序格式化 css、html、markdown 等文件
formatters: true,
// 启用样式规则
stylistic: {
// 缩进级别
indent: 2,
// 引号风格 'single' | 'double'
quotes: 'single',
// 是否启用分号
semi: false,
},
// 忽略文件
ignores: ['dist/**', 'types/auto/**', 'public/**', 'src/common/appearance/fonts/**', 'src/common/appearance/maple-font.css', 'LICENSE'],
},
{
// 对所有文件都生效的规则
rules: {
// 保留项目现有紧凑分支及浏览器原生危险操作确认。
'style/max-statements-per-line': 'off',
'no-alert': 'off',
// vue
'vue/block-order': ['error', { order: ['script', 'template', 'style'] }],
'vue/attributes-order': 'off',
// ts
'ts/no-use-before-define': 'off',
// node
'node/prefer-global/process': 'off',
// style
'style/comma-dangle': ['error', 'always-multiline'],
'style/brace-style': ['error', '1tbs'],
// regexp
'regexp/no-unused-capturing-group': 'off',
// other
'no-console': 'off',
'no-debugger': 'off',
'symbol-description': 'off',
'antfu/if-newline': 'off',
'unicorn/no-instanceof-builtins': 'off',
},
},
{
files: ['src/**/*.{ts,vue}'],
ignores: ['src/common/apis/**', 'src/http/**', 'src/**/*.test.ts'],
rules: {
'no-restricted-imports': ['error', { paths: [{ name: '@/http/axios', importNames: ['request'], message: '业务请求统一放在 common/apis/<resource>/index.ts。' }, { name: 'axios', importNames: ['default'], message: '复用 http/axios 的统一请求处理。' }] }],
},
},
{ files: ['src/service-worker.js'], languageOptions: { globals: { __PRECACHE__: 'readonly' } } },
)