@objectstack/lint 12.4.0 → 12.6.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/dist/index.cjs +18 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -111,10 +111,11 @@ interface ListViewModeFinding {
|
|
|
111
111
|
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
112
112
|
type AnyRec$8 = Record<string, unknown>;
|
|
113
113
|
/**
|
|
114
|
-
* Flag ADR-
|
|
115
|
-
*
|
|
116
|
-
* `
|
|
117
|
-
*
|
|
114
|
+
* Flag ADR-0047 "views" mode violations on an object's built-in named views or a
|
|
115
|
+
* `defineView` default `list` / named `listViews`: `quickFilters`, or a `tabs`
|
|
116
|
+
* `userFilters`. A `dropdown` `userFilters` is allowed and not flagged. Returns
|
|
117
|
+
* the list of findings (empty = clean). Caller decides how to surface / whether
|
|
118
|
+
* to fail the build.
|
|
118
119
|
*
|
|
119
120
|
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
120
121
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -111,10 +111,11 @@ interface ListViewModeFinding {
|
|
|
111
111
|
declare const LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
112
112
|
type AnyRec$8 = Record<string, unknown>;
|
|
113
113
|
/**
|
|
114
|
-
* Flag ADR-
|
|
115
|
-
*
|
|
116
|
-
* `
|
|
117
|
-
*
|
|
114
|
+
* Flag ADR-0047 "views" mode violations on an object's built-in named views or a
|
|
115
|
+
* `defineView` default `list` / named `listViews`: `quickFilters`, or a `tabs`
|
|
116
|
+
* `userFilters`. A `dropdown` `userFilters` is allowed and not flagged. Returns
|
|
117
|
+
* the list of findings (empty = clean). Caller decides how to surface / whether
|
|
118
|
+
* to fail the build.
|
|
118
119
|
*
|
|
119
120
|
* Feed the PRE-parse stack (normalizeStackInput output) — see file header.
|
|
120
121
|
*/
|
package/dist/index.js
CHANGED
|
@@ -373,7 +373,6 @@ function validateStackExpressions(stack) {
|
|
|
373
373
|
|
|
374
374
|
// src/validate-list-view-mode.ts
|
|
375
375
|
var LIST_VIEW_FILTERS_IN_VIEWS_MODE = "list-view-filters-in-views-mode";
|
|
376
|
-
var FORBIDDEN_FIELDS = ["userFilters", "quickFilters"];
|
|
377
376
|
function asArray3(v) {
|
|
378
377
|
if (Array.isArray(v)) return v;
|
|
379
378
|
if (v && typeof v === "object") {
|
|
@@ -387,17 +386,30 @@ function asArray3(v) {
|
|
|
387
386
|
function scanView(view, where, path, out) {
|
|
388
387
|
if (!view || typeof view !== "object") return;
|
|
389
388
|
const rec = view;
|
|
390
|
-
|
|
391
|
-
if (rec[field] == null) continue;
|
|
389
|
+
if (rec.quickFilters != null) {
|
|
392
390
|
out.push({
|
|
393
391
|
severity: "error",
|
|
394
392
|
rule: LIST_VIEW_FILTERS_IN_VIEWS_MODE,
|
|
395
393
|
where,
|
|
396
|
-
path: `${path}
|
|
397
|
-
message:
|
|
398
|
-
hint:
|
|
394
|
+
path: `${path}.quickFilters`,
|
|
395
|
+
message: '`quickFilters` is a page filters-mode control and is ignored on an object list view ("views" mode) \u2014 the ViewTabBar owns nav here.',
|
|
396
|
+
hint: 'Move `quickFilters` to a page list (InterfaceListPage, "filters" mode), or remove it. See ADR-0047.'
|
|
399
397
|
});
|
|
400
398
|
}
|
|
399
|
+
const uf = rec.userFilters;
|
|
400
|
+
if (uf && typeof uf === "object") {
|
|
401
|
+
const ufRec = uf;
|
|
402
|
+
if (ufRec.element === "tabs" || ufRec.tabs != null) {
|
|
403
|
+
out.push({
|
|
404
|
+
severity: "error",
|
|
405
|
+
rule: LIST_VIEW_FILTERS_IN_VIEWS_MODE,
|
|
406
|
+
where,
|
|
407
|
+
path: `${path}.userFilters`,
|
|
408
|
+
message: '`userFilters` with `element: "tabs"` is page-only and is ignored on an object list view ("views" mode) \u2014 it would collide with the ViewTabBar.',
|
|
409
|
+
hint: 'Use `listViews` for named presets on an object (each becomes a segmented tab), switch to `element: "dropdown"` for value chips, or move the `tabs` filter to a page list (InterfaceListPage, "filters" mode). See ADR-0047.'
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
401
413
|
}
|
|
402
414
|
function scanListViews(listViews, wherePrefix, pathPrefix, out) {
|
|
403
415
|
if (!listViews || typeof listViews !== "object") return;
|