@starci/eslint-grammar-core 0.38.1 → 0.39.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/CHANGELOG.md +10 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/lib/why.js +1 -1
- package/dist/no-raw-scroll.js +3 -3
- package/dist/section-head-action.js +1 -1
- package/docs/message-surfaces.md +2 -2
- package/docs/no-card-lead-description.md +2 -2
- package/docs/no-nested-label.md +5 -5
- package/docs/no-raw-scroll.md +1 -1
- package/docs/section-head-action.md +1 -1
- package/package.json +5 -5
- package/runtime/knowledge/ui/presentation/grammar-laws.yaml +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.39.0 - 2026-11-13
|
|
4
|
+
|
|
5
|
+
- 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`.
|
|
6
|
+
- 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.
|
|
7
|
+
- Changed: cut with `@starci/hfs` 6.10.0; requires `@starci/hfs` `~6.10.0` and `@starci/eslint-canon-fe` `~9.18.0`.
|
|
8
|
+
|
|
9
|
+
## 0.38.2 - 2026-11-13
|
|
10
|
+
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
3
13
|
## 0.38.1 - 2026-11-12
|
|
4
14
|
|
|
5
15
|
- Changed: released with the Grammar family at 0.38.1 (three spacing values read their role's token); no rule of this package changed.
|
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
|
|
48
|
-
* the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those
|
|
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
|
|
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
|
|
136
|
-
* the config of `coreGrammarConfig` over the package view (`loadPackagesHfs` of the universal canon), narrowed to those
|
|
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
|
|
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: "
|
|
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",
|
package/dist/no-raw-scroll.js
CHANGED
|
@@ -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
|
-
*
|
|
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:
|
|
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.
|
|
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` ("
|
|
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);
|
package/docs/message-surfaces.md
CHANGED
|
@@ -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="
|
|
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="
|
|
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}>
|
|
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="
|
|
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).
|
package/docs/no-nested-label.md
CHANGED
|
@@ -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="
|
|
17
|
-
<SurfaceCard kind="select" label="
|
|
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="
|
|
25
|
-
<SurfaceCard kind="select" sublabel="
|
|
26
|
-
<SurfaceCard kind="select" sublabel="
|
|
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
|
|
package/docs/no-raw-scroll.md
CHANGED
|
@@ -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
|
-
|
|
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}>
|
|
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.
|
|
3
|
+
"version": "0.39.0",
|
|
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.
|
|
45
|
-
"@starci/hfs": "~6.
|
|
44
|
+
"@starci/eslint-canon-fe": "~9.18.0",
|
|
45
|
+
"@starci/hfs": "~6.10.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": "
|
|
72
|
-
"starciSource": "
|
|
71
|
+
"gitHead": "5ba3e3393ad44562f0245d829949e70a2313af81",
|
|
72
|
+
"starciSource": "cbdb8c5806ca9235acee1e2c2081517906d68c4f6410d2e338160dc6ca20b9fe"
|
|
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: "
|
|
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:
|
|
257
|
+
title: Grammar never shows scrollbars
|
|
258
258
|
governs: Scroll areas an app draws.
|
|
259
259
|
cases:
|
|
260
260
|
- id: case-1
|