@dloizides/frontend-devtools 1.6.0 → 1.8.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/CHANGELOG.md CHANGED
@@ -1,106 +1,133 @@
1
- # Changelog
2
-
3
- All notable changes to `@dloizides/frontend-devtools` are documented here.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.5.0] - 2026-10-07
9
-
10
- KEFI-ACT-1 "Same attendee actions everywhere" (generalized: one row-action source per entity, every portal).
11
-
12
- ### Added
13
-
14
- - `single-row-action-source`: reports `<RowActionGroup actions>` from `@dloizides/ui-buttons` built in the same file
15
- (inline array, array-bound identifier, `useMemo` returning an array, local builder function, `RowActionSpec[]`
16
- annotated local). Imported builders/sets and props pass. No options, no autofix.
17
- - `rowActionsConfig` and `recommendedConfig` flat-config blocks (`recommendedConfig` = comments + row actions, all `error`).
18
-
19
- ## [1.4.0] - 2026-10-07
20
-
21
- COMMENTS-1 "No code comments; only short doc comments on public members", decision D-CMT-4 "One-line summary, no call chains".
22
-
23
- ### Changed
24
-
25
- - `doc-comment-max-lines`: the description (lines other than `@param` / `@returns`) is capped at ONE line
26
- (`summaryMaxLines`, default 1), every doc line at 120 chars (`lineMaxChars`), and a line containing an arrow
27
- (U+2192 or `->`) or starting `Flow:` is reported (`callChain`). Matches `.claude/hooks/review-violations.js` docBlock().
28
- The 3-line total cap is unchanged. One report per block; banned tags take precedence.
29
-
30
- ## [1.3.0] - 2026-10-06
31
-
32
- COMMENTS-1 "No code comments; only short doc comments on public members" (decisions D-CMT-1, D-CMT-3).
33
-
34
- ### Added
35
-
36
- - `no-comments`: reports every comment that is not a `/**` doc block and not a tool directive
37
- (`eslint-*`, `@ts-*`, `prettier-ignore`, `istanbul`/`c8`, `/// <reference>`, `#__PURE__`,
38
- `webpackChunkName`, shebang). `allow: string[]` adds directive regexes. Suggestion only, no autofix.
39
- - `doc-comment-public-only`: a doc block must sit on an exported declaration (incl. `export { x }`,
40
- `export default x`, `module.exports`, ambient `declare module`) or a public member of one;
41
- `private` / `protected` / `#` members and local declarations are reported.
42
- - `doc-comment-max-lines`: doc body capped at `max` (default 3) content lines; block tags other than
43
- `allowedTags` (default `@param`, `@returns`) are reported. JSDoc type-annotation blocks
44
- (`@type`, `@typedef`, ...) are exempt from both doc rules.
45
- - `commentsConfig` flat-config block (the three rules at `error`) and `COMMENT_RULE_NAMES`, exported
46
- from `/eslint`. Not adopted by any app yet: each repo opts in as step 1 of its COMMENTS-CLEAN sweep.
47
-
48
- ## [1.1.0] - 2026-07-13
49
-
50
- Both changes come out of the ES-04 (agora-web) build, which surfaced two ways the
51
- rule pack misbehaved against a freshly scaffolded app.
52
-
53
- ### Fixed
54
-
55
- - **`no-null-check`: the autofixer no longer corrupts files.** It rewrote
56
- `x === undefined` → `!isValueDefined(x)` *without importing `isValueDefined`*,
57
- so `eslint --fix` emitted source referencing an undeclared global. Running
58
- `lint:fix` on agora-web rewrote ~20 files and produced 67 `no-unsafe-call` /
59
- `strict-boolean-expressions` errors. A fixer that produces broken code is worse
60
- than no fixer — `lint:fix` is the first thing anyone runs.
61
-
62
- The fixer now inserts `import { isValueDefined } from '@dloizides/utils';` (the
63
- path is configurable via the pre-existing but previously **unused**
64
- `utilImportPath` option) when the file has no binding for the guard, and skips
65
- the autofix entirely in the module that defines or re-exports it. Proven with
66
- `Linter.verifyAndFix` multipass tests — the actual `--fix` code path.
67
-
68
- ⚠️ The package's own test suite had *codified* the bug: it asserted the
69
- import-less output was correct. Those expectations were wrong and are updated.
70
-
71
- ### Changed
72
-
73
- - **`smart-max-lines`: `functionWarn` is now opt-in (default: off).** ESLint has
74
- no per-report severity, so a `functionWarn` report is emitted at the severity
75
- the *rule* is configured with. Every app configured the rule as `'error'` and
76
- passed `functionWarn: 30` — which made the real, enforced limit **30 lines**
77
- while the docs promised **50**. The rule lied about its own threshold.
78
-
79
- Out of the box the only enforced thresholds are now `componentMax` (200) and
80
- `functionMax` (50) — exactly what the documentation has always promised.
81
- `functionWarn` remains available as an explicit *stricter second threshold*,
82
- and its schema/message now say plainly that it reports at the rule's severity
83
- rather than as a warning.
84
-
85
- Migration: drop `functionWarn: 30` from your ESLint config. This only relaxes
86
- linting (30 → 50), so it cannot introduce new failures.
87
-
88
- ## [1.0.0] - 2026-06-14
89
-
90
- ### Added
91
-
92
- - Initial extraction of the shared RN-web dev tooling duplicated across
93
- erevna-web, katalogos-web, and kefi-web.
94
- - **ESLint custom rule pack** (17 rules) exported as `plugin` / `rules` /
95
- `legacyPlugins`, also available under the `@dloizides/frontend-devtools/eslint`
96
- subpath. Rule names preserved byte-for-byte so existing config keys and
97
- `eslint-disable-next-line <rule>` comments keep working:
98
- `enforce-function-style`, `enforce-module-structure`, `enforce-route-preload`,
99
- `enforce-test-colocation`, `enum-file-isolation`, `i18n-interpolation`,
100
- `i18n-param-names`, `no-barrel-companion-file`, `no-duplicate-nav-prefix`,
101
- `no-duplicate-shared-patterns`, `no-generated-models-barrel-value-import`,
102
- `no-null-check`, `no-optional-undefined`, `no-product-imports-in-shared`,
103
- `prefer-const-enum`, `require-stable-hook-args`, `smart-max-lines`.
104
- - **`initI18n(options)`** — parameterized i18next + react-i18next init factory.
105
- Carries the `import/no-named-as-default-member` disable so apps stop repeating
106
- it. The app owns its `locales/*.json` strings and the active language.
1
+ # Changelog
2
+
3
+ All notable changes to `@dloizides/frontend-devtools` are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.8.0] - 2026-10-19
9
+
10
+ PATTERN-1.4 "TypeScript pattern rules as ESLint rules", row PAT-API-1 "web apps call the backend through the shared client".
11
+
12
+ ### Added
13
+
14
+ - `no-raw-backend-fetch`: reports `fetch(` / `window.fetch(` / `globalThis.fetch(` / `self.fetch(` and value imports of `axios`
15
+ (`import`, `require`, `import()`) in `src/**`. Exempt: `src/server/`, `src/http/`, `src/lib/http/`, `packages/*-client/`,
16
+ `/generated/`, service worker files, `app/+html.*`, tests, `data:`/`blob:` URLs, `import type` from axios. Option `{ allow: string[] }`.
17
+ - `apiConfig` flat-config preset (`API_RULE_NAMES`) at `error`; included in `recommendedConfig`.
18
+
19
+ ## [1.7.0] - 2026-10-19
20
+
21
+ NAV-1 "Every game menu works with arrow keys and controller", phase 3.
22
+
23
+ ### Added
24
+
25
+ - `game-menu-focusable`: reports a `click` / `pointerdown` / `pointerup` listener or `onclick =` on an element created as
26
+ `div` / `span` / `li` / `img` whose variable never gets `tabIndex` / `role` (property or `setAttribute`), and every
27
+ `stopPropagation()` inside a `keydown` / `onkeydown` handler (inline, named function or const). No options, no autofix.
28
+ - `gameConfig` flat-config preset (`GAME_RULE_NAMES`): enables `game-menu-focusable` at `error`. Not part of
29
+ `recommendedConfig`; game repos opt in.
30
+
31
+ ### Changed
32
+
33
+ - `testdoc-results.v1.schema.json` copy synced to Dloizides.Testing 7fbf809 (adds the optional `features` array).
34
+
35
+ ## [1.5.0] - 2026-10-07
36
+
37
+ KEFI-ACT-1 "Same attendee actions everywhere" (generalized: one row-action source per entity, every portal).
38
+
39
+ ### Added
40
+
41
+ - `single-row-action-source`: reports `<RowActionGroup actions>` from `@dloizides/ui-buttons` built in the same file
42
+ (inline array, array-bound identifier, `useMemo` returning an array, local builder function, `RowActionSpec[]`
43
+ annotated local). Imported builders/sets and props pass. No options, no autofix.
44
+ - `rowActionsConfig` and `recommendedConfig` flat-config blocks (`recommendedConfig` = comments + row actions, all `error`).
45
+
46
+ ## [1.4.0] - 2026-10-07
47
+
48
+ COMMENTS-1 "No code comments; only short doc comments on public members", decision D-CMT-4 "One-line summary, no call chains".
49
+
50
+ ### Changed
51
+
52
+ - `doc-comment-max-lines`: the description (lines other than `@param` / `@returns`) is capped at ONE line
53
+ (`summaryMaxLines`, default 1), every doc line at 120 chars (`lineMaxChars`), and a line containing an arrow
54
+ (U+2192 or `->`) or starting `Flow:` is reported (`callChain`). Matches `.claude/hooks/review-violations.js` docBlock().
55
+ The 3-line total cap is unchanged. One report per block; banned tags take precedence.
56
+
57
+ ## [1.3.0] - 2026-10-06
58
+
59
+ COMMENTS-1 "No code comments; only short doc comments on public members" (decisions D-CMT-1, D-CMT-3).
60
+
61
+ ### Added
62
+
63
+ - `no-comments`: reports every comment that is not a `/**` doc block and not a tool directive
64
+ (`eslint-*`, `@ts-*`, `prettier-ignore`, `istanbul`/`c8`, `/// <reference>`, `#__PURE__`,
65
+ `webpackChunkName`, shebang). `allow: string[]` adds directive regexes. Suggestion only, no autofix.
66
+ - `doc-comment-public-only`: a doc block must sit on an exported declaration (incl. `export { x }`,
67
+ `export default x`, `module.exports`, ambient `declare module`) or a public member of one;
68
+ `private` / `protected` / `#` members and local declarations are reported.
69
+ - `doc-comment-max-lines`: doc body capped at `max` (default 3) content lines; block tags other than
70
+ `allowedTags` (default `@param`, `@returns`) are reported. JSDoc type-annotation blocks
71
+ (`@type`, `@typedef`, ...) are exempt from both doc rules.
72
+ - `commentsConfig` flat-config block (the three rules at `error`) and `COMMENT_RULE_NAMES`, exported
73
+ from `/eslint`. Not adopted by any app yet: each repo opts in as step 1 of its COMMENTS-CLEAN sweep.
74
+
75
+ ## [1.1.0] - 2026-07-13
76
+
77
+ Both changes come out of the ES-04 (agora-web) build, which surfaced two ways the
78
+ rule pack misbehaved against a freshly scaffolded app.
79
+
80
+ ### Fixed
81
+
82
+ - **`no-null-check`: the autofixer no longer corrupts files.** It rewrote
83
+ `x === undefined` → `!isValueDefined(x)` *without importing `isValueDefined`*,
84
+ so `eslint --fix` emitted source referencing an undeclared global. Running
85
+ `lint:fix` on agora-web rewrote ~20 files and produced 67 `no-unsafe-call` /
86
+ `strict-boolean-expressions` errors. A fixer that produces broken code is worse
87
+ than no fixer — `lint:fix` is the first thing anyone runs.
88
+
89
+ The fixer now inserts `import { isValueDefined } from '@dloizides/utils';` (the
90
+ path is configurable via the pre-existing but previously **unused**
91
+ `utilImportPath` option) when the file has no binding for the guard, and skips
92
+ the autofix entirely in the module that defines or re-exports it. Proven with
93
+ `Linter.verifyAndFix` multipass tests — the actual `--fix` code path.
94
+
95
+ ⚠️ The package's own test suite had *codified* the bug: it asserted the
96
+ import-less output was correct. Those expectations were wrong and are updated.
97
+
98
+ ### Changed
99
+
100
+ - **`smart-max-lines`: `functionWarn` is now opt-in (default: off).** ESLint has
101
+ no per-report severity, so a `functionWarn` report is emitted at the severity
102
+ the *rule* is configured with. Every app configured the rule as `'error'` and
103
+ passed `functionWarn: 30` — which made the real, enforced limit **30 lines**
104
+ while the docs promised **50**. The rule lied about its own threshold.
105
+
106
+ Out of the box the only enforced thresholds are now `componentMax` (200) and
107
+ `functionMax` (50) — exactly what the documentation has always promised.
108
+ `functionWarn` remains available as an explicit *stricter second threshold*,
109
+ and its schema/message now say plainly that it reports at the rule's severity
110
+ rather than as a warning.
111
+
112
+ Migration: drop `functionWarn: 30` from your ESLint config. This only relaxes
113
+ linting (30 → 50), so it cannot introduce new failures.
114
+
115
+ ## [1.0.0] - 2026-06-14
116
+
117
+ ### Added
118
+
119
+ - Initial extraction of the shared RN-web dev tooling duplicated across
120
+ erevna-web, katalogos-web, and kefi-web.
121
+ - **ESLint custom rule pack** (17 rules) exported as `plugin` / `rules` /
122
+ `legacyPlugins`, also available under the `@dloizides/frontend-devtools/eslint`
123
+ subpath. Rule names preserved byte-for-byte so existing config keys and
124
+ `eslint-disable-next-line <rule>` comments keep working:
125
+ `enforce-function-style`, `enforce-module-structure`, `enforce-route-preload`,
126
+ `enforce-test-colocation`, `enum-file-isolation`, `i18n-interpolation`,
127
+ `i18n-param-names`, `no-barrel-companion-file`, `no-duplicate-nav-prefix`,
128
+ `no-duplicate-shared-patterns`, `no-generated-models-barrel-value-import`,
129
+ `no-null-check`, `no-optional-undefined`, `no-product-imports-in-shared`,
130
+ `prefer-const-enum`, `require-stable-hook-args`, `smart-max-lines`.
131
+ - **`initI18n(options)`** — parameterized i18next + react-i18next init factory.
132
+ Carries the `import/no-named-as-default-member` disable so apps stop repeating
133
+ it. The app owns its `locales/*.json` strings and the active language.
@@ -80,7 +80,13 @@ declare const commentsConfig: FlatConfig;
80
80
  declare const ROW_ACTION_RULE_NAMES: readonly string[];
81
81
  /** Flat-config block for row actions: RowActionGroup actions come from one shared defineRowActions set. */
82
82
  declare const rowActionsConfig: FlatConfig;
83
+ declare const GAME_RULE_NAMES: readonly string[];
84
+ /** The game preset: menus stay walkable with arrow keys and a controller (NAV-1). Game repos only. */
85
+ declare const gameConfig: FlatConfig;
86
+ declare const API_RULE_NAMES: readonly string[];
87
+ /** PAT-API-1: the backend is called through the shared client or generated hooks, never raw fetch/axios. */
88
+ declare const apiConfig: FlatConfig;
83
89
  /** The recommended flat-config block: every rule the pack enables by default, at error. */
84
90
  declare const recommendedConfig: FlatConfig;
85
91
 
86
- export { COMMENT_RULE_NAMES, type CustomRule, type FlatConfig, type FlatConfigPlugin, ROW_ACTION_RULE_NAMES, type SingleRulePlugin, commentsConfig, legacyPlugins, plugin, recommendedConfig, rowActionsConfig, ruleNames, rules };
92
+ export { API_RULE_NAMES, COMMENT_RULE_NAMES, type CustomRule, type FlatConfig, type FlatConfigPlugin, GAME_RULE_NAMES, ROW_ACTION_RULE_NAMES, type SingleRulePlugin, apiConfig, commentsConfig, gameConfig, legacyPlugins, plugin, recommendedConfig, rowActionsConfig, ruleNames, rules };
@@ -80,7 +80,13 @@ declare const commentsConfig: FlatConfig;
80
80
  declare const ROW_ACTION_RULE_NAMES: readonly string[];
81
81
  /** Flat-config block for row actions: RowActionGroup actions come from one shared defineRowActions set. */
82
82
  declare const rowActionsConfig: FlatConfig;
83
+ declare const GAME_RULE_NAMES: readonly string[];
84
+ /** The game preset: menus stay walkable with arrow keys and a controller (NAV-1). Game repos only. */
85
+ declare const gameConfig: FlatConfig;
86
+ declare const API_RULE_NAMES: readonly string[];
87
+ /** PAT-API-1: the backend is called through the shared client or generated hooks, never raw fetch/axios. */
88
+ declare const apiConfig: FlatConfig;
83
89
  /** The recommended flat-config block: every rule the pack enables by default, at error. */
84
90
  declare const recommendedConfig: FlatConfig;
85
91
 
86
- export { COMMENT_RULE_NAMES, type CustomRule, type FlatConfig, type FlatConfigPlugin, ROW_ACTION_RULE_NAMES, type SingleRulePlugin, commentsConfig, legacyPlugins, plugin, recommendedConfig, rowActionsConfig, ruleNames, rules };
92
+ export { API_RULE_NAMES, COMMENT_RULE_NAMES, type CustomRule, type FlatConfig, type FlatConfigPlugin, GAME_RULE_NAMES, ROW_ACTION_RULE_NAMES, type SingleRulePlugin, apiConfig, commentsConfig, gameConfig, legacyPlugins, plugin, recommendedConfig, rowActionsConfig, ruleNames, rules };