Files
photo-live/eslint.config.js
浅念 66d1eb3e9f feat(embed,ui04): E01 v2 contract skeleton — displayMode/scrollSpeed/reactionsEnabled, v2 loader entry and fixed 195x280 shell
- contracts: EmbedSlotSettings optional v2 fields (carousel default) + SlotSettingsPayload; gen + redocly green
- api: DTO validation + normalization full-set (cn manage + ov public projection share normalizeStoredSettings)
- embed-loader: params v2 parse/merge/url family, loader-v2.js fixed shell (border/radius/#10161E/safe-area, resize ignored, stack gap 12), dual-artifact build+sync; v1 source frozen
- viewer: EmbedPage v=2 branch, EmbedStream (viewport/track/real anchors/collapse/empty), stream.ts pure fns, i18n zh/en
- admin: types + utils (create default vertical-stream, clampScrollSpeed, v1/v2 snippet selection)
- tests: loader 36 (+9 v2), viewer 222, admin 82, api unit 51, v1 embed e2e 20, v2 E01 gate 2 (195x280 desktop+mobile cross-origin, no footer)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-22 12:50:28 +08:00

60 lines
2.7 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.
// eslint.config.js —— 根 flat config(覆盖 packages/services/apps 全部 TS + apps 的 Vue SFC)。
// 各包 lint 脚本为 `eslint .`,在包目录执行时向上发现本文件,turbo 不会静默跳过。
// 仅 typescript-eslint recommended(无类型感知规则,无需 project service),
// 避免跨包 tsconfig 差异(contracts NodeNext / api node16)带来的配置负担。
// Vue SFC(P1b Task 5 起,apps 前端):vue-eslint Parser 解析 .vue,script 块交给
// @typescript-eslint/parser;逐项收敛 files 到 apps/**/*.vue,不影响既有纯 TS 包。
// @ts-check
const globals = require('globals');
const tseslint = require('typescript-eslint');
const pluginVue = require('eslint-plugin-vue');
module.exports = tseslint.config(
{
ignores: [
'**/node_modules/',
'**/dist/',
'**/coverage/',
'**/.turbo/',
// 生成产物不参与 lint(契约生成类型已提交入库,改动随 `pnpm gen` 审查)
'**/generated/',
// embed-loader 发布产物拷贝(viewer publicDir 携带,源在 packages/embed-loader
// ——esbuild minify 输出不适用 lint;P4b Task 3 起 viewer lint 曾因此红;
// UI-04 起 v1/v2 双产物同规则忽略)
'apps/viewer/public/embed/',
// Playwright 运行产物
'**/playwright-report/',
'**/test-results/',
'**/blob-report/',
// apps/admin(P1b Task 9,art-design-pro 模板)自带 eslint9 flat config
// (eslint.config.mjs + prettier/stylelint 规则集),与根配置的规则集不同;
// 计划「执行注意」注册的偏差:根配置不覆盖 admin,admin `lint` 脚本跑自己的配置。
'apps/admin/**',
],
},
...tseslint.configs.recommended,
{
files: ['apps/**/*.{ts,tsx}', 'packages/**/*.ts', 'services/**/*.ts'],
languageOptions: {
globals: { ...globals.node },
},
},
// eslint-plugin-vue flat/recommended 的每一段都显式限定到 apps/**/*.vue,
// 避免其无 files 的基础段作用于全部包。
...pluginVue.configs['flat/recommended'].map((config) => ({ ...config, files: ['apps/**/*.vue'] })),
{
files: ['apps/**/*.vue'],
languageOptions: {
globals: { ...globals.browser },
parserOptions: { parser: tseslint.parser, sourceType: 'module' },
},
rules: {
// 根组件 App.vue 是约定俗成的单词名,其余组件仍要求多词命名
'vue/multi-word-component-names': ['error', { ignores: ['App'] }],
// 模板排版类规则与 prettier 职责重叠,交给格式化工具(与官方建议一致)
'vue/max-attributes-per-line': 'off',
'vue/singleline-html-element-content-newline': 'off',
},
},
);