oxlint-plugin-react-doctor 0.5.8-dev.9f28454 → 0.5.8-dev.b69f4a7

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 (3) hide show
  1. package/LICENSE +14 -8
  2. package/dist/index.js +15 -5
  3. package/package.json +4 -3
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- MIT License (with Additional Restrictions)
1
+ Modified MIT License
2
2
 
3
3
  Copyright (c) 2026 Million Software, Inc.
4
4
 
@@ -12,13 +12,6 @@ furnished to do so, subject to the following conditions:
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
14
14
 
15
- The Software, its source code, and any derivative works thereof may not be
16
- used, in whole or in part, as training data, fine-tuning data, evaluation
17
- data, or as input to any automated pipeline for the purpose of training or
18
- improving any machine learning model or AI system, without prior written
19
- permission from the copyright holder. To request permission, contact
20
- founders@million.dev.
21
-
22
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -26,3 +19,16 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
21
  SOFTWARE.
22
+
23
+ Our only modification is that the following uses require prior written
24
+ permission from the copyright holder. To request permission, contact
25
+ founders@million.dev.
26
+
27
+ 1. Using the Software, its source code, or any derivative works thereof, in
28
+ whole or in part, as training, fine-tuning, or evaluation data, or as input
29
+ to any automated pipeline for training or improving any machine learning
30
+ model or AI system.
31
+
32
+ 2. Selling the Software, or offering it to third parties as a paid, hosted, or
33
+ managed product or service (including any commercial API or SaaS offering)
34
+ whose value derives entirely or substantially from the Software.
package/dist/index.js CHANGED
@@ -10789,10 +10789,22 @@ const isWithinChildrenToArray = (jsxNode) => {
10789
10789
  }
10790
10790
  return false;
10791
10791
  };
10792
+ const spreadCanOverwriteKey = (spreadAttribute) => {
10793
+ const argument = spreadAttribute.argument;
10794
+ if (!isNodeOfType(argument, "ObjectExpression")) return true;
10795
+ for (const property of argument.properties) {
10796
+ if (!isNodeOfType(property, "Property")) return true;
10797
+ if (property.computed) return true;
10798
+ const propertyKey = property.key;
10799
+ if (isNodeOfType(propertyKey, "Identifier") && propertyKey.name === "key") return true;
10800
+ if (isNodeOfType(propertyKey, "Literal") && String(propertyKey.value) === "key") return true;
10801
+ }
10802
+ return false;
10803
+ };
10792
10804
  const checkKeyBeforeSpread = (context, openingElement) => {
10793
10805
  let keyIndex = null;
10794
10806
  let keyAttribute = null;
10795
- let firstSpreadIndex = null;
10807
+ let lastOverwritingSpreadIndex = null;
10796
10808
  for (let attributeIndex = 0; attributeIndex < openingElement.attributes.length; attributeIndex++) {
10797
10809
  const attribute = openingElement.attributes[attributeIndex];
10798
10810
  if (isNodeOfType(attribute, "JSXAttribute")) {
@@ -10800,11 +10812,9 @@ const checkKeyBeforeSpread = (context, openingElement) => {
10800
10812
  keyIndex = attributeIndex;
10801
10813
  keyAttribute = attribute;
10802
10814
  }
10803
- } else if (isNodeOfType(attribute, "JSXSpreadAttribute")) {
10804
- if (firstSpreadIndex === null) firstSpreadIndex = attributeIndex;
10805
- }
10815
+ } else if (isNodeOfType(attribute, "JSXSpreadAttribute") && spreadCanOverwriteKey(attribute)) lastOverwritingSpreadIndex = attributeIndex;
10806
10816
  }
10807
- if (keyIndex !== null && firstSpreadIndex !== null && keyIndex > firstSpreadIndex && keyAttribute) context.report({
10817
+ if (keyIndex !== null && lastOverwritingSpreadIndex !== null && lastOverwritingSpreadIndex > keyIndex && keyAttribute) context.report({
10808
10818
  node: keyAttribute,
10809
10819
  message: KEY_BEFORE_SPREAD
10810
10820
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oxlint-plugin-react-doctor",
3
- "version": "0.5.8-dev.9f28454",
4
- "description": "oxlint plugin for React Doctor: diagnose React codebases for security, performance, correctness, accessibility, bundle-size, and architecture issues",
3
+ "version": "0.5.8-dev.b69f4a7",
4
+ "description": "React Doctor rules for oxlint.",
5
5
  "keywords": [
6
6
  "accessibility",
7
7
  "linter",
@@ -30,7 +30,8 @@
30
30
  },
31
31
  "files": [
32
32
  "dist/**/*.js",
33
- "dist/**/*.d.ts"
33
+ "dist/**/*.d.ts",
34
+ "LICENSE"
34
35
  ],
35
36
  "type": "module",
36
37
  "sideEffects": false,