eslint-plugin-kerfjs 5.0.0-beta.104 → 5.0.0-beta.105
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `ui-composition`
|
|
2
2
|
|
|
3
|
-
Enforces composition facts published by the versioned UI catalog. `KUI-L201` reports a catalog component under a known, disallowed direct parent. `KUI-L202` reports a statically visible zone child—including an intrinsic or unknown JSX element—that is not one of the zone's cataloged `accepts` entries. `KUI-L203` reports a statically provable zone cardinality violation. A zone participates only when it declares an explicit `jsx.prop` binding, including `children`; the rule never guesses that a zone id is a JSX prop. Toolbar, Pane, TabBar,
|
|
3
|
+
Enforces composition facts published by the versioned UI catalog. `KUI-L201` reports a catalog component under a known, disallowed direct parent. `KUI-L202` reports a statically visible zone child—including an intrinsic or unknown JSX element—that is not one of the zone's cataloged `accepts` entries. `KUI-L203` reports a statically provable zone cardinality violation. A zone participates only when it declares an explicit `jsx.prop` binding, including `children`; the rule never guesses that a zone id is a JSX prop. Toolbar, Pane, TabBar, TabBarItem, feedback, search, and layout validation is therefore catalog-driven rather than duplicated in rule-local component cases.
|
|
4
4
|
|
|
5
5
|
The parent check is intentionally conservative about the child: it runs only for a child that resolves to a cataloged entry (or a declared wrapper's roots) whose parents are `listed`. Its direct JSX parent may be any element the rule can see: a cataloged component, a declared wrapper (which counts as each of its roots), an intrinsic element such as `<div>`, or an unresolved component, and any parent that is not a listed parent reports `KUI-L201`. Bound zone checks understand aliases, namespace imports, fragments, arrays, and conditional/logical branches, but expressions whose content cannot be resolved statically remain runtime and accessibility work. Accepted concepts that do not identify a catalog entry remain machine-readable guidance while the rule enforces their statically provable cardinality only. No autofix is offered because wrapping or moving UI changes structure and behavior.
|
|
6
6
|
Toolbar zones accept `KerfUiContent`, so the zone rule allows direct JSX
|
|
@@ -9,8 +9,10 @@ A component matches whether it is rendered through an imported export (`<WaButto
|
|
|
9
9
|
<wa-select>…</wa-select> // KUI-L301: prefer @kerfjs/ui:select
|
|
10
10
|
<wa-tab-group>…</wa-tab-group> // KUI-L301: prefer @kerfjs/ui:tab-bar
|
|
11
11
|
<wa-icon name="gear" /> // KUI-L301: prefer @kerfjs/ui:lucide-icon
|
|
12
|
+
<wa-button>Save</wa-button> // KUI-L301: prefer @kerfjs/ui:button
|
|
13
|
+
<wa-input label="Name" /> // KUI-L301: prefer @kerfjs/ui:text-field
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Web Awesome elements no Kerf component replaces (`<wa-card>`, `<wa-carousel>`, the encouraged `<wa-popup>`) and unknown custom elements are not reported. The source file of a component declared in a profile catalog is exempt: that wrapper owns the element it renders, and the preference applies to its callers.
|
|
15
17
|
|
|
16
18
|
`recommended-ui` treats the rule as a warning; `strict-ui` treats it as an error. Use a narrowly targeted `KUI-L301` profile exception when a documented application boundary cannot follow the preference. Component substitutions are not autofixed because their props and interaction contracts can differ.
|
package/docs/rules/ui-wiring.md
CHANGED
|
@@ -10,13 +10,13 @@ Declare application entry modules in the application UI profile to check root wi
|
|
|
10
10
|
|
|
11
11
|
Entry paths are relative to the workspace root. The rule follows relative imports, re-exports, and literal dynamic imports from each entry. An application-scoped obligation is checked at the entry if any reachable module renders its component; a recognized helper call or required registration import in any reachable module satisfies it. Reachable leaf modules need no duplicate wiring. A module outside every declared entry keeps the per-file check. A composition entry can set `wiring.scope` to `"module"` for wiring that must be installed beside its rendering code; omitted scope means `"application"`. Computed import paths and unresolved modules stay outside the static graph, so put them in a declared entry or check them separately. `KUI-L402` still checks the helper's call site.
|
|
12
12
|
|
|
13
|
-
For a page-lifetime root helper, declare the actual app entry in the workspace `.kerf-ui-profile.json`. For example, if `src/client/app.tsx` imports `init.ts`, `init.ts` calls `wireShellSearch(root)`, and that imported helper calls `
|
|
13
|
+
For a page-lifetime root helper, declare the actual app entry in the workspace `.kerf-ui-profile.json`. For example, if `src/client/app.tsx` imports `init.ts`, `init.ts` calls `wireShellSearch(root)`, and that imported helper calls `wireSearchFields(root)`, use:
|
|
14
14
|
|
|
15
15
|
```json
|
|
16
16
|
{ "schemaVersion": 1, "scope": "workspace", "wiring": { "entries": ["src/client/app.tsx"] } }
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The entry graph then covers a `
|
|
19
|
+
The entry graph then covers a `SearchField` in an imported view without duplicate wiring in that view. Include every independently mounted application entry. The path must resolve through relative imports from each entry to both the view and the helper; merely naming the helper in the profile does not count as invoking it.
|
|
20
20
|
|
|
21
21
|
Consumer composition catalogs can name an application helper's defining file in `wiring.sources`:
|
|
22
22
|
|
package/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import uiPublicBoundaries from './lib/rules/ui-public-boundaries.js';
|
|
|
15
15
|
import uiWiring from './lib/rules/ui-wiring.js';
|
|
16
16
|
|
|
17
17
|
const plugin = {
|
|
18
|
-
meta: { name: 'eslint-plugin-kerfjs', version: '5.0.0-beta.
|
|
18
|
+
meta: { name: 'eslint-plugin-kerfjs', version: '5.0.0-beta.105' },
|
|
19
19
|
rules: {
|
|
20
20
|
'no-inline-jsx-event-handlers': noInlineJsxEventHandlers,
|
|
21
21
|
'no-raw-with-dynamic-arg': noRawWithDynamicArg,
|
package/package.json
CHANGED