@deslop/coding-standards 0.1.804 → 0.1.843

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/install.js CHANGED
@@ -24685,7 +24685,7 @@ const runWith = (command, config) => {
24685
24685
  };
24686
24686
  //#endregion
24687
24687
  //#region package.json
24688
- var version = "0.1.804";
24688
+ var version = "0.1.843";
24689
24689
  //#endregion
24690
24690
  //#region src/install.ts
24691
24691
  const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
package/dist/oxlint.d.ts CHANGED
@@ -4511,6 +4511,11 @@ export declare const oxlint: {
4511
4511
  disallowArithmeticOperators: true;
4512
4512
  }];
4513
4513
  'no-unused-expressions': "error";
4514
+ 'no-unused-vars': ["error", {
4515
+ argsIgnorePattern: string;
4516
+ ignoreRestSiblings: true;
4517
+ reportUsedIgnorePattern: true;
4518
+ }];
4514
4519
  'no-useless-assignment': "error";
4515
4520
  'no-useless-backreference': "error";
4516
4521
  'no-useless-call': "error";
package/dist/oxlint.js CHANGED
@@ -3043,6 +3043,11 @@ const oxlint = defineConfig({
3043
3043
  "no-unsafe-finally": "error",
3044
3044
  "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
3045
3045
  "no-unused-expressions": "error",
3046
+ "no-unused-vars": ["error", {
3047
+ argsIgnorePattern: "^_",
3048
+ ignoreRestSiblings: true,
3049
+ reportUsedIgnorePattern: true
3050
+ }],
3046
3051
  "no-useless-assignment": "error",
3047
3052
  "no-useless-backreference": "error",
3048
3053
  "no-useless-call": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deslop/coding-standards",
3
- "version": "0.1.804",
3
+ "version": "0.1.843",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MP281X/deslop",
@@ -33,6 +33,8 @@ Do not remove necessary names, status, comfortable hit targets or instructions m
33
33
 
34
34
  ## Build
35
35
 
36
+ These rules apply to product UI. A rendered explanation follows the host's rendering contract and the rules below.
37
+
36
38
  **Canonical components.** Reuse the existing renderer, states and interactions for the same role. Inspect its relevant source/API, not a full catalogue; add missing primitives through the repository registry command. Fix wrong shared patterns at their owner when delivering retained code, not before an exploratory preview. Without a sibling, use the supplied reference and component defaults within settled preferences.
37
39
 
38
40
  ```tsx
@@ -73,8 +75,7 @@ Do not remove necessary names, status, comfortable hit targets or instructions m
73
75
  | Accents/tall scripts clip | Tight line height or text-box clipping | Fix the owning type-scale/overflow choice; don't shrink the font to fit |
74
76
  | Missing metadata leaves separators | Empty optional slots still render | Omit orphaned separators/lines; reserve space only when the layout needs it |
75
77
 
76
- **Interaction and state.** Controls remain discoverable, never hover-only. Use the canonical selected-row/active-tab treatment; do not add a second badge or check column that echoes it. Keep pending/error feedback beside its owner and preserve recoverable input. No redundant refresh, copied state or polling shortcut around the existing reactive integration.
77
-
78
+ **Prevent before rejecting.** When the app already knows an action is not allowed, such as a missing permission, a referenced record or invalid input, disable or hide the control and show the reason beside it. Never let the user act and then show an error the app could have predicted.\n
78
79
  **Motion.** Explain change without delaying input or moving content just for decoration. Reuse existing tokens/components; no new library for a fade or universal curve, duration, bounce or press scale.
79
80
 
80
81
  | Interaction | Treatment |
@@ -108,10 +109,52 @@ Touch and mouse can coexist; do not infer capabilities from user-agent strings o
108
109
 
109
110
  **Inspect retained UI.** Open actual captures at the sizes needed for the task. Compare related edges, columns, baselines and equivalent controls across rows/screens—not just successful clicks. Use realistic long names/URLs, translated labels, Unicode, missing fields and relevant 0/1/many records at the actual container width. Respect schema/API limits; never add a validation limit to make layout pass. Mix cases across rows. Check selected/focus/error states and scrolling; a clean default row can hide misalignment. Inspect hierarchy, density, legibility and clipping. Exercise the relevant keyboard/touch, narrow/wide, zoom and focus-return journeys; run axe where applicable. A clean scan does not prove contrast or usability. Inspect meaningful video frames and sequence; a playable file is not proof of a good composition. Batch relevant inspection/repairs; recheck affected views rather than restart a whole audit after each micro-edit. Visible misalignment, inconsistent controls or redundant elements remain defects even when types/tests pass; fix them before claiming acceptance.
110
111
 
111
- **Show the design.** Use inspected screenshots for layout and short video for behavior. Compare at consistent sizes with states needed for the decision; no variant switcher just to see the options. A visual must add spatial or interactive information, not reproduce prose, a file list or a fake runtime screenshot. Link useful existing evidence rather than render another explanation page. Use the user's theme and verify the actual browser color preference. Preserve useful media and retire settled attempts; persistent previews are opt-in.
112
+ **Show the design.** Use inspected screenshots for layout and short video for behavior. Compare at consistent sizes with states needed for the decision; no variant switcher just to see the options. A visual must add spatial or interactive information, not reproduce prose, a file list or a fake runtime screenshot. Link useful existing evidence rather than render another explanation page. For diagrams, review pages and rendered answers, follow Visual explanations below. Use the user's theme and verify the actual browser color preference. Preserve useful media and retire settled attempts; persistent previews are opt-in.
112
113
 
113
114
  **Review surfaces.** Open on the outcome the user needs to judge, with technical detail available on demand. Group by changed behavior, not files or agent stages. A selected example, diagram or diff must reveal its scope; never make curated evidence look like complete coverage. Do not build a custom review dashboard when existing captures and the PR can answer the question. A design-skill edit is not a product-screen change.
114
115
 
116
+ ## Visual explanations
117
+
118
+ These rules cover diagrams, review pages and rendered agent answers. A visual earns its place only when it shows what text or a table cannot: space, flow, time, a visible comparison or a measurement.
119
+
120
+ **Pick the exhibit from the question.**
121
+
122
+ | The reader asks | Exhibit |
123
+ | ------------------------------------ | -------------------------------------------------------------- |
124
+ | What changed on screen? | Before and after pair with the same data, the old state left |
125
+ | Which transitions are allowed? | State machine with forbidden edges marked |
126
+ | What happens in order, and who acts? | Sequence in swimlanes, one lane per actor |
127
+ | Where did the time go? | Timeline with bars on one time axis |
128
+ | How much faster, bigger or cheaper? | Bars on a shared axis, values printed on the bars |
129
+ | Where exactly is the defect? | Annotated capture with numbered markers and short notes |
130
+ | Which requirement has which proof? | Coverage grid of requirements against proof, colored by state |
131
+ | Where does the change live? | Change map: a tree with sizes, added and removed parts colored |
132
+ | How do the parts relate? | Node and link map with few, labeled links |
133
+ | Which option is better? | Options side by side at the same size and with the same data |
134
+ | What will a video show? | Storyboard of chapter frames, the outcome frame marked |
135
+
136
+ When none fits, choose the form that matches the data's shape, not the first card layout that comes to mind. Draw a list as a list.
137
+
138
+ - **One message.** Each page answers one question. Its title states the conclusion, such as "The catalog loads 26 times faster", not the topic.
139
+ - **One dominant element.** Size, weight and position show importance. Mute the context and make secondary detail smaller.
140
+ - **Color means something.** Use the theme's status colors only for states and the chart colors only for series. Keep one accent, and never color for decoration.
141
+ - **Label directly.** Put names and values on the data instead of a distant legend. Show units, and use one scale per comparison.
142
+ - **Real content.** Use real names, numbers and captures. Show the scope, so a sample never looks like full coverage.
143
+
144
+ - **Grid and rhythm.** Align to one grid. Use a spacing scale of 4, 8, 12 and 16 pixels, two or three type sizes, and one corner radius.
145
+ - **Little text.** Labels and captions stay under twelve words. A visual holds no paragraphs.
146
+ - **Small multiples.** Compare several cases with repeated small exhibits on the same scale, rather than one crowded chart.
147
+ - **Both themes and widths.** Use the host's theme variables, check light and dark, and keep the page readable at phone width.
148
+ - **Inspect before showing.** Look at the rendered page for clipping, overlap, contrast and empty areas, and fix them first.
149
+
150
+ **Avoid** these:
151
+
152
+ - A table or bullet list redrawn as styled boxes.
153
+ - A card, badge or icon for every fact.
154
+ - Gradients, shadows and illustrations that carry no information.
155
+ - Crossing links, when an ordered list or lanes would show the same relation.
156
+ - A visual that repeats the text around it.
157
+
115
158
  ## Image assets
116
159
 
117
160
  Use image generation only for a needed illustrative asset, atmosphere, texture or icon exploration—not ordinary text, exact diagrams or fake working UI. Use the native tool exposed by the harness; no invented invocation or replacement API client when unavailable. Report missing capability honestly.
@@ -11,7 +11,7 @@ description: 'TypeScript and Effect code conventions paired with shared lint. Us
11
11
 
12
12
  ## Simplicity
13
13
 
14
- **Clarity.** Plain, explicit, idiomatic code, names and files; read top to bottom without commentary or cleverness.
14
+ **Clarity.** Plain, explicit, idiomatic code, names and files; read top to bottom without commentary or cleverness. Match the surrounding code's naming, idiom and comment density.
15
15
 
16
16
  **Experiments.** Write with these idioms; reserve the full refactor/cleanup pass for retained delivery. Keep disposable source isolated and shared rules intact.
17
17
 
@@ -54,7 +54,7 @@ Math.floor(Duration.toDays(DateTime.distance(oldest.timestamp, newest.timestamp)
54
54
  import {glob} from 'glob' // a dependency Effect's FileSystem replaces
55
55
  ```
56
56
 
57
- **Whole values.** Pass whole values or spread them. No parameter/callback/loop destructuring except labeled tuple parameters, useState and component ref; project fields only to exclude data the recipient must not receive.
57
+ **Whole values.** Pass whole values or spread them. No parameter/callback/loop destructuring except labeled tuple parameters, useState and component ref; project fields only to exclude data the recipient must not receive. Name the whole value by its role; a leading underscore marks only a parameter the body never reads, and no name gains an underscore or a number to dodge shadowing.
58
58
 
59
59
  ```ts
60
60
  // good
@@ -62,11 +62,13 @@ server => ({server: {...server, forwardConsole: true, warmup}})
62
62
  for (const schema of schemas) report(schema.name)
63
63
  Record.map(groups, entries => entries.length)
64
64
  upload({scope: input.scope, type: input.type}) // input also holds the bearer token
65
+ submission => onSubmit(submission.value)
65
66
  // bad
66
67
  ({host, port}) => ({server: {forwardConsole: true, host, port, warmup}})
67
68
  server: {forwardConsole: true, host: config.host, port: config.port, warmup}
68
69
  for (const {name} of schemas) report(name)
69
70
  Array.map(Record.toEntries(groups), ([key, entries]) => entries.length)
71
+ _input => onSubmit(_input.value) // or input2: an outer input is shadowed
70
72
  ```
71
73
 
72
74
  **Nearest sibling.** Extend the nearest implementation; match permissions, errors, refresh and tests. Reuse its helpers and change only affected state.
@@ -294,7 +296,7 @@ export const EntryKind = Schema.Literals(['income', 'expense']) // no importer
294
296
  // oxlint-disable-next-line typescript/consistent-type-assertions
295
297
  // oxlint-disable-next-line sort-keys -- keeps the printed order
296
298
  // bad
297
- files: ['packages/components/src/components/agent-browser.tsx', 'packages/components/src/components/form.tsx'],
299
+ files: ['packages/components/src/components/dev-tools.tsx', 'packages/components/src/components/form.tsx'],
298
300
  ```
299
301
 
300
302
  ## Effect
@@ -58,8 +58,9 @@ assert.strictEqual(Array.flatMap(attioProvider.groups, group => group.actions).l
58
58
 
59
59
  ## Run and reconcile
60
60
 
61
- - **Run.** Use root check/fix commands and documented test selectors; confirm intended collection/execution. Zero tests/setup-only/exit0 alone is not proof; no invented final suite.
61
+ - **Run.** Use the repository's check commands scoped to the affected packages, fix commands scoped to the files the change touches, and documented test selectors; confirm intended collection/execution. Zero tests/setup-only/exit0 alone is not proof; no invented final suite.
62
62
  - **Inventory.** Collect independent failures once instead of cancelling the suite at the first failure. Distinguish separate cases from repeated observations. A timeout receives one isolated rerun of that same test; after a genuine pass, stop investigating it. Do not call a bypassed selector or a skipped operation flaky.
63
63
  - **Evidence.** Preserve the first failure, exact command, execution count and exit status. Separate cause from hypothesis, product defect from setup failure, and a skipped criterion from a passing one. A source read or overall green command never substitutes for a missing behavior check.
64
64
  - **Stable inputs.** No writer changes a running check's source, dependencies, configuration or build inputs. A relevant edit invalidates its prior result; rerun affected criteria and reuse unaffected evidence. Independent research or browser journeys may continue without mutating those inputs.
65
- - **Final proof.** Reconcile every required behavior on the final code. Screenshots/video prove visible outcomes; public-seam execution proves nonvisual behavior; use fresh agents for changed instructions only when they can settle a consequential unresolved uncertainty, not routine wording edits. Keep the result and useful evidence, not disposable drivers, fixture installs, reports or preview services.
65
+ - **Final proof.** Reconcile every required behavior on the final code. Screenshots/video prove visible outcomes; public-seam execution proves nonvisual behavior; use fresh agents for changed instructions only when they can settle a consequential unresolved uncertainty, not routine wording edits. Keep the result and useful evidence, not disposable drivers, fixture installs, reports or unrequested preview services.
66
+ - **Visual proof.** A capture proves one claim and ends on its outcome, held long enough to read: the run, the file or the rejection. Seed data first, and keep loading states off camera unless loading is the claim. Show realistic journeys end to end, cropped to the element at a readable scale; speed up waits instead of cutting steps. A capture is stale once any component it shows changes.