eslint-plugin-react-x 1.22.2-next.10 → 1.22.2-next.11
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/index.js +2 -4
- package/dist/index.mjs +4 -6
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts__default = /*#__PURE__*/_interopDefault(ts);
|
|
|
42
42
|
|
|
43
43
|
// package.json
|
|
44
44
|
var name = "eslint-plugin-react-x";
|
|
45
|
-
var version = "1.22.2-next.
|
|
45
|
+
var version = "1.22.2-next.11";
|
|
46
46
|
var createRule = shared.createRuleForPlugin("x");
|
|
47
47
|
|
|
48
48
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -327,12 +327,10 @@ var no_array_index_key_default = createRule({
|
|
|
327
327
|
name: RULE_NAME5,
|
|
328
328
|
create(context) {
|
|
329
329
|
const indexParamNames = [];
|
|
330
|
+
const isCreateOrCloneElementCall = eff.or(core.isCreateElementCall(context), core.isCloneElementCall(context));
|
|
330
331
|
function isArrayIndex(node) {
|
|
331
332
|
return node.type === types.AST_NODE_TYPES.Identifier && indexParamNames.some(eff.O.exists((name2) => name2 === node.name));
|
|
332
333
|
}
|
|
333
|
-
function isCreateOrCloneElementCall(node) {
|
|
334
|
-
return core.isCreateElementCall(node, context) || core.isCloneElementCall(node, context);
|
|
335
|
-
}
|
|
336
334
|
function getReportDescriptor(node) {
|
|
337
335
|
if (isArrayIndex(node)) return [{ messageId: "noArrayIndexKey", node }];
|
|
338
336
|
if (AST11__namespace.isOneOf([types.AST_NODE_TYPES.TemplateLiteral, types.AST_NODE_TYPES.BinaryExpression])(node)) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F, O,
|
|
1
|
+
import { F, O, or, isString, isNullable } from '@eslint-react/eff';
|
|
2
2
|
import * as JSX7 from '@eslint-react/jsx';
|
|
3
3
|
import { createRuleForPlugin, normalizeSettings, decodeSettings, unsafeReadSettings } from '@eslint-react/shared';
|
|
4
4
|
import * as AST11 from '@eslint-react/ast';
|
|
5
|
-
import { isForwardRefCall, isThisSetState, isClassComponent, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy,
|
|
5
|
+
import { isForwardRefCall, isThisSetState, isClassComponent, isCreateElementCall, isCloneElementCall, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isCreateRefCall, isComponentName, useComponentCollector, ERFunctionComponentFlag, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideCreateElementProps, isInsideRenderMethod, ERClassComponentFlag, isFragmentElement, isInitializedFromReact } from '@eslint-react/core';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
7
7
|
import { isMatching, P, match } from 'ts-pattern';
|
|
8
8
|
import { compare } from 'compare-versions';
|
|
@@ -15,7 +15,7 @@ import { getTypeImmutability, isUnknown, isImmutable, isReadonlyShallow, isReado
|
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
17
|
var name = "eslint-plugin-react-x";
|
|
18
|
-
var version = "1.22.2-next.
|
|
18
|
+
var version = "1.22.2-next.11";
|
|
19
19
|
var createRule = createRuleForPlugin("x");
|
|
20
20
|
|
|
21
21
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -300,12 +300,10 @@ var no_array_index_key_default = createRule({
|
|
|
300
300
|
name: RULE_NAME5,
|
|
301
301
|
create(context) {
|
|
302
302
|
const indexParamNames = [];
|
|
303
|
+
const isCreateOrCloneElementCall = or(isCreateElementCall(context), isCloneElementCall(context));
|
|
303
304
|
function isArrayIndex(node) {
|
|
304
305
|
return node.type === AST_NODE_TYPES.Identifier && indexParamNames.some(O.exists((name2) => name2 === node.name));
|
|
305
306
|
}
|
|
306
|
-
function isCreateOrCloneElementCall(node) {
|
|
307
|
-
return isCreateElementCall(node, context) || isCloneElementCall(node, context);
|
|
308
|
-
}
|
|
309
307
|
function getReportDescriptor(node) {
|
|
310
308
|
if (isArrayIndex(node)) return [{ messageId: "noArrayIndexKey", node }];
|
|
311
309
|
if (AST11.isOneOf([AST_NODE_TYPES.TemplateLiteral, AST_NODE_TYPES.BinaryExpression])(node)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.22.2-next.
|
|
3
|
+
"version": "1.22.2-next.11",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"string-ts": "^2.2.0",
|
|
50
50
|
"ts-api-utils": "^2.0.0",
|
|
51
51
|
"ts-pattern": "^5.6.0",
|
|
52
|
-
"@eslint-react/ast": "1.22.2-next.
|
|
53
|
-
"@eslint-react/core": "1.22.2-next.
|
|
54
|
-
"@eslint-react/eff": "1.22.2-next.
|
|
55
|
-
"@eslint-react/jsx": "1.22.2-next.
|
|
56
|
-
"@eslint-react/shared": "1.22.2-next.
|
|
57
|
-
"@eslint-react/types": "1.22.2-next.
|
|
58
|
-
"@eslint-react/var": "1.22.2-next.
|
|
52
|
+
"@eslint-react/ast": "1.22.2-next.11",
|
|
53
|
+
"@eslint-react/core": "1.22.2-next.11",
|
|
54
|
+
"@eslint-react/eff": "1.22.2-next.11",
|
|
55
|
+
"@eslint-react/jsx": "1.22.2-next.11",
|
|
56
|
+
"@eslint-react/shared": "1.22.2-next.11",
|
|
57
|
+
"@eslint-react/types": "1.22.2-next.11",
|
|
58
|
+
"@eslint-react/var": "1.22.2-next.11"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.2",
|