教室机器上的 ClassIsland 现在可以直接和班级小助手互通:插件走 /api/integrations/classisland/*,用设备令牌(X-ClassIsland-Token,库里只存 sha256)独立鉴权,不占用 JWT 通道。 - 服务端:新增 integrations 模块(上报 / 待弹出 / 回执 / 课表镜像 / 回写),两个迁移(设备令牌表、Class.notificationChannel);通知、叫人、联动页下发统一复用 pushToClassIsland,避免"某个页面发的通知不联动" - 插件:packages/classisland-plugin(.NET 8,独立于 pnpm workspace)——BridgeService 上报与提醒轮询、ScheduleMapper/ClassPlanWriter 课表镜像、Avalonia 设置页、ClassHelperNotificationProvider 在 ClassIsland 上弹出提醒;本地/内网地址强制直连,躲开系统代理返回的假 404 - 客户端:设置页可选提醒通道(both / client / classisland),并订阅相应实时事件 - Web 端:新增「ClassIsland 联动」页(设备管理与提醒下发) - 校验与打包:verify:classisland(需后端)、verify:classisland-plugin(静态契约 54 项)、build/dist:classisland-plugin 产出 .cipx - 文档:README 与 AGENTS.md 同步新增联动说明,docs/screenshots/classisland 留三张真机截图 门禁:pnpm lint 0 error、pnpm typecheck 四包通过、verify:classisland-plugin 54/54 通过。运行期仍需在装了 ClassIsland 的机器上实测(步骤见 AGENTS.md §8)。
95 lines
2.6 KiB
JavaScript
95 lines
2.6 KiB
JavaScript
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 §4):里面是构建后的压缩 JS,不该进 lint
|
||
'**/releases/**',
|
||
'**/build/**',
|
||
'**/coverage/**',
|
||
'**/src/generated/**',
|
||
'**/.cache/**',
|
||
'**/.pnpm-store/**',
|
||
'**/.probe/**',
|
||
'**/*.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',
|
||
},
|
||
},
|
||
);
|