eslint-plugin-react-x 1.23.0 → 1.23.1-next.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/dist/index.js +5 -3
- package/dist/index.mjs +6 -4
- 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.23.0";
|
|
45
|
+
var version = "1.23.1-next.0";
|
|
46
46
|
var createRule = shared.createRuleForPlugin("x");
|
|
47
47
|
|
|
48
48
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -2180,10 +2180,11 @@ var no_unstable_context_value_default = createRule({
|
|
|
2180
2180
|
eff.O.bind("construction", ({ valueExpression }) => {
|
|
2181
2181
|
const initialScope = context.sourceCode.getScope(valueExpression);
|
|
2182
2182
|
return eff.O.some(VAR__namespace.inspectConstruction(valueExpression, initialScope));
|
|
2183
|
-
})
|
|
2184
|
-
eff.O.filter(({ construction }) => construction._tag !== "None")
|
|
2183
|
+
})
|
|
2185
2184
|
);
|
|
2186
2185
|
for (const { construction, function: [_, fNode] } of eff.O.toArray(constructionEntry)) {
|
|
2186
|
+
if (construction._tag === "None") continue;
|
|
2187
|
+
if (core.isReactHookCall(construction.node)) continue;
|
|
2187
2188
|
constructions.set(fNode, [
|
|
2188
2189
|
...constructions.get(fNode) ?? [],
|
|
2189
2190
|
construction
|
|
@@ -2253,6 +2254,7 @@ var no_unstable_default_props_default = createRule({
|
|
|
2253
2254
|
VAR__namespace.ConstructionHint.StrictCallExpression
|
|
2254
2255
|
);
|
|
2255
2256
|
if (construction._tag === "None") continue;
|
|
2257
|
+
if (core.isReactHookCall(construction.node)) continue;
|
|
2256
2258
|
const forbiddenType = AST11__namespace.toReadableNodeType(right);
|
|
2257
2259
|
context.report({
|
|
2258
2260
|
messageId: "noUnstableDefaultProps",
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ 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, isCreateElementCall, isCloneElementCall, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isCreateRefCall, isComponentName, useComponentCollector, ERFunctionComponentFlag, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideCreateElementProps, isInsideRenderMethod, ERClassComponentFlag, isInitializedFromReact } from '@eslint-react/core';
|
|
5
|
+
import { isForwardRefCall, isThisSetState, isClassComponent, isCreateElementCall, isCloneElementCall, isChildrenCount, isChildrenForEach, isChildrenMap, isChildrenOnly, isChildrenToArray, useComponentCollectorLegacy, isCreateRefCall, isComponentName, useComponentCollector, ERFunctionComponentFlag, isChildrenToArrayCall, ERComponentHint, isDirectValueOfRenderPropertyLoose, isDeclaredInRenderPropLoose, isInsideCreateElementProps, isInsideRenderMethod, ERClassComponentFlag, isReactHookCall, 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.23.0";
|
|
18
|
+
var version = "1.23.1-next.0";
|
|
19
19
|
var createRule = createRuleForPlugin("x");
|
|
20
20
|
|
|
21
21
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -2153,10 +2153,11 @@ var no_unstable_context_value_default = createRule({
|
|
|
2153
2153
|
O.bind("construction", ({ valueExpression }) => {
|
|
2154
2154
|
const initialScope = context.sourceCode.getScope(valueExpression);
|
|
2155
2155
|
return O.some(VAR.inspectConstruction(valueExpression, initialScope));
|
|
2156
|
-
})
|
|
2157
|
-
O.filter(({ construction }) => construction._tag !== "None")
|
|
2156
|
+
})
|
|
2158
2157
|
);
|
|
2159
2158
|
for (const { construction, function: [_, fNode] } of O.toArray(constructionEntry)) {
|
|
2159
|
+
if (construction._tag === "None") continue;
|
|
2160
|
+
if (isReactHookCall(construction.node)) continue;
|
|
2160
2161
|
constructions.set(fNode, [
|
|
2161
2162
|
...constructions.get(fNode) ?? [],
|
|
2162
2163
|
construction
|
|
@@ -2226,6 +2227,7 @@ var no_unstable_default_props_default = createRule({
|
|
|
2226
2227
|
VAR.ConstructionHint.StrictCallExpression
|
|
2227
2228
|
);
|
|
2228
2229
|
if (construction._tag === "None") continue;
|
|
2230
|
+
if (isReactHookCall(construction.node)) continue;
|
|
2229
2231
|
const forbiddenType = AST11.toReadableNodeType(right);
|
|
2230
2232
|
context.report({
|
|
2231
2233
|
messageId: "noUnstableDefaultProps",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.23.0",
|
|
3
|
+
"version": "1.23.1-next.0",
|
|
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/
|
|
53
|
-
"@eslint-react/eff": "1.23.0",
|
|
54
|
-
"@eslint-react/jsx": "1.23.0",
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/core": "1.23.1-next.0",
|
|
53
|
+
"@eslint-react/eff": "1.23.1-next.0",
|
|
54
|
+
"@eslint-react/jsx": "1.23.1-next.0",
|
|
55
|
+
"@eslint-react/shared": "1.23.1-next.0",
|
|
56
|
+
"@eslint-react/types": "1.23.1-next.0",
|
|
57
|
+
"@eslint-react/var": "1.23.1-next.0",
|
|
58
|
+
"@eslint-react/ast": "1.23.1-next.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.2",
|