@duro-app/slint-config
用于 Duro 堆栈的可共享的 ESLint 平面配置 — CLAUDE.md 和
代理记忆只能暗示, 连接到电线, 所以每个消费者的回波
(通过amont的内置) pre-commit-lint-js,哪个
在根 ESLint 配置( root ESLint config) 和 CI 中激活.
需要 ESLint 9 或 10 (平面配置) 。 它只保留设计系统
UI - 图书馆政策, 如 reactA. 一般性公约base, (中文(简体) ), effect, (中文(简体) ),
tests)和决定规则桥(adrLint)来自
@aval-adr/eslint-config, (中文(简体) ),
此软件包将扩展并声明为对等点:安装两者.
pnpm add -D @duro-app/eslint-config @aval-adr/eslint-config
使用量
// eslint.config.js (repo root — amont only detects a ROOT config)
import {react} from '@duro-app/eslint-config'
import {effect, tests} from '@aval-adr/eslint-config'
export default [
{ignores: ['**/dist/**', '**/build/**']},
...react,
...tests,
// Server-only packages in a monorepo can scope the effect preset:
...effect.map((c) => ({...c, files: ['apps/api/**/*.ts']})),
]
预设
| 预设 | 从 | 编曲 | 对于 |
|---|---|---|---|
react | @duro-app/eslint-config | 月球 base + 经典反应- 呼 + duro 插件 + UI 政策 | 确定定义/ @duro-app/ui 应用程序 |
base | @aval-adr/eslint-config | @eslint/js + 键 typescript-eslint 推荐, 更美的间距 | 每个类型脚本包 |
effect | @aval-adr/eslint-config | base + 键 @effect 插件 + 服务器存储策略 | 效果服务 |
tests | @aval-adr/eslint-config | 可访问性第一选择器(自测到测试/e2e文件) | 任何带有测试的重播 |
react 报告其进口禁令为: duro/no-restricted-imports,除
effect是因为 @typescript-eslint/no-restricted-imports 和adr -lint's (英语)
adr-lint/no-restricted-imports,所以编织它们 保持每一个禁令:
三个比另一个强.
政策的执行
react:UI原始人来自@duro-app/ui只有反应, 光谱、MUI、Radix、Chakra、头部收缩、蚂蚁和@frontjutsu/ui为: 禁用信件, 并注明添加缺失组件的位置 。 富有 文本通过@fredericrous/lexical-multi从不生lexical。 也带着一切@duro-app/eslint-plugin: html.* 元素, 深信使导入、信使值和窗体包.effect财务报告和审定财务报表tests记录@aval-adr/eslint-config。 。 。 .
塞克瑞特是一条线: error 在犯罪门和CI, warn
到处通知 别加 --max-warnings=0 - 促进一项规则
error 换句话说,如果能赚到钱的话.
3.0 采用现有债务
3.0 促进 duro/no-raw-design-values 改为 error 添加
duro/no-raw-breakpoint-query。已经包含原始值的还本存出
每扇门 新设 将旧的用一个
清晰的文件列表 — 从不 glob, 从不 --max-warnings数字 :
// eslint.duro-baseline.js — delete a line when its file is migrated. Never add one.
export const RAW_VALUES_BASELINE = [
'app/routes/legacy-dashboard.tsx',
'app/components/OldChart/OldChart.tsx',
]
// eslint.config.js — after the presets, so last-wins downgrades only these
import {RAW_VALUES_BASELINE} from './eslint.duro-baseline.js'
export default [
...react,
{files: RAW_VALUES_BASELINE, rules: {'duro/no-raw-design-values': 'warn'}},
]
大多数结论都附有建议;ESLint API可以批量应用
(单位:千美元)message.suggestions[0].fix) (中文(简体) ). 剩下的是那些需要
人类选择——一种非平面颜色,一种非平面相距.
逃生舱
平面配置是最后的胜负——范围是预设之后的覆盖:
...react,
{
// The one file allowed to import the raw engine reset:
files: ['packages/editor/src/usePageNode.ts'],
rules: {'duro/no-restricted-imports': 'off'},
}
adr-lint 规则 (opt- in)
adrLint 财务报告和审定财务报表 adrLintTyped 添加决定的代码规则 :
没错 从 @aval-adr/eslint-config 把它们放在最后 他们
禁令有自己的规则 id,所以没有 stack 选项( 6. 0 放弃) :
import {react} from '@duro-app/eslint-config'
import {adrLint} from '@aval-adr/eslint-config'
export default [...react, ...adrLint()]
从 5.x 移动
- 添加
@aval-adr/eslint-config(单位:千美元)^0.16.0在这个包裹旁边. - 导入
base, (中文(简体) ),effect, (中文(简体) ),tests财务报告和审定财务报表adrLint从它; 保留react从这里. - 丢弃
stack从一个adrLint电话. - 覆盖
no-restricted-imports因为UI禁令变成duro/no-restricted-imports。 。 。 .