@yahoo/uds-create-config 5.87.0 → 5.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/system/Settings.js +2 -2
- package/dist/lint/index.d.ts +2 -2
- package/dist/lint/index.js +2 -2
- package/dist/lint/lint.d.ts +3 -1
- package/dist/lint/rules.d.ts +14 -1
- package/dist/lint/rules.js +27 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -193,13 +193,13 @@ const lintFields = z.strictObject({
|
|
|
193
193
|
* `{ editability: 'off', portability: { all: 'error', 'inline-style-on-layer': 'warn' } }`. A
|
|
194
194
|
* rule's own entry wins over its group's; a rule named neither way takes its default, a warning
|
|
195
195
|
* for most. A group never turns on a rule that is off by default. A rule's flat name at the top
|
|
196
|
-
* level (`'inline-style-on-layer': 'warn'`) is read
|
|
196
|
+
* level (`'inline-style-on-layer': 'warn'`) is deprecated, though still read. Keyed by name rather than an enum, so a
|
|
197
197
|
* rule the build adds later needs no new schema; a name that is no rule or group is reported, not
|
|
198
198
|
* refused.
|
|
199
199
|
*/
|
|
200
200
|
rules: z.record(z.string(), z.union([lintSeverity, z.record(z.string(), lintSeverity)])).meta({
|
|
201
201
|
title: "Rules",
|
|
202
|
-
description: "A severity — `'off'`, `'warn'` or `'error'` — per group of authoring lint rules (`portability`, `editability`, `maintainability`, `design`, `compatibility`, `nursery`), or an object per group with `all` for the group and an entry per rule in it: `{ editability: 'off', portability: { all: 'error', 'inline-style-on-layer': 'warn' } }`. A rule's own entry wins over its group's
|
|
202
|
+
description: "A severity — `'off'`, `'warn'` or `'error'` — per group of authoring lint rules (`portability`, `editability`, `maintainability`, `design`, `compatibility`, `nursery`), or an object per group with `all` for the group and an entry per rule in it: `{ editability: 'off', portability: { all: 'error', 'inline-style-on-layer': 'warn' } }`. `all` takes a severity, never `true` or `false`, and there is no `recommended` key. A rule goes under its own group; `uds lint` lists each rule with its group. A rule's own entry wins over its group's. A rule's flat name at the top level is deprecated, though still read. A `nursery` rule runs only when named on its own. Unset, most rules warn. An `'error'` makes `uds lint` exit with status 1, so a CI step that runs it fails. One site is quieted with `// uds-lint-ignore <rule>: <why>` on its line or the line above."
|
|
203
203
|
}).optional(),
|
|
204
204
|
/**
|
|
205
205
|
* Findings the system has decided to keep, each with why: Create's "Ignore", and the config-side
|
package/dist/lint/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintFix, AuthoringLintGroup, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, ConfigReadLintRule, LintReads, flatLintSeverities, lintReads, nestLintSeverities, ruleSeverity } from "./rules.js";
|
|
1
|
+
import { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintFix, AuthoringLintGroup, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, ConfigReadLintRule, LintReads, LintRuleSettingNote, flatLintSeverities, lintReads, lintRuleSettingNotes, nestLintSeverities, ruleSeverity } from "./rules.js";
|
|
2
2
|
import { ConfigLintFinding, ConfigLintOptions, LintIgnore, ignoredBy } from "./context.js";
|
|
3
3
|
import { LintFixSite, fixEdits, groupSeverity, hasFix, ignoreEdits, ignoreEntry, lintIgnores, lintSeverities, restoreEdits, rulesOf, severityEdits } from "./edits.js";
|
|
4
4
|
import { AuthoringLintEdit, AuthoringLintFinding, AuthoringLintResult, LintIgnoreProblem, LintRun, LintSources, lint, lintConfig } from "./lint.js";
|
|
5
|
-
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintEdit, AuthoringLintFinding, AuthoringLintFix, AuthoringLintGroup, AuthoringLintResult, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, type ConfigLintFinding, type ConfigLintOptions, ConfigReadLintRule, LintFixSite, type LintIgnore, LintIgnoreProblem, LintReads, LintRun, LintSources, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, lint, lintConfig, lintIgnores, lintReads, lintSeverities, nestLintSeverities, restoreEdits, ruleSeverity, rulesOf, severityEdits };
|
|
5
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintEdit, AuthoringLintFinding, AuthoringLintFix, AuthoringLintGroup, AuthoringLintResult, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, type ConfigLintFinding, type ConfigLintOptions, ConfigReadLintRule, LintFixSite, type LintIgnore, LintIgnoreProblem, LintReads, LintRuleSettingNote, LintRun, LintSources, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, lint, lintConfig, lintIgnores, lintReads, lintRuleSettingNotes, lintSeverities, nestLintSeverities, restoreEdits, ruleSeverity, rulesOf, severityEdits };
|
package/dist/lint/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ignoredBy } from "./context.js";
|
|
2
|
-
import { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, flatLintSeverities, lintReads, nestLintSeverities, ruleSeverity } from "./rules.js";
|
|
2
|
+
import { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, flatLintSeverities, lintReads, lintRuleSettingNotes, nestLintSeverities, ruleSeverity } from "./rules.js";
|
|
3
3
|
import { fixEdits, groupSeverity, hasFix, ignoreEdits, ignoreEntry, lintIgnores, lintSeverities, restoreEdits, rulesOf, severityEdits } from "./edits.js";
|
|
4
4
|
import { lint, lintConfig } from "./lint.js";
|
|
5
|
-
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, lint, lintConfig, lintIgnores, lintReads, lintSeverities, nestLintSeverities, restoreEdits, ruleSeverity, rulesOf, severityEdits };
|
|
5
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, lint, lintConfig, lintIgnores, lintReads, lintRuleSettingNotes, lintSeverities, nestLintSeverities, restoreEdits, ruleSeverity, rulesOf, severityEdits };
|
package/dist/lint/lint.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from "../framework/Config.js";
|
|
2
|
-
import { AuthoringLintFix, AuthoringLintRule, AuthoringLintSeverity } from "./rules.js";
|
|
2
|
+
import { AuthoringLintFix, AuthoringLintRule, AuthoringLintSeverity, LintRuleSettingNote } from "./rules.js";
|
|
3
3
|
import { ConfigLintFinding, ConfigLintOptions } from "./context.js";
|
|
4
4
|
|
|
5
5
|
//#region src/lint/lint.d.ts
|
|
@@ -50,6 +50,8 @@ interface AuthoringLintResult {
|
|
|
50
50
|
readonly findings: AuthoringLintFinding[];
|
|
51
51
|
/** Names in `settings.lint.rules` that are no rule and no group, which set nothing. */
|
|
52
52
|
readonly unknownRules: string[];
|
|
53
|
+
/** Rules `settings.lint.rules` names outside their own group. */
|
|
54
|
+
readonly ruleSettings?: readonly LintRuleSettingNote[];
|
|
53
55
|
/** `uds-lint-ignore` comments that quiet nothing: one with no reason, one naming no rule, or one
|
|
54
56
|
* with no finding of its rule on its line or the line below. */
|
|
55
57
|
readonly ignores: LintIgnoreProblem[];
|
package/dist/lint/rules.d.ts
CHANGED
|
@@ -336,6 +336,19 @@ type AuthoringLintRuleSettings = Readonly<Record<string, AuthoringLintSeverity |
|
|
|
336
336
|
* naming nothing.
|
|
337
337
|
*/
|
|
338
338
|
declare function flatLintSeverities(rules: AuthoringLintRuleSettings | undefined): Record<string, AuthoringLintSeverity>;
|
|
339
|
+
/** A rule named somewhere other than under its own group in `settings.lint.rules`. */
|
|
340
|
+
interface LintRuleSettingNote {
|
|
341
|
+
/** As written: `inline-style-on-layer` at the top level, or `design/inline-style-on-layer`. */
|
|
342
|
+
readonly name: string;
|
|
343
|
+
readonly rule: AuthoringLintRule;
|
|
344
|
+
/** The group the rule is in, where its entry belongs. */
|
|
345
|
+
readonly group: AuthoringLintGroup;
|
|
346
|
+
/** `flat`: named at the top level, which is deprecated. `wrong-group`: nested under another
|
|
347
|
+
* group, where it sets nothing. */
|
|
348
|
+
readonly problem: 'flat' | 'wrong-group';
|
|
349
|
+
}
|
|
350
|
+
/** Each rule `settings.lint.rules` names outside its own group. */
|
|
351
|
+
declare function lintRuleSettingNotes(rules: AuthoringLintRuleSettings | undefined): LintRuleSettingNote[];
|
|
339
352
|
/**
|
|
340
353
|
* Flat severities written the way `settings.lint.rules` spells them: each group's own severity and
|
|
341
354
|
* its rules' entries under the group, in the order the groups and rules are declared. A group with
|
|
@@ -357,4 +370,4 @@ declare function smallTapTarget(ctx: ConfigLintContext, layer: LintLayer, report
|
|
|
357
370
|
/** duplicate-token: two tokens a property offers, written with one value in every mode. */
|
|
358
371
|
declare function duplicateToken(ctx: ConfigLintContext, report: ConfigLintReport): void;
|
|
359
372
|
//#endregion
|
|
360
|
-
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintFix, AuthoringLintGroup, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, ConfigReadLintRule, LintReads, flatLintSeverities, lintReads, nestLintSeverities, ruleSeverity };
|
|
373
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, AuthoringLintFix, AuthoringLintGroup, AuthoringLintRule, AuthoringLintRuleSettings, AuthoringLintSeverity, CONFIG_LINT_RULES, ConfigLintCheck, ConfigReadLintRule, LintReads, LintRuleSettingNote, flatLintSeverities, lintReads, lintRuleSettingNotes, nestLintSeverities, ruleSeverity };
|
package/dist/lint/rules.js
CHANGED
|
@@ -325,6 +325,32 @@ function flatLintSeverities(rules) {
|
|
|
325
325
|
}
|
|
326
326
|
return flat;
|
|
327
327
|
}
|
|
328
|
+
/** Each rule `settings.lint.rules` names outside its own group. */
|
|
329
|
+
function lintRuleSettingNotes(rules) {
|
|
330
|
+
const notes = [];
|
|
331
|
+
for (const [name, entry] of Object.entries(rules ?? {})) {
|
|
332
|
+
if (typeof entry === "string") {
|
|
333
|
+
const meta = AUTHORING_LINT_RULES[name];
|
|
334
|
+
if (meta) notes.push({
|
|
335
|
+
name,
|
|
336
|
+
rule: name,
|
|
337
|
+
group: meta.group,
|
|
338
|
+
problem: "flat"
|
|
339
|
+
});
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
for (const key of Object.keys(entry)) {
|
|
343
|
+
const meta = AUTHORING_LINT_RULES[key];
|
|
344
|
+
if (meta && meta.group !== name) notes.push({
|
|
345
|
+
name: `${name}/${key}`,
|
|
346
|
+
rule: key,
|
|
347
|
+
group: meta.group,
|
|
348
|
+
problem: "wrong-group"
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return notes;
|
|
353
|
+
}
|
|
328
354
|
/**
|
|
329
355
|
* Flat severities written the way `settings.lint.rules` spells them: each group's own severity and
|
|
330
356
|
* its rules' entries under the group, in the order the groups and rules are declared. A group with
|
|
@@ -511,4 +537,4 @@ function duplicateToken(ctx, report) {
|
|
|
511
537
|
}
|
|
512
538
|
}
|
|
513
539
|
//#endregion
|
|
514
|
-
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, flatLintSeverities, lintReads, nestLintSeverities, ruleSeverity };
|
|
540
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, flatLintSeverities, lintReads, lintRuleSettingNotes, nestLintSeverities, ruleSeverity };
|