包文件→ .shtukbase/packages/live/checks/lib.ts
checks/lib.ts
14 行, 756 B.
文件按包中的原样显示:代码及其注释不做翻译。
- // Shared part of the live checks: the problems of /base/live.md for one norm, as findings of a rule.
- import { type Project, type Result } from '../../collections/checks/lib/speclib.ts';
- import { PAGE, readSettings } from '../server/settings.ts';
- export { main } from '../../collections/checks/lib/runner.ts';
- /** Findings of the norm `rule` (LIVE-R0n) in the settings page; returns the settings for more checks. */
- export function settingsFindings(p: Project, res: Result, rule: string, fix: string) {
- const s = readSettings(p.root);
- res.scope = [PAGE];
- res.part('live server settings', null);
- for (const x of s.problems.filter((x) => x.includes(`(${rule})`))) res.hole(PAGE, x.replace(` (${rule})`, ''), fix, rule.toLowerCase());
- return s;
- }