@starci/eslint-canon-fe 9.9.11 → 9.9.12
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.js +1 -1
- package/dist/lib/cross-file-inputs.d.ts +1 -1
- package/dist/lib/cross-file-inputs.js +1 -1
- package/dist/project-graph.d.ts +1 -1
- package/dist/project-graph.js +1 -1
- package/docs/surface-rules.md +2 -2
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +7 -7
- package/runtime/knowledge/sonar-gate.yaml +2 -2
- package/runtime/scripts/hfs/rules/read.mjs +13 -0
- package/runtime/scripts/lib/sonar-syntax-rules.mjs +1 -1
- package/runtime/scripts/lib/sonar-way.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.9.12
|
|
4
|
+
|
|
5
|
+
- Changed: Carry the bundled runtime of @starci/hfs 5.0.8 (the rule texts name `app check`, the read-set helper of the rule memo) and its canon pins; the comments name `app check` for the removed lint verb.
|
|
6
|
+
|
|
3
7
|
## 9.9.11
|
|
4
8
|
|
|
5
9
|
- Changed: Recognize declared module hook roles through real hook-call provenance.
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ columns inside a joined card, where `PaneGrid` owns both (`FE_HAND_BUILT_PANES`)
|
|
|
48
48
|
The spacing law (R350) leaves every distance to Grammar: `no-spacing-utility` refuses a padding, margin, gap
|
|
49
49
|
or space utility (`p-*`, `px-*`, `m*-*`, `gap-*`, `space-*`, arbitrary values and variants included) in an app class
|
|
50
50
|
string, where a role prop names the relation instead (`Stack`/`Cluster` `gap`, `Grid` `kind`, `PaneSection`, `Page`;
|
|
51
|
-
`FE_SPACING_UTILITY`). It runs in the counting cohort (`COUNTING` of `src/lib/config.ts`): `starci app lint` reports
|
|
51
|
+
`FE_SPACING_UTILITY`). It runs in the counting cohort (`COUNTING` of `src/lib/config.ts`): `starci app check --gate lint` reports
|
|
52
52
|
and counts every finding at warn and fails on none, while `starci app codemod spacing-roles` migrates the app.
|
|
53
53
|
|
|
54
54
|
The [button intent law](docs/button-intent.md) (CTA-6) requires every app Button and IconButton to
|
package/dist/index.js
CHANGED
|
@@ -311,6 +311,6 @@ for (const addition of A14_CONTRIBUTIONS) {
|
|
|
311
311
|
Object.assign(rules, addition.rules);
|
|
312
312
|
Object.assign(recommended, addition.recommended);
|
|
313
313
|
}
|
|
314
|
-
// The result cache of `starci app lint` (contexts/project/check-cache.md) reads these two declarations of the installed canon.
|
|
314
|
+
// The result cache of `starci app check --gate lint` (contexts/project/check-cache.md) reads these two declarations of the installed canon.
|
|
315
315
|
export { crossFileInputs } from "./lib/cross-file-inputs.js";
|
|
316
316
|
export { projectGraph } from "./project-graph.js";
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const IGNORED: readonly string[];
|
|
|
29
29
|
export declare const BORROWED: Readonly<Record<string, "error">>;
|
|
30
30
|
/**
|
|
31
31
|
* The counting cohort: a rule the owner ruled to ship at `warn` for one release while a codemod moves apps onto the API
|
|
32
|
-
* it asks for, each with the HFS rule id it enforces. `starci app lint` reports and counts its findings and never fails
|
|
32
|
+
* it asks for, each with the HFS rule id it enforces. `starci app check --gate lint` reports and counts its findings and never fails
|
|
33
33
|
* on them; the next cohort moves the rule to error and deletes its entry. No other rule may be below error.
|
|
34
34
|
*/
|
|
35
35
|
export declare const COUNTING: Readonly<Record<string, {
|
package/dist/lib/config.js
CHANGED
|
@@ -42,7 +42,7 @@ export const BORROWED = Object.freeze({
|
|
|
42
42
|
const levelOf = (setting) => (Array.isArray(setting) ? setting[0] : setting);
|
|
43
43
|
/**
|
|
44
44
|
* The counting cohort: a rule the owner ruled to ship at `warn` for one release while a codemod moves apps onto the API
|
|
45
|
-
* it asks for, each with the HFS rule id it enforces. `starci app lint` reports and counts its findings and never fails
|
|
45
|
+
* it asks for, each with the HFS rule id it enforces. `starci app check --gate lint` reports and counts its findings and never fails
|
|
46
46
|
* on them; the next cohort moves the rule to error and deletes its entry. No other rule may be below error.
|
|
47
47
|
*/
|
|
48
48
|
export const COUNTING = Object.freeze({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The files a rule of this canon reads that ESLint's own import graph does not carry.
|
|
3
3
|
*
|
|
4
|
-
* The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
|
|
4
|
+
* The result cache of `starci app check --gate lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
|
|
5
5
|
* changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
|
|
6
6
|
* has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The files a rule of this canon reads that ESLint's own import graph does not carry.
|
|
3
3
|
*
|
|
4
|
-
* The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
|
|
4
|
+
* The result cache of `starci app check --gate lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
|
|
5
5
|
* changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
|
|
6
6
|
* has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
|
|
7
7
|
*
|
package/dist/project-graph.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface ProjectGraphSnapshot {
|
|
|
19
19
|
/**
|
|
20
20
|
* The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
|
|
21
21
|
*
|
|
22
|
-
* The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
|
|
22
|
+
* The result cache of `starci app check --gate lint` calls this once for a side whose files changed and compares each file's findings with the recorded
|
|
23
23
|
* ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
|
|
24
24
|
* graph the rules read (same machine, same manifest, same filter), never a second judge.
|
|
25
25
|
*
|
package/dist/project-graph.js
CHANGED
|
@@ -21,7 +21,7 @@ export const recommended = Object.fromEntries(mine.map((e) => [`starci-fe/${e.id
|
|
|
21
21
|
/**
|
|
22
22
|
* The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
|
|
23
23
|
*
|
|
24
|
-
* The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
|
|
24
|
+
* The result cache of `starci app check --gate lint` calls this once for a side whose files changed and compares each file's findings with the recorded
|
|
25
25
|
* ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
|
|
26
26
|
* graph the rules read (same machine, same manifest, same filter), never a second judge.
|
|
27
27
|
*
|
package/docs/surface-rules.md
CHANGED
|
@@ -4,7 +4,7 @@ Law module: `surface-rules.mjs`. HFS rule: R318. Canon: ANATOMY-2 and PADDING-0.
|
|
|
4
4
|
|
|
5
5
|
## `starci-fe/no-app-surface-paint`
|
|
6
6
|
|
|
7
|
-
Finding code: `FE_GRAMMAR_LAYOUT_ONLY`. App classes carry layout. A raw `bg-surface` utility paints a surface and is refused, including conditional classes, class builders, responsive variants, important modifiers and opacity suffixes. Compose a painted Grammar surface such as `SurfaceCard`. Static props spreads keep the same obligations.
|
|
7
|
+
Finding code: `FE_GRAMMAR_LAYOUT_ONLY`. App classes carry layout. A raw `bg-surface` utility paints a surface and is refused, including conditional classes, class builders, responsive variants, important modifiers and opacity suffixes. Compose a painted Grammar surface such as `SurfaceCard`. Static props spreads keep the same obligations. The typed lint of an app follows imported colocated class declarations as well as local constants.
|
|
8
8
|
|
|
9
9
|
## `starci-fe/no-list-panel-padding`
|
|
10
10
|
|
|
@@ -26,7 +26,7 @@ const Panel = () => <div className="px-4"><SurfaceCard><ListBox inset="panel" la
|
|
|
26
26
|
|
|
27
27
|
## `starci-fe/no-hand-built-panes`
|
|
28
28
|
|
|
29
|
-
Finding code: `FE_HAND_BUILT_PANES`. A multi-pane frame is a `PaneGrid` of `Pane`s, which draws the dividers between panes, sizes the columns and collapses a side pane below medium. A vertical `Divider` used as a column seam is a pane frame drawn by hand: a vertical `Divider` (or the plain wrapper element that holds only it) standing among plain column elements (`div`, `aside`, `Region`) of a flex row, or a vertical `Divider` anywhere inside a `SurfaceCard composition="joined"`; and a joined card that holds a plain flex row of two or more columns as one of its own children. `joined` stacks bands divided by horizontal separators. A short vertical separator between controls of a toolbar, a `flex-col` stack, and a row whose classes cannot be read in the file are not judged.
|
|
29
|
+
Finding code: `FE_HAND_BUILT_PANES`. A multi-pane frame is a `PaneGrid` of `Pane`s, which draws the dividers between panes, sizes the columns and collapses a side pane below medium. A vertical `Divider` used as a column seam is a pane frame drawn by hand: a vertical `Divider` (or the plain wrapper element that holds only it) standing among plain column elements (`div`, `aside`, `Region`) of a flex row, or a vertical `Divider` anywhere inside a `SurfaceCard composition="joined"`; and a joined card that holds a plain flex row of two or more columns as one of its own children. `joined` stacks bands divided by horizontal separators. A short vertical separator between controls of a toolbar, a `flex-col` stack, and a row whose classes cannot be read in the file are not judged. The typed lint of an app follows imported colocated class declarations.
|
|
30
30
|
|
|
31
31
|
Invalid:
|
|
32
32
|
|
package/package.json
CHANGED
|
@@ -31,42 +31,42 @@ pins:
|
|
|
31
31
|
source: packages/event-stream/package.json
|
|
32
32
|
why: 'the one server-sent-events client of every front end (fe-stack event-stream, owner:event-stream-package): the transport client layer (modules/api/sse/clients) creates one instance for the app with the bearer token source and the stream operations follow on it; it carries Last-Event-ID resume, the capped doubling backoff, the heartbeat timeout, the single 401 renewal and the useSWRSubscription adapter, so no app keeps a hand-written reader.'
|
|
33
33
|
'@starci/grammar':
|
|
34
|
-
version: 0.21.
|
|
34
|
+
version: 0.21.12
|
|
35
35
|
group: starci
|
|
36
36
|
install: registry
|
|
37
37
|
side: fe
|
|
38
38
|
source: packages/grammar/package.json
|
|
39
39
|
why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
|
|
40
40
|
'@starci/eslint-canon-be':
|
|
41
|
-
version: 3.11.
|
|
41
|
+
version: 3.11.19
|
|
42
42
|
group: starci
|
|
43
43
|
install: registry
|
|
44
44
|
side: be
|
|
45
45
|
source: packages/eslint-canon-be/package.json
|
|
46
46
|
why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
|
|
47
47
|
'@starci/eslint-canon-fe':
|
|
48
|
-
version: 9.9.
|
|
48
|
+
version: 9.9.12
|
|
49
49
|
group: starci
|
|
50
50
|
install: registry
|
|
51
51
|
side: fe
|
|
52
52
|
source: packages/eslint-canon-fe/package.json
|
|
53
53
|
why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
|
|
54
54
|
'@starci/eslint-grammar-core':
|
|
55
|
-
version: 0.21.
|
|
55
|
+
version: 0.21.12
|
|
56
56
|
group: starci
|
|
57
57
|
install: registry
|
|
58
58
|
side: fe
|
|
59
59
|
source: packages/eslint-grammar-core/package.json
|
|
60
60
|
why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
|
|
61
61
|
'@starci/eslint-grammar-offset-pop':
|
|
62
|
-
version: 0.21.
|
|
62
|
+
version: 0.21.12
|
|
63
63
|
group: starci
|
|
64
64
|
install: registry
|
|
65
65
|
side: fe
|
|
66
66
|
source: packages/eslint-grammar-offset-pop/package.json
|
|
67
67
|
why: 'the Offset Pop Grammar component API lint, versioned with @starci/grammar; its shared component contract comes from the StarCi family lint without copying rules.'
|
|
68
68
|
'@starci/stylelint-canon':
|
|
69
|
-
version: 2.5.
|
|
69
|
+
version: 2.5.1
|
|
70
70
|
group: starci
|
|
71
71
|
install: registry
|
|
72
72
|
side: fe
|
|
@@ -106,7 +106,7 @@ pins:
|
|
|
106
106
|
source: packages/ai-router/package.json
|
|
107
107
|
why: 'the AI pool router of a back end: a NestJS module that routes OpenAI-compatible chat, stream and embeddings calls across keys, models and providers, with @starci/ai-router/testing for its specs; @starci/jest-preset compiles it as an ESM-only dependency.'
|
|
108
108
|
'@starci/hfs':
|
|
109
|
-
version: 5.0.
|
|
109
|
+
version: 5.0.8
|
|
110
110
|
group: starci
|
|
111
111
|
install: registry
|
|
112
112
|
side: both
|
|
@@ -40,11 +40,11 @@ newCode:
|
|
|
40
40
|
metric: new_security_hotspots_reviewed
|
|
41
41
|
minReviewedPercent: 100
|
|
42
42
|
unreviewedMax: 0
|
|
43
|
-
# The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app lint`
|
|
43
|
+
# The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app check --gate lint --out`
|
|
44
44
|
# (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry). CI runs it per side with --side and --out,
|
|
45
45
|
# then merges rules by id and joins issues into ONE file, reports/lint.sonar.json, named by sonar.externalIssuesReportPaths; the gate holds the open-issue count of
|
|
46
46
|
# the whole project at zero. The file carries three engines:
|
|
47
|
-
# starci-hfs the repository findings of
|
|
47
|
+
# starci-hfs the repository findings of the gates a run selects (managed files, tree, pins, CI, contracts; the rule id is the finding code)
|
|
48
48
|
# eslint ESLint's json over the repository (the BE and FE canon plugins alike, per-file and project-graph rules)
|
|
49
49
|
# stylelint stylelint's json over the style glob (front ends)
|
|
50
50
|
# The engines share ONE placement rule (a finding on a file Sonar does not index is filed on the first source file); Sonar's own
|
|
@@ -3,8 +3,21 @@ import fs from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
/** Files above this size are not read by a tree check (a tracked binary or a generated dump is no source of these laws). */
|
|
5
5
|
const MAX_READ_BYTES = 1024 * 1024;
|
|
6
|
+
let sink = null;
|
|
7
|
+
/** Runs `run` with every `readText` / `readJson` it makes reported to `onRead` (before the read), and returns its value. */
|
|
8
|
+
export function recordReads(onRead, run) {
|
|
9
|
+
const before = sink;
|
|
10
|
+
sink = onRead;
|
|
11
|
+
try {
|
|
12
|
+
return run();
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
sink = before;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
6
18
|
/** The text of `rel` under `repoRoot`, or null when it is absent, unreadable, over MAX_READ_BYTES or binary. */
|
|
7
19
|
export function readText(repoRoot, rel) {
|
|
20
|
+
sink?.(repoRoot, rel);
|
|
8
21
|
try {
|
|
9
22
|
const target = path.join(repoRoot, rel);
|
|
10
23
|
if (fs.statSync(target).size > MAX_READ_BYTES)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// sonar-syntax-rules.mjs - the ESLint rules that keep a TypeScript app clear of the smells SonarCloud flagged in the example apps, judged on
|
|
2
2
|
// the syntax tree alone (no type information, no dependency). Both lint canons (@starci/eslint-canon-be and -fe) publish them from their
|
|
3
|
-
// bundled runtime copy under the names below, so a product inherits them and `starci app lint` refuses the finding before the scan sees it.
|
|
3
|
+
// bundled runtime copy under the names below, so a product inherits them and `starci app check --gate lint` refuses the finding before the scan sees it.
|
|
4
4
|
// Each message names the Sonar rule it stands for, and a rule judges the files the example scans judge: a unit or end-to-end spec is outside the
|
|
5
5
|
// scan (`sonar.exclusions`), so it is outside these rules. The rules that need the type checker (S1874, S6551, S7503) are borrowed from
|
|
6
6
|
// typescript-eslint by the canon factories; the one that needs a regex ambiguity analysis (S8786) runs in the runtime's own `sonar-rules` check.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// sonar-way.mjs - the Sonar way TypeScript profile (the default quality profile sonar.starci.org and SonarCloud apply) as ESLint rules:
|
|
2
|
-
// the one mapping both lint canons (@starci/eslint-canon-be and -fe) publish, so `starci app lint` in the op loop refuses what the scan would
|
|
2
|
+
// the one mapping both lint canons (@starci/eslint-canon-be and -fe) publish, so `starci app check --gate lint` in the op loop refuses what the scan would
|
|
3
3
|
// raise while the code is written. The base is eslint-plugin-sonarjs's recommended config, SonarSource's own port of Sonar way (each rule's
|
|
4
4
|
// docs url names its S-id); its rules the canons already publish in another form stay with that owner (SONAR_WAY_OWNED), and the Sonar way
|
|
5
5
|
// rules SonarSource builds on other ESLint rules are SONAR_WAY_EXTRA. Every rule is `error`; no rule is left to the server because its port
|