@starci/eslint-grammar-core 0.38.2 → 0.39.3

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.39.3 - 2026-11-14
4
+
5
+ - Changed: follows @starci/hfs 6.13.0 (peer line): version stamp only; requires `@starci/hfs` `~6.13.0` and `@starci/eslint-canon-fe` `~9.20.0`. No rule changes.
6
+
7
+ ## 0.39.2 - 2026-11-14
8
+
9
+ - Changed: version stamp only, cut with `@starci/hfs` 6.12.0; requires `@starci/hfs` `~6.12.0` and `@starci/eslint-canon-fe` `~9.19.0`. No rule changes.
10
+
11
+ ## 0.39.1 - 2026-11-14
12
+
13
+ - Changed: released with the Grammar family at 0.39.1 (FlowGraph steps: decision diamond, loop frame with exits, fallback road). No rule of this package changed.
14
+
15
+ ## 0.39.0 - 2026-11-13
16
+
17
+ - Changed (PROJECT-LINT-3): `coreGrammarPackagesConfig` knows no folder of a root package. It judges every `.tsx` file of a package and the slots the project declares `lint: "fe"` (`ext/manifest.json` `packages`, the package view's `packageLint`); the fixed `src/workbench/**` and `src/public/**` subpaths and the `src/workbench/contract/**` exception are gone. Upgrade, per existing app: a package whose plain `.ts` files were judged there declares the folder as a `lint: "fe"` slot. Spec `src/packages-config.spec.ts`.
18
+ - Changed: `no-raw-scroll` says "Grammar never shows scrollbars" in its description, message, doc and law title; spec fixtures and docs use neutral English copy. No rule id or behaviour changes.
19
+ - Changed: cut with `@starci/hfs` 6.10.0; requires `@starci/hfs` `~6.10.0` and `@starci/eslint-canon-fe` `~9.18.0`.
20
+
3
21
  ## 0.38.2 - 2026-11-13
4
22
 
5
23
  - Changed: version stamp only, cut with `@starci/hfs` 6.9.0 (the project extension folder, PROJECT-LINT-3): requires `@starci/hfs` `~6.9.0`; no rule changes.
package/dist/index.d.ts CHANGED
@@ -44,11 +44,11 @@ export declare const coreGrammarConfig: (input: {
44
44
  readonly family?: GrammarFamilyId;
45
45
  }) => Linter.Config[];
46
46
  /**
47
- * The Grammar family's rules for the front-end subpaths of an app's root workspace packages (`packages/<pkg>/src/workbench/**` and `src/public/**`):
48
- * the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those subpaths, so a module
47
+ * The Grammar family's rules for the front-end files of an app's root workspace packages (every `.tsx` file and the slots the project declares `lint: "fe"`, ext/manifest.json packages):
48
+ * the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those files, so a root
49
49
  * package draws with the Grammar's components alone under the very laws of the front end (FE-PACKAGES-2).
50
50
  * @param input - The package view of the app root and the family.
51
- * @returns A typed source block with every family rule at error over the package subpaths.
51
+ * @returns A typed source block with every family rule at error over the package files.
52
52
  */
53
53
  export declare const coreGrammarPackagesConfig: typeof coreGrammarConfig;
54
54
  export { crossFileInputs } from "./lib/cross-file-inputs.js";
package/dist/index.js CHANGED
@@ -132,12 +132,12 @@ export const coreGrammarConfig = ({ hfs, family = "core" } = {}) => {
132
132
  }];
133
133
  };
134
134
  /**
135
- * The Grammar family's rules for the front-end subpaths of an app's root workspace packages (`packages/<pkg>/src/workbench/**` and `src/public/**`):
136
- * the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those subpaths, so a module
135
+ * The Grammar family's rules for the front-end files of an app's root workspace packages (every `.tsx` file and the slots the project declares `lint: "fe"`, ext/manifest.json packages):
136
+ * the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those files, so a root
137
137
  * package draws with the Grammar's components alone under the very laws of the front end (FE-PACKAGES-2).
138
138
  * @param input - The package view of the app root and the family.
139
- * @returns A typed source block with every family rule at error over the package subpaths.
139
+ * @returns A typed source block with every family rule at error over the package files.
140
140
  */
141
- export const coreGrammarPackagesConfig = (input) => scopeToPackages(coreGrammarConfig(input));
141
+ export const coreGrammarPackagesConfig = (input) => scopeToPackages(coreGrammarConfig(input), input.hfs);
142
142
  // The result cache of `starci app check --gate lint` (contexts/project/check-cache.md) reads the disk inputs the family rules declare.
143
143
  export { crossFileInputs } from "./lib/cross-file-inputs.js";
package/dist/lib/why.js CHANGED
@@ -237,7 +237,7 @@ export const why = {
237
237
  "no-raw-scroll": {
238
238
  code: "FE_NO_RAW_SCROLL",
239
239
  en: "An element in `<file>` makes its own scroll area with an `overflow-auto`, `overflow-y-auto` or `overflow-scroll` class.",
240
- fix: "NIVO never shows scrollbars. Use the Grammar scroller (`VerticalScrollRegion`, `HorizontalScrollRegion`) or `PaneSection scroll`: they fade the edge where content continues, hide the bar and keep wheel and keyboard scrolling.",
240
+ fix: "Grammar never shows scrollbars. Use the Grammar scroller (`VerticalScrollRegion`, `HorizontalScrollRegion`) or `PaneSection scroll`: they fade the edge where content continues, hide the bar and keep wheel and keyboard scrolling.",
241
241
  },
242
242
  "table-cell-type": {
243
243
  code: "FE_TABLE_CELL_TYPE",
@@ -1,7 +1,7 @@
1
1
  import { isProductSource } from "@starci/eslint-canon-fe/lib/scope.mjs";
2
2
  import { defineFamilyRules, defineRule } from "./lib/rule-contract.js";
3
3
  /**
4
- * NIVO never shows scrollbars (owner, 2026-11-09, OVERFLOW-6). Every scroll area is drawn by Grammar, which hides the bar and
4
+ * Grammar never shows scrollbars (owner, 2026-11-09, OVERFLOW-6). Every scroll area is drawn by Grammar, which hides the bar and
5
5
  * fades the edge where content continues (HeroUI's ScrollShadow behaviour). An app element that makes its own scroll area with
6
6
  * an `overflow-y-auto` / `overflow-auto` class (or the `-x-`, `-scroll` forms) has no such edge and, in a browser that draws bars, shows one.
7
7
  *
@@ -17,10 +17,10 @@ const RAW_SCROLL = /(?<![\w-])overflow-(?:[xy]-)?(?:auto|scroll)(?![\w-])/;
17
17
  export const noRawScroll = defineRule({
18
18
  meta: {
19
19
  type: "problem",
20
- docs: { description: "OVERFLOW-6: NIVO never shows scrollbars; a scroll area is a Grammar scroller or `PaneSection scroll`, not an `overflow-y-auto` class." },
20
+ docs: { description: "OVERFLOW-6: Grammar never shows scrollbars; a scroll area is a Grammar scroller or `PaneSection scroll`, not an `overflow-y-auto` class." },
21
21
  schema: [],
22
22
  messages: {
23
- raw: "`{{token}}` makes a scroll area outside Grammar. NIVO never shows scrollbars: every scroll area fades its edge where content continues and hides the bar. Use the Grammar scroller (`VerticalScrollRegion`, `HorizontalScrollRegion`) or `PaneSection scroll`, which keep wheel and keyboard scrolling.",
23
+ raw: "`{{token}}` makes a scroll area outside Grammar. Grammar never shows scrollbars: every scroll area fades its edge where content continues and hides the bar. Use the Grammar scroller (`VerticalScrollRegion`, `HorizontalScrollRegion`) or `PaneSection scroll`, which keep wheel and keyboard scrolling.",
24
24
  },
25
25
  },
26
26
  create(context) {
@@ -4,7 +4,7 @@ import { defineFamilyRules, defineRule } from "./lib/rule-contract.js";
4
4
  /**
5
5
  * THE SECTION HEAD (owner, 2026-11-09, SECTION-HEAD-ACTION). A section's head is ONE row: the label (14, 500) and an optional count chip at the
6
6
  * start, and at the end at most ONE thing: a navigation `Link variant="head"` (the label then an arrow that slides on hover), an info `IconButton`,
7
- * or (0.37.25) a neutral small `Button` ("Gắn thêm provider"). The head never holds two commands.
7
+ * or (0.37.25) a neutral small `Button` ("Add provider"). The head never holds two commands.
8
8
  *
9
9
  * WHAT IT READS. A Grammar `Section` in product source whose `action` prop holds:
10
10
  * - a Grammar `Button` that is not exactly `intent="neutral" size="sm"` (message `button`: a primary/commit or any other size is refused);
@@ -31,7 +31,7 @@ A spread, a computed class and a tone held in a variable are not read; a thread
31
31
  **Valid**
32
32
 
33
33
  ```tsx
34
- <Pane area="room" content="chat" label="Phòng" footer={composer}>{head}{thread}</Pane>
34
+ <Pane area="room" content="chat" label="Room" footer={composer}>{head}{thread}</Pane>
35
35
  <PaneSection scroll={{ label: "Thread", role: "log", align: "end" }}>{thread}</PaneSection>
36
- <MessageCard title="Quy trình đang dừng" body={<SurfaceCard kind="list" layout="suggestions" ariaLabel="Gợi ý" empty={null} items={replies} />} />
36
+ <MessageCard title="Workflow paused" body={<SurfaceCard kind="list" layout="suggestions" ariaLabel="Suggestions" empty={null} items={replies} />} />
37
37
  ```
@@ -13,13 +13,13 @@ A Grammar `Text` with `tone="muted"` written immediately before a Grammar `Surfa
13
13
  **Invalid**
14
14
 
15
15
  ```tsx
16
- <Stack><Heading level={3}>Chung</Heading><Text tone="muted">Chọn cách agent làm việc.</Text><SurfaceCard kind="select" label="Chế độ" ... /></Stack>
16
+ <Stack><Heading level={3}>General</Heading><Text tone="muted">Choose how the agent works.</Text><SurfaceCard kind="select" label="Mode" ... /></Stack>
17
17
  ```
18
18
 
19
19
  **Valid**
20
20
 
21
21
  ```tsx
22
- <SurfaceCard kind="select" label="Chế độ" items={[{ id: "auto", title: "Tự làm", subtitle: "Agent trả lời ngay, bạn xem lại sau." }]} ... />
22
+ <SurfaceCard kind="select" label="Mode" items={[{ id: "auto", title: "Automatic", subtitle: "The agent answers at once; you review later." }]} ... />
23
23
  ```
24
24
 
25
25
  Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
@@ -13,17 +13,17 @@ A Grammar `Section` with `title`, or a `SurfaceCard` with `label`, whose JSX anc
13
13
  **Invalid**
14
14
 
15
15
  ```tsx
16
- <Section title="Agent hiểu gì về việc của bạn">
17
- <SurfaceCard kind="select" label="Được tự làm" ... />
16
+ <Section title="What the assistant knows">
17
+ <SurfaceCard kind="select" label="Allowed" ... />
18
18
  </Section>
19
19
  ```
20
20
 
21
21
  **Valid**
22
22
 
23
23
  ```tsx
24
- <Section title="Agent hiểu gì về việc của bạn">
25
- <SurfaceCard kind="select" sublabel="Được tự làm" ... />
26
- <SurfaceCard kind="select" sublabel="Phải hỏi bạn" ... />
24
+ <Section title="What the assistant knows">
25
+ <SurfaceCard kind="select" sublabel="Allowed" ... />
26
+ <SurfaceCard kind="select" sublabel="Ask first" ... />
27
27
  </Section>
28
28
  ```
29
29
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Law module: `no-raw-scroll.ts`. Finding code: `FE_NO_RAW_SCROLL`. Knowledge: `runtime/knowledge/ui/presentation/grammar-laws.yaml#NO-RAW-SCROLL`.
4
4
 
5
- NIVO never shows scrollbars (owner, 2026-11-09). Every scroll area is drawn by Grammar with HeroUI's ScrollShadow behaviour: a fading edge where content continues, the bar hidden, wheel, touch and keyboard scrolling kept. An app element that makes its own scroll area with an `overflow-y-auto` or `overflow-auto` class has no fading edge.
5
+ Grammar never shows scrollbars (owner, 2026-11-09). Every scroll area is drawn by Grammar with HeroUI's ScrollShadow behaviour: a fading edge where content continues, the bar hidden, wheel, touch and keyboard scrolling kept. An app element that makes its own scroll area with an `overflow-y-auto` or `overflow-auto` class has no fading edge.
6
6
 
7
7
  Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
8
8
 
@@ -24,7 +24,7 @@ Every rule below is an error in `coreGrammarConfig`; none can be switched off or
24
24
  ```tsx
25
25
  <Section title="Runs" count={3} action={<Link variant="head" href="/runs">All runs</Link>}>...</Section>
26
26
  <Section title="Runs" action={<IconButton label="About runs" glyph="more" />}>...</Section>
27
- <Section title="Provider" count={2} action={<Button intent="neutral" size="sm" onPress={add}>Gắn thêm provider</Button>}>...</Section>
27
+ <Section title="Provider" count={2} action={<Button intent="neutral" size="sm" onPress={add}>Add provider</Button>}>...</Section>
28
28
  ```
29
29
 
30
30
  Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-grammar-core",
3
- "version": "0.38.2",
3
+ "version": "0.39.3",
4
4
  "description": "ESLint rules for the core Grammar's component, token and composition contracts.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -41,8 +41,8 @@
41
41
  "node": ">=22"
42
42
  },
43
43
  "peerDependencies": {
44
- "@starci/eslint-canon-fe": "~9.17.0",
45
- "@starci/hfs": "~6.9.0",
44
+ "@starci/eslint-canon-fe": "~9.20.0",
45
+ "@starci/hfs": "~6.13.0",
46
46
  "eslint": ">=9",
47
47
  "typescript": ">=5.9"
48
48
  },
@@ -68,6 +68,6 @@
68
68
  "eslint-plugin-react-hooks": "^7.1.1",
69
69
  "typescript": "^6.0.3"
70
70
  },
71
- "gitHead": "85b3f8e7f6c3e4d1e7eb6f0ce3d9e98bf985daf7",
72
- "starciSource": "892760c1cfe2cf52602f7cf3ceaac2936b9019c557017e68a5ebaeaa42773713"
71
+ "gitHead": "246530f8c270cac4e607131c04f62b8e063e0ef5",
72
+ "starciSource": "6d4f01e5ea9711c9927404b2c73aa9ee8f9b7e4b1cf22586fdc8567c7ba048fe"
73
73
  }
@@ -205,7 +205,7 @@ rules:
205
205
  assert: |-
206
206
  The head is ONE row: the label (14, 500) and an optional count chip (12) at the start, at most ONE thing at the end, a navigation
207
207
  Link variant="head" (the label then an arrow that slides about 3px on hover), an info IconButton, or (0.37.25) a neutral small text Button
208
- (intent neutral, size sm, no icon: "Gắn thêm provider"). A primary or commit Button, another size or an icon Button is refused, and so are two commands. There is no description under the label: it is a caption (12, muted) below the card or list.
208
+ (intent neutral, size sm, no icon: "Add provider"). A primary or commit Button, another size or an icon Button is refused, and so are two commands. There is no description under the label: it is a caption (12, muted) below the card or list.
209
209
  - id: TAB-COUNT-CHIP
210
210
  title: A tab count is a 12px chip, grey unless it is work waiting for the owner
211
211
  governs: The count on a Grammar tab, page layers 1 and 2 and filter tabs.
@@ -254,7 +254,7 @@ rules:
254
254
  sits below (Section caption, muted sm). A card of list or key-value rows (SurfaceCard kind="list", "table", "select", ListBox, DisclosureList, Section kind="list",
255
255
  DescriptionList) is valid alone or not (0.37.8). A card groups two or more different parts (figures + list + actions), or carries zones (tabs, search, head actions).
256
256
  - id: NO-RAW-SCROLL
257
- title: NIVO never shows scrollbars
257
+ title: Grammar never shows scrollbars
258
258
  governs: Scroll areas an app draws.
259
259
  cases:
260
260
  - id: case-1