Files
ClassHelper/eslint.config.mjs
T
LoveChengke c7f215a09c feat(courseware,docs): 完善课件传输与岛编辑并统一全仓文档
- 增加课件上传、班级可见范围、设备补收与传输进度
- 整合自定义灵动岛编辑器和相关客户端交互
- 同步三端契约、数据库迁移、部署配置与隔离回归
- 按源码统一文档与官网说明,移除过时任务书和审查记录
- 保持产品版本为 1.4.0
2026-10-18 11:53:37 +08:00

97 lines
2.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import vueParser from 'vue-eslint-parser';
const sharedGlobals = {
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
setInterval: 'readonly',
clearInterval: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly',
fetch: 'readonly',
global: 'readonly',
};
export default tseslint.config(
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/dist-electron/**',
'**/release/**',
'**/release-server/**',
// 交付产物归集目录(pnpm dist:* 的输出,见 AGENTS.md 的现行工程约定):里面是构建后的压缩 JS,不该进 lint
'**/releases/**',
'**/build/**',
'**/coverage/**',
'**/src/generated/**',
'**/.cache/**',
'**/.pnpm-store/**',
'**/.probe/**',
// 文档站(docfx)的构建产物:里面是 docfx 模板自带的压缩 JS 与生成的 HTML
'**/docs/_site/**',
'**/*.d.ts',
],
},
...tseslint.configs.recommended,
...pluginVue.configs['flat/recommended'],
{
// Electron 主进程脚本(图标渲染、UI 冒烟)必须是 CommonJS,允许 require
files: ['**/*.cjs'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'commonjs',
globals: sharedGlobals,
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
extraFileExtensions: ['.vue'],
},
globals: sharedGlobals,
},
},
{
files: ['**/*.{ts,mts,cts,js,mjs,cjs,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: sharedGlobals,
},
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
],
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports' }],
// Vue 组件名使用多单词(Element Plus 视图文件均为 XxxView.vue)
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/html-self-closing': 'off',
'vue/attributes-order': 'off',
'vue/html-indent': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/first-attribute-linebreak': 'off',
},
},
);