SuperAPI AI 工具集

fix-angular-fixmes

编程与开发

查看项目

更新于 10-15 17:26

技能介绍

用途:解决 Bitwarden clients 代码库中 FIXME 跟踪和 ESLint 抑制注释。核心规则:必须修复底层问题,不得只删注释;完整移除 FIXME 行、TODO Skipped 块和 eslint-disable-next-line;两种形式(FIXME 配对与独立抑制)按同一方式处理。

主要能力:

  • 发现抑制:用 Grep 搜索 eslint-disable 和 FIXME.*CL-,按规则分组。
  • 规则覆盖:@angular-eslint/prefer-on-push-component-change-detection(改为 OnPush,@Directive 跳过)、@angular-eslint/prefer-signals 与 prefer-output-emitter-ref(用于 @Input/@Output/@ViewChild/@ContentChild,不得将服务 observable 转信号,见 ADR-0027)、@typescript-eslint/no-floating-promises(改用 await、void 或 .catch())、no-unused-vars、no-unsafe-function-type(用具体签名替换 Function)、rxjs/no-async-subscribe 与 rxjs-angular/prefer-takeuntil(用 switchMap/takeUntilDestroyed)、@bitwarden/platform/no-enums(转为 const 对象与类型别名)、no-restricted-imports(查配置改用允许路径)、no-console、no-empty、裸 eslint-disable、HTML 规则(button-has-type、no-bwi-class-usage、Tailwind 自定义类名)。

使用方式:先 Grep 定位,按规则修复,然后每处清理清单(移除 FIXME、TODO 块、disable 行,更新导入与用法),最后运行 npm run lint:fix,必要时 npm run test。

适用场景:Angular 现代化迁移、ESLint 技术债清理。

限制:OnPush 与信号模式以 angular-modernization 技能为准,本技能只负责 ESLint 抑制机制;Angular 迁移优先使用 CLI schematics;不得将服务 observable 转信号;缺失信息暂未提供。