eslint-plugin-react-features 1.2.5 → 1.2.7

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.
Files changed (129) hide show
  1. package/package.json +7 -18
  2. package/src/index.d.ts +15 -2074
  3. package/src/index.js +1 -36
  4. package/src/oxlint.d.ts +17 -20
  5. package/src/oxlint.js +0 -18
  6. package/src/rules/component-api/no-arbitrary-token-class.js +0 -11
  7. package/src/rules/component-api/no-default-test-id.js +0 -7
  8. package/src/rules/component-api/no-inline-style.js +0 -6
  9. package/src/rules/component-api/no-is-prefix-prop.js +0 -7
  10. package/src/rules/component-api/no-kind-prop-discriminator.js +0 -5
  11. package/src/rules/component-api/no-raw-color-literal.js +0 -8
  12. package/src/rules/component-api/no-wrapper-sub-component.js +0 -8
  13. package/src/rules/component-api/require-data-slot.js +0 -5
  14. package/src/rules/migration/react-class-to-hooks.js +1 -26
  15. package/src/rules/performance/no-unnecessary-rerenders.js +1 -32
  16. package/src/rules/performance/react-no-inline-functions.js +2 -29
  17. package/src/rules/performance/react-render-optimization.js +1 -40
  18. package/src/rules/react/checked-requires-onchange-or-readonly.js +0 -7
  19. package/src/rules/react/default-props-match-prop-types.js +2 -23
  20. package/src/rules/react/display-name.js +1 -33
  21. package/src/rules/react/hooks-exhaustive-deps.js +1 -90
  22. package/src/rules/react/jsx-handler-names.js +0 -8
  23. package/src/rules/react/jsx-key.js +0 -84
  24. package/src/rules/react/jsx-max-depth.js +0 -10
  25. package/src/rules/react/jsx-no-bind.js +0 -10
  26. package/src/rules/react/jsx-no-duplicate-props.js +0 -5
  27. package/src/rules/react/jsx-no-literals.js +0 -5
  28. package/src/rules/react/jsx-no-script-url.js +0 -16
  29. package/src/rules/react/jsx-no-target-blank.js +1 -20
  30. package/src/rules/react/no-access-state-in-setstate.js +0 -13
  31. package/src/rules/react/no-adjacent-inline-elements.js +0 -10
  32. package/src/rules/react/no-arrow-function-lifecycle.js +0 -7
  33. package/src/rules/react/no-children-prop.js +0 -7
  34. package/src/rules/react/no-danger-with-children.js +0 -13
  35. package/src/rules/react/no-danger.js +0 -5
  36. package/src/rules/react/no-deprecated.js +0 -11
  37. package/src/rules/react/no-did-mount-set-state.js +0 -6
  38. package/src/rules/react/no-did-update-set-state.js +0 -10
  39. package/src/rules/react/no-direct-mutation-state.js +3 -29
  40. package/src/rules/react/no-find-dom-node.js +0 -7
  41. package/src/rules/react/no-invalid-html-attribute.js +36 -41
  42. package/src/rules/react/no-is-mounted.js +0 -7
  43. package/src/rules/react/no-multi-comp.js +0 -14
  44. package/src/rules/react/no-namespace.js +0 -5
  45. package/src/rules/react/no-object-type-as-default-prop.js +0 -9
  46. package/src/rules/react/no-redundant-should-component-update.js +0 -6
  47. package/src/rules/react/no-render-return-value.js +1 -9
  48. package/src/rules/react/no-set-state.js +0 -6
  49. package/src/rules/react/no-string-refs.js +0 -8
  50. package/src/rules/react/no-this-in-sfc.js +0 -11
  51. package/src/rules/react/no-typos.js +1 -9
  52. package/src/rules/react/no-unescaped-entities.js +0 -7
  53. package/src/rules/react/no-unknown-property.js +0 -13
  54. package/src/rules/react/no-unsafe.js +0 -7
  55. package/src/rules/react/prefer-es6-class.js +0 -7
  56. package/src/rules/react/prefer-stateless-function.js +0 -13
  57. package/src/rules/react/prop-types.js +0 -12
  58. package/src/rules/react/react-in-jsx-scope.js +0 -9
  59. package/src/rules/react/require-default-props.js +0 -19
  60. package/src/rules/react/require-optimization.js +6 -44
  61. package/src/rules/react/require-render-return.js +0 -9
  62. package/src/rules/react/required-attributes.js +0 -34
  63. package/src/rules/react/sort-comp.js +1 -19
  64. package/src/rules/react/state-in-constructor.js +0 -11
  65. package/src/rules/react/static-property-placement.js +1 -21
  66. package/src/rules/react/void-dom-elements-no-children.js +0 -7
  67. package/src/types/index.js +0 -5
  68. package/CHANGELOG.md +0 -255
  69. package/src/rules/component-api/no-arbitrary-token-class.d.ts +0 -17
  70. package/src/rules/component-api/no-default-test-id.d.ts +0 -15
  71. package/src/rules/component-api/no-inline-style.d.ts +0 -15
  72. package/src/rules/component-api/no-is-prefix-prop.d.ts +0 -17
  73. package/src/rules/component-api/no-kind-prop-discriminator.d.ts +0 -25
  74. package/src/rules/component-api/no-raw-color-literal.d.ts +0 -16
  75. package/src/rules/component-api/no-wrapper-sub-component.d.ts +0 -23
  76. package/src/rules/component-api/require-data-slot.d.ts +0 -15
  77. package/src/rules/migration/react-class-to-hooks.d.ts +0 -22
  78. package/src/rules/performance/no-unnecessary-rerenders.d.ts +0 -26
  79. package/src/rules/performance/react-no-inline-functions.d.ts +0 -24
  80. package/src/rules/performance/react-render-optimization.d.ts +0 -31
  81. package/src/rules/react/checked-requires-onchange-or-readonly.d.ts +0 -16
  82. package/src/rules/react/default-props-match-prop-types.d.ts +0 -13
  83. package/src/rules/react/display-name.d.ts +0 -13
  84. package/src/rules/react/hooks-exhaustive-deps.d.ts +0 -25
  85. package/src/rules/react/jsx-handler-names.d.ts +0 -13
  86. package/src/rules/react/jsx-key.d.ts +0 -20
  87. package/src/rules/react/jsx-max-depth.d.ts +0 -19
  88. package/src/rules/react/jsx-no-bind.d.ts +0 -13
  89. package/src/rules/react/jsx-no-duplicate-props.d.ts +0 -21
  90. package/src/rules/react/jsx-no-literals.d.ts +0 -20
  91. package/src/rules/react/jsx-no-script-url.d.ts +0 -25
  92. package/src/rules/react/jsx-no-target-blank.d.ts +0 -26
  93. package/src/rules/react/no-access-state-in-setstate.d.ts +0 -13
  94. package/src/rules/react/no-adjacent-inline-elements.d.ts +0 -13
  95. package/src/rules/react/no-arrow-function-lifecycle.d.ts +0 -13
  96. package/src/rules/react/no-children-prop.d.ts +0 -13
  97. package/src/rules/react/no-danger-with-children.d.ts +0 -16
  98. package/src/rules/react/no-danger.d.ts +0 -13
  99. package/src/rules/react/no-deprecated.d.ts +0 -16
  100. package/src/rules/react/no-did-mount-set-state.d.ts +0 -13
  101. package/src/rules/react/no-did-update-set-state.d.ts +0 -19
  102. package/src/rules/react/no-direct-mutation-state.d.ts +0 -20
  103. package/src/rules/react/no-find-dom-node.d.ts +0 -15
  104. package/src/rules/react/no-invalid-html-attribute.d.ts +0 -13
  105. package/src/rules/react/no-is-mounted.d.ts +0 -13
  106. package/src/rules/react/no-multi-comp.d.ts +0 -18
  107. package/src/rules/react/no-namespace.d.ts +0 -13
  108. package/src/rules/react/no-object-type-as-default-prop.d.ts +0 -13
  109. package/src/rules/react/no-redundant-should-component-update.d.ts +0 -13
  110. package/src/rules/react/no-render-return-value.d.ts +0 -13
  111. package/src/rules/react/no-set-state.d.ts +0 -13
  112. package/src/rules/react/no-string-refs.d.ts +0 -13
  113. package/src/rules/react/no-this-in-sfc.d.ts +0 -13
  114. package/src/rules/react/no-typos.d.ts +0 -13
  115. package/src/rules/react/no-unescaped-entities.d.ts +0 -13
  116. package/src/rules/react/no-unknown-property.d.ts +0 -13
  117. package/src/rules/react/no-unsafe.d.ts +0 -20
  118. package/src/rules/react/prefer-es6-class.d.ts +0 -13
  119. package/src/rules/react/prefer-stateless-function.d.ts +0 -16
  120. package/src/rules/react/prop-types.d.ts +0 -18
  121. package/src/rules/react/react-in-jsx-scope.d.ts +0 -13
  122. package/src/rules/react/require-default-props.d.ts +0 -16
  123. package/src/rules/react/require-optimization.d.ts +0 -26
  124. package/src/rules/react/require-render-return.d.ts +0 -13
  125. package/src/rules/react/required-attributes.d.ts +0 -28
  126. package/src/rules/react/sort-comp.d.ts +0 -17
  127. package/src/rules/react/state-in-constructor.d.ts +0 -13
  128. package/src/rules/react/static-property-placement.d.ts +0 -20
  129. package/src/rules/react/void-dom-elements-no-children.d.ts +0 -15
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2025 Ofri Peretz
4
- * Licensed under the MIT License. Use of this source code is governed by the
5
- * MIT license that can be found in the LICENSE file.
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
8
3
  exports.staticPropertyPlacement = void 0;
9
4
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -70,7 +65,6 @@ exports.staticPropertyPlacement = (0, eslint_devkit_1.createRule)({
70
65
  }
71
66
  },
72
67
  };
73
- // oxlint-disable-next-line consistent-function-scoping
74
68
  function isReactComponent(node) {
75
69
  if (!node.superClass)
76
70
  return false;
@@ -88,7 +82,6 @@ exports.staticPropertyPlacement = (0, eslint_devkit_1.createRule)({
88
82
  function checkStaticPropertyPlacement(node, groups) {
89
83
  const members = node.body.body;
90
84
  const staticProperties = [];
91
- // Collect static properties
92
85
  for (let i = 0; i < members.length; i++) {
93
86
  const member = members[i];
94
87
  if (isStaticProperty(member)) {
@@ -100,36 +93,23 @@ exports.staticPropertyPlacement = (0, eslint_devkit_1.createRule)({
100
93
  }
101
94
  if (staticProperties.length < 2)
102
95
  return;
103
- // Check if properties are properly grouped
104
96
  for (let i = 1; i < staticProperties.length; i++) {
105
97
  const current = staticProperties[i];
106
98
  const previous = staticProperties[i - 1];
107
99
  if (!areInSameGroup(current.name, previous.name, groups)) {
108
- // `staticProperties` holds every named static member in source
109
- // order, so the members strictly between `previous` and `current`
110
- // are either non-static or computed-key statics (no name). The
111
- // historical implementation walked that gap looking for a named
112
- // static property to report — a provably unreachable path (a named
113
- // static in the gap would itself already be in `staticProperties`).
114
- // That dead branch was deleted rather than coverage-ignored.
115
100
  }
116
101
  }
117
102
  }
118
- // oxlint-disable-next-line consistent-function-scoping
119
103
  function isStaticProperty(member) {
120
- return (
121
- // Handle PropertyDefinition and MethodDefinition
122
- (member.type === 'PropertyDefinition' || member.type === 'MethodDefinition') &&
104
+ return ((member.type === 'PropertyDefinition' || member.type === 'MethodDefinition') &&
123
105
  member.static);
124
106
  }
125
- // oxlint-disable-next-line consistent-function-scoping
126
107
  function getPropertyName(member) {
127
108
  if (member.key.type === 'Identifier') {
128
109
  return member.key.name;
129
110
  }
130
111
  return null;
131
112
  }
132
- // oxlint-disable-next-line consistent-function-scoping
133
113
  function areInSameGroup(name1, name2, groups) {
134
114
  for (const group of groups) {
135
115
  if (group.properties.includes(name1) && group.properties.includes(name2)) {
@@ -1,14 +1,8 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2025 Ofri Peretz
4
- * Licensed under the MIT License. Use of this source code is governed by the
5
- * MIT license that can be found in the LICENSE file.
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
8
3
  exports.voidDomElementsNoChildren = void 0;
9
4
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
10
5
  const eslint_devkit_2 = require("@interlace/eslint-devkit");
11
- // HTML void elements that cannot have children
12
6
  const VOID_ELEMENTS = new Set([
13
7
  'area',
14
8
  'base',
@@ -58,7 +52,6 @@ exports.voidDomElementsNoChildren = (0, eslint_devkit_2.createRule)({
58
52
  attr.name.type === 'JSXIdentifier' &&
59
53
  attr.name.name === 'dangerouslySetInnerHTML');
60
54
  }
61
- // oxlint-disable-next-line consistent-function-scoping
62
55
  function hasJSXChildren(node) {
63
56
  return node.children.some(child => {
64
57
  if (child.type === 'JSXText') {
@@ -1,7 +1,2 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2025 Ofri Peretz
4
- * Licensed under the MIT License. Use of this source code is governed by the
5
- * MIT license that can be found in the LICENSE file.
6
- */
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
package/CHANGELOG.md DELETED
@@ -1,255 +0,0 @@
1
- ## [1.1.4] - 2026-05-03
2
-
3
- ## 1.2.5
4
-
5
- ### Patch Changes
6
-
7
- - [#294](https://github.com/ofri-peretz/eslint/pull/294) [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Rewrite `description` and `keywords` on every published package for npm search discovery. npm ranks on name, description, and keywords, and the registry only picks up these fields at publish — so this is metadata-only and takes effect for each package on its next release.
8
-
9
- **Descriptions now lead with the search phrase.** Every one starts `ESLint plugin for <the thing you'd search>` instead of a brand-first or category-first framing, and names the concrete vulnerabilities the plugin actually detects. Three were corrected while doing so:
10
-
11
- - `eslint-plugin-import-next` claimed "100x faster no-cycle detection". No 100x measurement exists: `CLAIMS.md` records **3.1x end-to-end** (8x in pure rule execution) on a 5,483-file React codebase, and the highest number in any benchmark result is 54.9x on the synthetic corpus. The description now states the real-codebase figure.
12
- - `eslint-plugin-secure-coding` claimed SQL injection, XSS and CSRF coverage — none of which are its rules. It now names what it does detect: LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.
13
- - `eslint-plugin-secure-coding` ("89 rules") and `eslint-plugin-react-a11y` ("37 rules") hard-coded rule counts that had drifted from reality. Counts are generated into `interlace-numbers.json`; hand-typed copies are removed rather than corrected.
14
-
15
- **Keywords now match the vocabulary of the plugins that rank.** `eslint-plugin-security`, `eslint-plugin-jsx-a11y`, `eslint-plugin-n` and `eslint-plugin-import` all carry the `eslint` / `eslintplugin` / `eslint-plugin` trio — six of our packages were missing `eslintplugin`, and every one now carries all three plus `static-analysis`, `linting` and `code-quality`. Security plugins add `sast`, `appsec` and `vulnerability`; `node-security` and `secure-coding` also carry `nodesecurity`, the exact keyword `eslint-plugin-security` ranks on. Each plugin gained the CWE identifiers and attack names for what it detects (`cwe-78` command injection, `cwe-22` path traversal, `cwe-89` SQL injection, `cwe-79` XSS, `cwe-347` JWT algorithm confusion, `cwe-352` CSRF, `cwe-943` NoSQL injection), and `node-security` gained the crypto vocabulary it had been missing entirely despite absorbing the crypto rule set (`crypto`, `cryptography`, `weak-hash`, `md5`, `sha1`, `timing-attack`).
16
-
17
- No rule behavior, exports, or configuration changes.
18
-
19
- - Updated dependencies [[`e1cdf83`](https://github.com/ofri-peretz/eslint/commit/e1cdf83e3db761907f0ab06f7fc6c1f1da7513a5), [`659f6dc`](https://github.com/ofri-peretz/eslint/commit/659f6dc0181b03b675f72b5949fcf123dd066358)]:
20
- - @interlace/eslint-devkit@1.4.3
21
-
22
- ## 1.2.4
23
-
24
- ### Patch Changes
25
-
26
- - [#269](https://github.com/ofri-peretz/eslint/pull/269) [`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - docs: dual-logo README header (Interlace mark + ESLint mark side by side) and closing Interlace footer — refreshes the README rendered on npmjs.com. No runtime changes.
27
-
28
- - Updated dependencies [[`7028fe2`](https://github.com/ofri-peretz/eslint/commit/7028fe2668a42266d831014184dcef70e73101ad)]:
29
- - @interlace/eslint-devkit@1.4.2
30
-
31
- ## 1.2.3
32
-
33
- ### Patch Changes
34
-
35
- - [#252](https://github.com/ofri-peretz/eslint/pull/252) [`d67e395`](https://github.com/ofri-peretz/eslint/commit/d67e3953c2748ad36e6aebe0f24b1d04e518b4d0) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Fix Codecov badge showing "unknown" — switch from flag to component URL format
36
-
37
- ## 1.2.2
38
-
39
- ### Patch Changes
40
-
41
- - [#225](https://github.com/ofri-peretz/eslint/pull/225) [`34ff5a8`](https://github.com/ofri-peretz/eslint/commit/34ff5a8e6f5126c5d1c0a524759e0af2b5476b46) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - CI-only: pin all coverage thresholds at 100% (integration target, merges last).
42
-
43
- ## 1.2.1
44
-
45
- ### Patch Changes
46
-
47
- - [#229](https://github.com/ofri-peretz/eslint/pull/229) [`acc81a7`](https://github.com/ofri-peretz/eslint/commit/acc81a74d0c329027bf6011f5db4b1bf9beba650) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - `no-unknown-property` no longer fires on custom React components. The rule now
48
- only checks host (lowercase DOM) elements, matching upstream
49
- `react/no-unknown-property` — uppercase and member-expression JSX names
50
- (`<Box surface="card">`, `<Motion.div />`) accept arbitrary props.
51
-
52
- ## 1.2.0
53
-
54
- ### Minor Changes
55
-
56
- - [#100](https://github.com/ofri-peretz/eslint/pull/100) [`fcb6d8e`](https://github.com/ofri-peretz/eslint/commit/fcb6d8ed6c6f531fe11427508673a31fe754a2e6) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Expose the `component-api/*` rule namespace to consumers.
57
-
58
- Eight rules — `no-default-test-id`, `require-data-slot`, `no-is-prefix-prop`,
59
- `no-inline-style`, `no-raw-color-literal`, `no-arbitrary-token-class`,
60
- `no-kind-prop-discriminator`, `no-wrapper-sub-component` — already exist in
61
- `src/rules/component-api/`, but they were not previously included in the
62
- published `rules` map and so could not be registered by consumers.
63
- This release adds them so downstream apps (e.g. `apps/blog`, `apps/docs`,
64
- `interlace-landing`) can register the `componentApi` preset via:
65
-
66
- ```js
67
- import reactFeatures from "eslint-plugin-react-features";
68
-
69
- {
70
- plugins: { "react-features": reactFeatures },
71
- rules: {
72
- "react-features/component-api/no-default-test-id": "error",
73
- "react-features/component-api/require-data-slot": "warn",
74
- "react-features/component-api/no-is-prefix-prop": "warn",
75
- "react-features/component-api/no-inline-style": "warn",
76
- "react-features/component-api/no-raw-color-literal": "warn",
77
- "react-features/component-api/no-arbitrary-token-class": "warn",
78
- "react-features/component-api/no-kind-prop-discriminator": "warn",
79
- "react-features/component-api/no-wrapper-sub-component": "warn",
80
- },
81
- }
82
- ```
83
-
84
- Each rule corresponds to a rule ID (R5/R6/R8/R11/R12/R18/R19) in the
85
- `interlace-component` skill at `agents/skills/interlace-component/SKILL.md`.
86
- The rules are not part of the `recommended` config — they ship as an opt-in
87
- `componentApi` preset that strict design systems can enable on top of the
88
- base react ruleset.
89
-
90
- Unblocks STR-1 in `agents/apps/blog/INTERLACE_AUDIT.md`.
91
-
92
- ### Patch Changes
93
-
94
- - [#141](https://github.com/ofri-peretz/eslint/pull/141) [`38ab670`](https://github.com/ofri-peretz/eslint/commit/38ab670a0221684f4fd3d5dc3c05ddec7458ca2b) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - fix: remove false `meta.fixable: 'code'` declarations from 21 rules that had no `fix()` function
95
-
96
- Rules that declared `fixable: 'code'` in their ESLint meta without an actual `fix()` implementation would show the ⚡ auto-fix icon in editors and CI formatters but apply no change when `--fix` was run. This patch removes the misleading declaration from:
97
- - `browser-security/no-clickjacking`
98
- - `import-next/first`, `named`, `no-barrel-import`, `no-import-module-exports`, `no-namespace`
99
- - `node-security/no-buffer-overread`, `no-unsafe-dynamic-require`, `no-zip-slip`
100
- - `react-features/react-no-inline-functions`
101
- - `reliability/no-jsdoc-terminator-in-example` (uses `suggest`, not auto-fix; corrected to `hasSuggestions: true` only)
102
- - `secure-coding/no-directive-injection`, `no-electron-security-issues`, `no-graphql-injection`, `no-improper-sanitization`, `no-improper-type-validation`, `no-ldap-injection`, `no-unchecked-loop-condition`, `no-unlimited-resource-allocation`, `no-weak-password-recovery`, `no-xpath-injection`
103
-
104
- - [#186](https://github.com/ofri-peretz/eslint/pull/186) [`edf208d`](https://github.com/ofri-peretz/eslint/commit/edf208d67ac2357312c97d8964fcf6a462e407eb) Thanks [@ofri-peretz](https://github.com/ofri-peretz)! - Consolidation cleanup — no rule behavior change:
105
- - **react-features**: the README rules table now lists the 8 `componentApi`
106
- preset rules. The README generator (`sync-readme-rules.ts`) and the
107
- `plugin-rule-source-drift` validator now recurse into nested
108
- `docs/rules/<category>/` subfolders, so every documented rule is advertised
109
- consistently (previously the nested componentApi docs were silently dropped,
110
- which an earlier `readme` exception had papered over — that exception is now
111
- removed in favour of the real fix).
112
- - **node-security**: remove the orphaned `no-pii-in-logs` rule source — the rule
113
- was migrated to `eslint-plugin-secure-coding` and is no longer exported here;
114
- the dead source was still compiling into `dist`.
115
- - **import-next**: restore the `no-cycle` unit test after [#180](https://github.com/ofri-peretz/eslint/issues/180)'s SCC refactor
116
- (`computeSCCsFromFile` + `findShortestCyclePath` are now bridged in the mock).
117
-
118
- Also fixes `scripts/ilb-plugin-scope-audit.ts` to stop mis-reading config-preset
119
- keys (`'recommended-strict': {`) as rules.
120
-
121
- - Updated dependencies [[`736a5fe`](https://github.com/ofri-peretz/eslint/commit/736a5fed47e673f6157ea900b29fe2a54e4bc7df)]:
122
- - @interlace/eslint-devkit@1.4.1
123
-
124
- ### Bug Fixes
125
-
126
- - `jsx-no-target-blank`: replaced `/^\/\//.test(href)` with `href.startsWith('//')` (oxlint correctness rule).
127
-
128
- ## [1.1.3] - 2026-02-08
129
-
130
- ### Bug Fixes
131
-
132
- - align codecov component IDs with full package names ([2831b968](https://github.com/ofri-peretz/eslint/commit/2831b968))
133
-
134
- ### Documentation
135
-
136
- - fix changelog header format across all packages ([c3a15082](https://github.com/ofri-peretz/eslint/commit/c3a15082))
137
-
138
- ### ❤️ Thank You
139
-
140
- - Ofri Peretz
141
-
142
- ## [1.1.2] - 2026-02-06
143
-
144
- ### Bug Fixes
145
-
146
- - align codecov component names and update docs components ([0a59a86c](https://github.com/ofri-peretz/eslint/commit/0a59a86c))
147
-
148
- ### ❤️ Thank You
149
-
150
- - Ofri Peretz
151
-
152
- ## [1.1.1] - 2026-02-02
153
-
154
- This was a version bump only for eslint-plugin-react-features to align it with other projects, there were no code changes.
155
-
156
- # Changelog
157
-
158
- All notable changes to `eslint-plugin-react-features` will be documented in this file.
159
-
160
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
161
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
162
-
163
- ### Documentation
164
-
165
- - 📘 Launched new documentation site: [eslint.interlace.tools](https://eslint.interlace.tools/)
166
- - 📝 Achieved 100% documentation parity (both .md and .mdx files)
167
-
168
- ## [1.1.0] - 2026-02-02
169
-
170
- ### Features
171
-
172
- - **infra:** migrate from pnpm to npm for Vercel compatibility ([46172cd7](https://github.com/ofri-peretz/eslint/commit/46172cd7))
173
- - **docs:** implement 3-pillar navigation with sidebar tabs ([03c3f688](https://github.com/ofri-peretz/eslint/commit/03c3f688))
174
- - **docs:** deploy new Interlace VI and mobile UX ([c05b5106](https://github.com/ofri-peretz/eslint/commit/c05b5106))
175
- - add high-fidelity OG images, banners, and update docs layout ([bf60afed](https://github.com/ofri-peretz/eslint/commit/bf60afed))
176
-
177
- ### Bug Fixes
178
-
179
- - **release:** fix release workflow logic, docs cache, and promote lint warnings to errors ([5945113a](https://github.com/ofri-peretz/eslint/commit/5945113a))
180
- - **docs:** resolve MDX compatibility issues and add validation tests ([dac50031](https://github.com/ofri-peretz/eslint/commit/dac50031))
181
- - **docs:** revert inappropriate security additions to non-security plugins ([b8b7bac0](https://github.com/ofri-peretz/eslint/commit/b8b7bac0))
182
- - **docs:** strict readout alignment to NestJS structure and table consolidation --no-verify ([6e12c39f](https://github.com/ofri-peretz/eslint/commit/6e12c39f))
183
- - **docs:** wrap lucide icons with span for title attribute compatibility ([bd36290d](https://github.com/ofri-peretz/eslint/commit/bd36290d))
184
-
185
- ### Documentation
186
-
187
- - update rule documentation and docs app UI improvements ([53c83f8c](https://github.com/ofri-peretz/eslint/commit/53c83f8c))
188
- - add Known False Negatives to all rules (173 rules updated) ([1e988afd](https://github.com/ofri-peretz/eslint/commit/1e988afd))
189
- - fleet-wide documentation compliance - 160 rules improved ([1d68f96a](https://github.com/ofri-peretz/eslint/commit/1d68f96a))
190
- - update plugin documentation with standardized badges and new OG images ([627773c9](https://github.com/ofri-peretz/eslint/commit/627773c9))
191
- - finalize readme structure, drop security research coverage ([30b96dbd](https://github.com/ofri-peretz/eslint/commit/30b96dbd))
192
- - remove header and legend artifacts from rules table ([8e46b93e](https://github.com/ofri-peretz/eslint/commit/8e46b93e))
193
- - finalize readme layout with centered badges and strict structure ([f9413c91](https://github.com/ofri-peretz/eslint/commit/f9413c91))
194
- - align main README with Interlace branding ([15e520cd](https://github.com/ofri-peretz/eslint/commit/15e520cd))
195
-
196
- ### ❤️ Thank You
197
-
198
- - Ofri Peretz
199
-
200
- ## [1.0.0] - 2026-01-26
201
-
202
- ### Added
203
-
204
- - Initial stable release with 53 React rules
205
- - 1,190+ test cases covering edge cases and TypeScript integration
206
- - LLM-optimized error messages for AI-assisted development
207
- - ESLint 9 flat config support
208
- - TypeScript type definitions for all rule options
209
-
210
- ### Rule Categories
211
-
212
- #### Migration Rules (React 17→18)
213
-
214
- - `jsx-no-target-blank` - Require rel="noopener" on target="\_blank" links
215
- - `jsx-no-script-url` - Disallow javascript: URLs in JSX
216
- - `jsx-no-duplicate-props` - Disallow duplicate props
217
- - `no-danger-with-children` - Disallow children with dangerouslySetInnerHTML
218
- - `no-deprecated` - Disallow deprecated React APIs
219
- - `no-find-dom-node` - Disallow findDOMNode
220
- - `no-unsafe` - Disallow UNSAFE\_ lifecycle methods
221
- - `void-dom-elements-no-children` - Disallow children in void DOM elements
222
-
223
- #### Performance Rules
224
-
225
- - `no-inline-handlers` - Disallow inline function handlers (re-render prevention)
226
- - `no-object-style-literals` - Disallow object literals in style prop
227
- - `require-memo` - Require React.memo for pure components
228
- - `require-usecallback` - Require useCallback for function props
229
- - `require-usememo` - Require useMemo for expensive computations
230
-
231
- #### Core React Rules
232
-
233
- - Hooks rules: exhaustive-deps, rules-of-hooks compliance
234
- - Component patterns: naming, structure, composition
235
- - State management: useState, useReducer patterns
236
-
237
- ### Presets
238
-
239
- - `recommended` - Balanced React best practices
240
- - `strict` - All rules as errors
241
- - `performance` - Performance-focused subset
242
- - `migration` - React upgrade assistance
243
-
244
- ### ⚠️ Breaking from 0.x
245
-
246
- - Removed deprecated rules (now in `react-a11y`)
247
- - Renamed: `react-perf/no-jsx-bind` → `performance/no-inline-handlers`
248
-
249
- ### Known Limitations
250
-
251
- Documented in `docs/KNOWN-LIMITATIONS.md`:
252
-
253
- - `jsx-no-target-blank`: Dynamic `href` variables not detected
254
- - `jsx-no-script-url`: Obfuscated patterns in variables not detected
255
- - Spread props (`{...props}`) prevent static attribute analysis
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-arbitrary-token-class
8
- * Enforces R19: no Tailwind arbitrary-value classes (`rounded-[12px]`,
9
- * `px-[18px]`) on properties that have a design-token equivalent. Allows
10
- * arbitrary values that reference CSS variables (`rounded-[var(--token)]`),
11
- * computed expressions (`w-[calc(...)]`), or non-pixel units that don't map
12
- * to the spacing scale (`min-h-[60vh]`).
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- export declare const noArbitraryTokenClass: TSESLint.RuleModule<"arbitraryClass", [], unknown, TSESLint.RuleListener> & {
16
- name: string;
17
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-default-test-id
8
- * Enforces R5 from the interlace-component skill: data-testid must be
9
- * type-required and consumer-provided. A runtime default contradicts the
10
- * type-level requirement and silently masks consumer omissions.
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export declare const noDefaultTestId: TSESLint.RuleModule<"defaultTestId", [], unknown, TSESLint.RuleListener> & {
14
- name: string;
15
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-inline-style
8
- * Enforces R18: no inline `style={{...}}` for static styling. The only
9
- * permitted case is CSS-variable assignment (`style={{ "--snp-x": x }}`)
10
- * for genuinely dynamic values. Everything else belongs in Tailwind classes.
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export declare const noInlineStyle: TSESLint.RuleModule<"inlineStyle", [], unknown, TSESLint.RuleListener> & {
14
- name: string;
15
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-is-prefix-prop
8
- * Enforces R8: boolean props default-false, name describes the true state.
9
- * Bans `isXxx: boolean` props in TypeScript interfaces / type aliases.
10
- * `looped` reads naturally; `isLooped` is MUI-flagged noise.
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- type MessageIds = 'isPrefix' | 'renameSuggestion';
14
- export declare const noIsPrefixProp: TSESLint.RuleModule<MessageIds, [], unknown, TSESLint.RuleListener> & {
15
- name: string;
16
- };
17
- export {};
@@ -1,25 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-kind-prop-discriminator
8
- * Enforces R11: ban the `type: "A" | "B"` kind-prop pattern when the value
9
- * is intended to switch the rendered tree. Heuristic: a property named
10
- * `type` / `kind` / `variant` with a string-literal-union of 2+ members,
11
- * AND the component body contains a conditional `if (props.<name> === ...)`
12
- * or switch-case branching on that prop.
13
- *
14
- * Notes on intentional false positives:
15
- * - `variant` is permitted by some teams as a CVA discriminator that only
16
- * switches `role` / `className` (not the element tree). This rule flags
17
- * the shape; review confirms whether the branching is structural or just
18
- * a contract switch.
19
- * - We only flag `type` / `kind` here; `variant` is allow-listed by default
20
- * because CVA usage is the dominant case.
21
- */
22
- import type { TSESLint } from '@interlace/eslint-devkit';
23
- export declare const noKindPropDiscriminator: TSESLint.RuleModule<"kindProp", [], unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-raw-color-literal
8
- * Enforces R19: no raw color literals (hex, rgb/rgba, hsl/hsla, oklch/oklab)
9
- * in source. Colors must come from design tokens via CSS custom properties
10
- * or Tailwind classes wired to them. Scoped to JSX `style` / `className`
11
- * object values and `cn()`/`clsx()` arguments to minimize false positives.
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- export declare const noRawColorLiteral: TSESLint.RuleModule<"rawColor", [], unknown, TSESLint.RuleListener> & {
15
- name: string;
16
- };
@@ -1,23 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-wrapper-sub-component
8
- * Enforces R12: don't create wrapper sub-components when an existing
9
- * primitive does the job. Heuristic: a function component whose entire body
10
- * is `return <Primitive {...props} />;` — a pure passthrough wrapper that
11
- * adds no structural behavior.
12
- *
13
- * Exempt cases:
14
- * - The wrapper adds at least one literal attribute (className, data-slot,
15
- * aria-*, role) — that's structural behavior.
16
- * - The wrapper adds hook calls or computed values before returning.
17
- * - The wrapper renames the component for re-export with no other change —
18
- * still flagged; consumers should import the primitive directly.
19
- */
20
- import type { TSESLint } from '@interlace/eslint-devkit';
21
- export declare const noWrapperSubComponent: TSESLint.RuleModule<"wrapperSubComponent", [], unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: require-data-slot
8
- * Enforces R6: every named composition part carries `data-slot="<part-name>"`
9
- * so consumers can style by slot. Heuristic: a JSX element that carries
10
- * `data-testid` is a named part and must also carry `data-slot`.
11
- */
12
- import type { TSESLint } from '@interlace/eslint-devkit';
13
- export declare const requireDataSlot: TSESLint.RuleModule<"missingDataSlot", [], unknown, TSESLint.RuleListener> & {
14
- name: string;
15
- };
@@ -1,22 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: react-class-to-hooks
8
- * Detects React class components that can be migrated to hooks with transformation context
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- type MessageIds = 'migrateToHooks' | 'convertToFunction' | 'viewMigrationGuide';
12
- export interface Options {
13
- /** Ignore PureComponent classes. Default: false */
14
- ignorePureRenderComponents?: boolean;
15
- /** Allow classes with complex lifecycle patterns. Default: false */
16
- allowComplexLifecycle?: boolean;
17
- }
18
- type RuleOptions = [Options?];
19
- export declare const reactClassToHooks: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
20
- name: string;
21
- };
22
- export {};
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: no-unnecessary-rerenders
8
- * Detects prevented re-renders in React
9
- * React-specific performance rule
10
- *
11
- * @see https://react.dev/reference/react/useMemo
12
- * @see https://react.dev/reference/react/useCallback
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unnecessaryRerender' | 'useMemo' | 'useCallback' | 'extractToVariable';
16
- export interface Options {
17
- /** Ignore in test files. Default: true */
18
- ignoreInTests?: boolean;
19
- /** Minimum array/object size to warn. Default: 5 */
20
- minSize?: number;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noUnnecessaryRerenders: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,24 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: react-no-inline-functions
8
- * Detects inline functions in React renders with performance impact context
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- type MessageIds = 'inlineFunction' | 'useCallback' | 'extractFunction' | 'strategyUseCallback' | 'strategyUseMemo' | 'strategyExtract';
12
- export interface Options {
13
- /** Allow inline functions in event handlers. Default: false */
14
- allowInEventHandlers?: boolean;
15
- /** Minimum array size to trigger warning. Default: 5 */
16
- minArraySize?: number;
17
- /** Strategy for fixing inline functions: 'usecallback', 'usememo', 'extract', or 'auto' */
18
- strategy?: 'usecallback' | 'usememo' | 'extract' | 'auto';
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const reactNoInlineFunctions: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,31 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: react-render-optimization
8
- * Detects unnecessary re-renders and expensive computations in React
9
- * Priority 7: Performance & Optimization
10
- *
11
- * @see https://react.dev/learn/render-and-commit
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- type MessageIds = 'unnecessaryRerender' | 'missingMemoization' | 'expensiveComputation' | 'useMemo' | 'useCallback' | 'useReactMemo';
15
- export interface Options {
16
- /** Detect inline object/array props. Default: true */
17
- detectInlineProps?: boolean;
18
- /** Detect inline function props. Default: true */
19
- detectInlineFunctions?: boolean;
20
- /** Detect expensive computations without useMemo. Default: true */
21
- detectExpensiveComputations?: boolean;
22
- /** Minimum computation complexity to flag. Default: 3 */
23
- minComputationComplexity?: number;
24
- /** Ignore in test files. Default: true */
25
- ignoreInTests?: boolean;
26
- }
27
- type RuleOptions = [Options?];
28
- export declare const reactRenderOptimization: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
29
- name: string;
30
- };
31
- export {};
@@ -1,16 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: checked-requires-onchange-or-readonly
8
- * Ensure controlled inputs have onChange or readOnly
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- export interface Options {
12
- }
13
- export type RuleOptions = [Options?];
14
- export declare const checkedRequiresOnchangeOrReadonly: TSESLint.RuleModule<"checkedRequiresOnChangeOrReadOnly", RuleOptions, unknown, TSESLint.RuleListener> & {
15
- name: string;
16
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Ofri Peretz
3
- * Licensed under the MIT License. Use of this source code is governed by the
4
- * MIT license that can be found in the LICENSE file.
5
- */
6
- /**
7
- * ESLint Rule: default-props-match-prop-types
8
- * Validate default props match prop types
9
- */
10
- import type { TSESLint } from '@interlace/eslint-devkit';
11
- export declare const defaultPropsMatchPropTypes: TSESLint.RuleModule<"defaultPropsMatchPropTypes", [], unknown, TSESLint.RuleListener> & {
12
- name: string;
13
- };