@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.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-0053 "views" mode violations: `userFilters` / `quickFilters` on an
115
- * object's built-in named views or a `defineView` default `list` / named
116
- * `listViews`. Returns the list of findings (empty = clean). Caller decides how
117
- * to surface / whether to fail the build.
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-0053 "views" mode violations: `userFilters` / `quickFilters` on an
115
- * object's built-in named views or a `defineView` default `list` / named
116
- * `listViews`. Returns the list of findings (empty = clean). Caller decides how
117
- * to surface / whether to fail the build.
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
- for (const field of FORBIDDEN_FIELDS) {
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}.${field}`,
397
- message: `\`${field}\` is a page filters-mode control and is ignored on an object list view ("views" mode) \u2014 the ViewTabBar is the only nav control here.`,
398
- hint: `Move \`${field}\` to a page list (InterfaceListPage, "filters" mode), or remove it. See ADR-0053.`
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;