eslint-plugin-kerfjs 5.0.0-beta.116 → 5.0.0-beta.117
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/README.md +2 -0
- package/index.js +1 -1
- package/lib/ui-contract.js +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,6 +79,8 @@ settings: {
|
|
|
79
79
|
|
|
80
80
|
For deterministic generated configs, the same settings accept parsed `catalog`, `selectionCatalog`, and `profile` objects. File-based precedence is package defaults, then workspace profile, then root-to-leaf directory profiles. The rules load `application-ui-profile-sync.cjs` from the installed `@kerfjs/ui` package by default because ESLint rule creation is synchronous; `profileContractPath` is only needed when artifacts are vendored, and then its directory must also hold `application-ui-diagnostic-ids-v1.json` and `component-class-owners.cjs` (the class-to-component rule `KUI-L103` shares with `@kerfjs/ui`'s generated component pages) from the same `@kerfjs/ui` release. Every raw layer is schema- and catalog-reference-validated before merge, so a child cannot hide malformed or stale parent policy. Exceptions use exact `KUI-L*` diagnostic ids and repository-relative file or directory targets.
|
|
81
81
|
|
|
82
|
+
When linting a nested workspace package, set `workspaceRoot` to the repository root. Installed `@kerfjs/ui` assets still resolve from ESLint's package `cwd`, while profile discovery and exception targets use the workspace root.
|
|
83
|
+
|
|
82
84
|
`ui-css-values` consumes each catalog entry's property-specific grammar and
|
|
83
85
|
emits `KUI-L013`–`KUI-L016` with a preferred shorthand or helper. It covers JSX,
|
|
84
86
|
direct component calls, nested catalog paths, and explicitly configured
|
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.117' },
|
|
19
19
|
rules: {
|
|
20
20
|
'no-inline-jsx-event-handlers': noInlineJsxEventHandlers,
|
|
21
21
|
'no-raw-with-dynamic-arg': noRawWithDynamicArg,
|
package/lib/ui-contract.js
CHANGED
|
@@ -145,7 +145,8 @@ function loadClassOwnership(profileContractPath) {
|
|
|
145
145
|
|
|
146
146
|
export function loadUiContract(context) {
|
|
147
147
|
const settings = context.settings?.kerfjs?.ui ?? {};
|
|
148
|
-
const
|
|
148
|
+
const packageCwd = context.cwd ?? process.cwd();
|
|
149
|
+
const cwd = resolve(settings.workspaceRoot ?? packageCwd);
|
|
149
150
|
const filename = context.filename ?? context.getFilename();
|
|
150
151
|
const key = JSON.stringify([cwd, filename, settings]);
|
|
151
152
|
if (cache.has(key)) return cache.get(key);
|
|
@@ -153,13 +154,14 @@ export function loadUiContract(context) {
|
|
|
153
154
|
const catalog =
|
|
154
155
|
settings.catalog ??
|
|
155
156
|
readJson(
|
|
156
|
-
settings.catalogPath ??
|
|
157
|
+
settings.catalogPath ??
|
|
158
|
+
packageAsset(packageCwd, 'component-composition.json'),
|
|
157
159
|
);
|
|
158
160
|
const selection =
|
|
159
161
|
settings.selectionCatalog ??
|
|
160
162
|
readJson(
|
|
161
163
|
settings.selectionCatalogPath ??
|
|
162
|
-
packageAsset(
|
|
164
|
+
packageAsset(packageCwd, 'component-catalog.json'),
|
|
163
165
|
);
|
|
164
166
|
const profiles = settings.profilePath
|
|
165
167
|
? [
|
|
@@ -168,10 +170,10 @@ export function loadUiContract(context) {
|
|
|
168
170
|
profile: readJson(settings.profilePath),
|
|
169
171
|
},
|
|
170
172
|
]
|
|
171
|
-
: discoveredProfiles(
|
|
173
|
+
: discoveredProfiles(packageCwd, filename, settings);
|
|
172
174
|
const profileContractPath =
|
|
173
175
|
settings.profileContractPath ??
|
|
174
|
-
packageAsset(
|
|
176
|
+
packageAsset(packageCwd, 'application-ui-profile-sync.cjs');
|
|
175
177
|
if (!profileContractPath)
|
|
176
178
|
throw new Error(
|
|
177
179
|
'Cannot resolve @kerfjs/ui/ai/application-ui-profile-sync.cjs; install @kerfjs/ui or set kerfjs.ui.profileContractPath.',
|
package/package.json
CHANGED