@actioneer/ads-lint 1.0.73 → 1.0.74
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 -1
- package/package.json +1 -1
- package/src/rules/recipes.mjs +64 -1
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ error (`versionCheck: false` in the config turns this off for a deliberate pin).
|
|
|
37
37
|
| Motion: `unbounded-transition`, `sluggish-easing`, `zero-scale-entrance`, `undersized-zoom-entrance`, `legacy-motion-token`, `raw-spring-config`, `layout-property-transition`, `layout-keyframe-disclosure` | error | P3 motion |
|
|
38
38
|
| Tables: `table-column-icon` (any `icon=` but `{null}`/`{undefined}`, or a glyph child), `table-cell-stacked` (`<br>`, a `flex-col`/`grid`/`space-y-*` stack of two, two children one of them block-level, an `<Avatar>`), `table-pagination` ("Page N of", "Rows per page", Previous + Next, "Next page" after a `Table`), plus the actions-column and record-name rules | error | tables |
|
|
39
39
|
| Collections: `collection-toolbar-missing` (a search/filter row or a header Search button with no `CollectionToolbar`), `search-full-width` (a full-width field typed search, led by the Search glyph, or labelled "Search…"), `page-content-top-padding` (class or `style` top spacing on the content or its first wrapper; a toolbar with no gap under an `mb-0` header) | error | P11, collection screens |
|
|
40
|
-
| Recipes: `call-panel-hand-rolled` (a Drawer with a Transcript or AudioWaveform — use `CallPanel`), `filter-menu-hand-rolled` (a Popover of Checkboxes — use the column filter or `Filters`), `filter-chip-clear-button` (a Chip with its own clear button — use `Chip onClose`), `script-opening-line-hand-rolled` (use `ScriptOpeningLine`), `script-character-limit` ("893 / 2,000,000 chars"), `script-ai-review-hand-rolled` (a hand-drawn `<del>`/`<ins>` review — use `ScriptEditor mode="review"` + `ScriptReviewBar`), `script-ask-hand-rolled` (use `ScriptAskBar`) | error | screen recipes |
|
|
40
|
+
| Recipes: `call-panel-hand-rolled` (a Drawer with a Transcript or AudioWaveform — use `CallPanel`), `filter-menu-hand-rolled` (a Popover of Checkboxes — use the column filter or `Filters`), `filter-chip-clear-button` (a Chip with its own clear button — use `Chip onClose`), `script-opening-line-hand-rolled` (use `ScriptOpeningLine`), `script-character-limit` ("893 / 2,000,000 chars"), `script-ai-review-hand-rolled` (a hand-drawn `<del>`/`<ins>` review — use `ScriptEditor mode="review"` + `ScriptReviewBar`), `script-ask-hand-rolled` (use `ScriptAskBar`), and from 1.0.72 `script-card-hand-rolled` (an "Edit script" button or a hand-drawn "SCRIPT" card — use `ScriptCard` with `onEdit`), `script-rewrites-hand-rolled` ("N of 3 AI rewrites left" written out — pass `remaining`/`limit` to `ScriptAskBar`), `script-status-hand-rolled` ("Writing the script" / "Updating the script" with a hand-made spinner — use `ScriptWriting` or `ScriptAIStatus`) | error | screen recipes |
|
|
41
|
+
| `setting-pencil-card` — a pencil `Button` labelled "Edit …" in a setup form (a file with `Field`/`FieldTrigger` or "Campaign setup"): a setting is a `Field` with its control edited in place | warn | campaign setup rail |
|
|
41
42
|
| `ads-lint-stale` — this linter is older than the installed `@actioneer/ads` | error | release lockstep |
|
|
42
43
|
| `collection-toolbar-icon-action` — an icon-only `Button` / `TooltipIconButton` in `CollectionToolbar actions` that is not `SearchDisclosure`, `Filters` or `TableColumnsMenu` (a setting such as Caller numbers is a labelled header button) | error | collection screens, workspace setting modals |
|
|
43
44
|
| `modal-footer-done` — a `ModalFooter` whose only action is a `Button` (or `ModalClose`) labelled Done, Close, OK or Got it | error | workspace setting modals |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actioneer/ads-lint",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"description": "Design linter for the Actioneer Design System (ADS 1.0). Ships in lockstep with @actioneer/ads: install the same version. Flags deviations from ADS principles on changed files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/rules/recipes.mjs
CHANGED
|
@@ -22,6 +22,18 @@
|
|
|
22
22
|
// <del>/<ins>. Use ScriptEditor mode="review" with ScriptReviewBar.
|
|
23
23
|
// - script-ask-hand-rolled: an "Ask for a change" field drawn by hand. Use
|
|
24
24
|
// ScriptAskBar.
|
|
25
|
+
// - script-card-hand-rolled (1.0.71): the saved script with an "Edit script"
|
|
26
|
+
// button, or a hand-drawn "SCRIPT" eyebrow card. Use ScriptCard — a click on
|
|
27
|
+
// the script opens the editor (`onEdit`), so there is no Edit script button.
|
|
28
|
+
// - script-rewrites-hand-rolled (1.0.71): "N of 3 AI rewrites left" written by
|
|
29
|
+
// hand. Pass `remaining` and `limit` to ScriptAskBar: its pill shows them.
|
|
30
|
+
// - script-status-hand-rolled (1.0.71): "Writing the script" / "Updating the
|
|
31
|
+
// script" drawn with a spinner by hand. Use ScriptWriting (a new script) or
|
|
32
|
+
// ScriptAIStatus (a change being written).
|
|
33
|
+
// - setting-pencil-card (1.0.71): a setup setting drawn as a card with a
|
|
34
|
+
// pencil that opens an editor. A setting is a Field — its label, the
|
|
35
|
+
// explanation behind the info icon, and a 32px control (FieldTrigger,
|
|
36
|
+
// Select, Textarea) edited in place.
|
|
25
37
|
|
|
26
38
|
import { matchesAny } from "../config.mjs";
|
|
27
39
|
import { elementEnd } from "../jsx.mjs";
|
|
@@ -61,7 +73,7 @@ export const RECIPE_RULES = [
|
|
|
61
73
|
name: "script-ai-review-hand-rolled",
|
|
62
74
|
severity: "error",
|
|
63
75
|
guidance:
|
|
64
|
-
"Review the AI's changes to a script in the ADS ScriptEditor: mode=\"review\" with `changes` (ScriptChange[]), `undone` and onToggleChange shows removals struck through on red and additions on green with Undo on each, and ScriptReviewBar carries
|
|
76
|
+
"Review the AI's changes to a script in the ADS ScriptEditor: mode=\"review\" with `changes` (ScriptChange[]), `undone` and onToggleChange shows removals struck through on red and additions on green with Undo on each, and ScriptReviewBar carries Edit and Confirm script (applyScriptChanges builds the result). Never draw the <del>/<ins> review by hand.",
|
|
65
77
|
},
|
|
66
78
|
{
|
|
67
79
|
name: "script-ask-hand-rolled",
|
|
@@ -69,6 +81,30 @@ export const RECIPE_RULES = [
|
|
|
69
81
|
guidance:
|
|
70
82
|
"Asking the AI to change a script is the ADS ScriptAskBar (`value`, `onChange`, `onSubmit`, `busy`) under the script in edit mode and on the saved script; while the AI works, ScriptAIStatus takes its place. Never a hand-drawn input with a send button.",
|
|
71
83
|
},
|
|
84
|
+
{
|
|
85
|
+
name: "script-card-hand-rolled",
|
|
86
|
+
severity: "error",
|
|
87
|
+
guidance:
|
|
88
|
+
"The saved script is the ADS ScriptCard (`parts` or children, `meta`, `onEdit`): the \"SCRIPT\" eyebrow, the word count and the parts on one flat card, and a click on the script opens the editor — with ScriptOpeningLine `onEdit` above it. No \"Edit script\" button, and never a hand-drawn script card.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "script-rewrites-hand-rolled",
|
|
92
|
+
severity: "error",
|
|
93
|
+
guidance:
|
|
94
|
+
"The AI rewrites left are shown by ScriptAskBar: pass `remaining` and `limit` and the bar shows the \"N left\" pill before the arrow; at 0 it takes no instruction (\"No AI rewrites left\"). Never write \"N of 3 AI rewrites left\" beside the script yourself.",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "script-status-hand-rolled",
|
|
98
|
+
severity: "error",
|
|
99
|
+
guidance:
|
|
100
|
+
"While the AI writes a new script, show ScriptWriting (`title`, `audience`, `status`; `onStop` only when the work can be stopped); while it writes a change, ScriptAIStatus (`title`, `meta`, `onStop`) takes the ask bar's place. Never a hand-made spinner with \"Writing the script\" or \"Updating the script\".",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "setting-pencil-card",
|
|
104
|
+
severity: "warn",
|
|
105
|
+
guidance:
|
|
106
|
+
"A setup setting is an ADS Field — its label, the explanation behind the info icon (`info`) and a 32px control: FieldTrigger for a picker, Select, or a Textarea edited in place with Save and Discard only after a real change. Never a card with a pencil button that opens an editor.",
|
|
107
|
+
},
|
|
72
108
|
{
|
|
73
109
|
name: "alert-hand-rolled",
|
|
74
110
|
severity: "error",
|
|
@@ -169,6 +205,33 @@ export function lintRecipes(relPath, source, cfg) {
|
|
|
169
205
|
if (m) push("script-ask-hand-rolled", m.index, m[0]);
|
|
170
206
|
}
|
|
171
207
|
|
|
208
|
+
// script-card-hand-rolled: an "Edit script" button, or a "SCRIPT" eyebrow without ScriptCard.
|
|
209
|
+
for (const m of source.matchAll(/<(?:Button|button)\b(?:=>|[^<>])*>\s*(?:<[^<>]*>\s*)*Edit script\s*</g)) {
|
|
210
|
+
push("script-card-hand-rolled", m.index, "Edit script");
|
|
211
|
+
}
|
|
212
|
+
if (!/<ScriptCard(?![\w.])/.test(source)) {
|
|
213
|
+
const m = />\s*SCRIPT\s*</.exec(source);
|
|
214
|
+
if (m) push("script-card-hand-rolled", m.index, m[0]);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// script-rewrites-hand-rolled: "N of 3 AI rewrites left" written out by hand.
|
|
218
|
+
for (const m of source.matchAll(/>[^<>{};"]*(?:\{[^{}]*\}[^<>{};"]*)*\bAI rewrites? (?:left|remaining)\b/g)) {
|
|
219
|
+
push("script-rewrites-hand-rolled", m.index, m[0].slice(1));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// script-status-hand-rolled: a writing status drawn without ScriptWriting / ScriptAIStatus.
|
|
223
|
+
if (!/<Script(?:Writing|AIStatus)(?![\w.])/.test(source)) {
|
|
224
|
+
const m = />\s*(?:Writing (?:the|your) script|Updating the script|Rewriting the script)\b/.exec(source);
|
|
225
|
+
if (m) push("script-status-hand-rolled", m.index, m[0].slice(1).trim());
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// setting-pencil-card: a pencil button that edits a setting, in a setup form.
|
|
229
|
+
if (/<(?:Field|FieldTrigger)(?![\w.])/.test(source) || /Campaign setup/.test(source)) {
|
|
230
|
+
for (const m of source.matchAll(/<(?:Button|IconButton|button)\b(?:=>|[^<>])*?aria-label=["'{`]+Edit\b(?:=>|[^<>])*>\s*<(?:Pencil|PencilSimple|PencilLine|PencilSimpleLine)\b/g)) {
|
|
231
|
+
push("setting-pencil-card", m.index, m[0]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
172
235
|
// alert-hand-rolled: a status-tinted container holding a status glyph.
|
|
173
236
|
for (const m of source.matchAll(/<div\b[^>]*className=(?:"[^"]*|\{`[^`]*|\{cn\([^)]*)\bbg-(?:warning|danger|info|success)(?:-50|-100|\/\d+)\b/g)) {
|
|
174
237
|
// An icon disc (rounded-full) is an illustration, not a banner.
|