@eslint-react/core 1.38.0-next.9 → 1.38.1-beta.1
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.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -20,9 +20,9 @@ declare const ERComponentHint: {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly SkipForwardRef: bigint;
|
|
22
22
|
/**
|
|
23
|
-
* Skip function component defined
|
|
23
|
+
* Skip function component defined as array map argument
|
|
24
24
|
*/
|
|
25
|
-
readonly
|
|
25
|
+
readonly SkipArrayMapArgument: bigint;
|
|
26
26
|
/**
|
|
27
27
|
* Skip function component defined on object method
|
|
28
28
|
*/
|
|
@@ -149,7 +149,7 @@ declare function isRenderMethodLike(node: TSESTree.Node): node is AST.TSESTreeMe
|
|
|
149
149
|
declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
|
|
150
150
|
/**
|
|
151
151
|
* Check whether given node is declared inside class component's render block
|
|
152
|
-
* ```
|
|
152
|
+
* ```tsx
|
|
153
153
|
* class Component extends React.Component {
|
|
154
154
|
* render() {
|
|
155
155
|
* class NestedClassComponent extends React.Component {
|
|
@@ -185,7 +185,7 @@ declare const isInversePhase: {
|
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Unsafe check whether given node is a render function
|
|
188
|
-
* ```
|
|
188
|
+
* ```tsx
|
|
189
189
|
* const renderRow = () => <div />
|
|
190
190
|
* ` ^^^^^^^^^^^^`
|
|
191
191
|
* _ = <Component renderRow={() => <div />} />
|
|
@@ -198,7 +198,7 @@ declare const isInversePhase: {
|
|
|
198
198
|
declare function isRenderFunctionLoose(context: RuleContext, node: AST.TSESTreeFunction): boolean;
|
|
199
199
|
/**
|
|
200
200
|
* Unsafe check whether given JSXAttribute is a render prop
|
|
201
|
-
* ```
|
|
201
|
+
* ```tsx
|
|
202
202
|
* _ = <Component renderRow={() => <div />} />
|
|
203
203
|
* ` ^^^^^^^^^^^^^^^^^^^^^^^^^ `
|
|
204
204
|
* ```
|
|
@@ -209,7 +209,7 @@ declare function isRenderFunctionLoose(context: RuleContext, node: AST.TSESTreeF
|
|
|
209
209
|
declare function isRenderPropLoose(context: RuleContext, node: TSESTree.JSXAttribute): boolean;
|
|
210
210
|
/**
|
|
211
211
|
* Unsafe check whether given node is declared directly inside a render property
|
|
212
|
-
* ```
|
|
212
|
+
* ```tsx
|
|
213
213
|
* const rows = { render: () => <div /> }
|
|
214
214
|
* ` ^^^^^^^^^^^^^ `
|
|
215
215
|
* _ = <Component rows={ [{ render: () => <div /> }] } />
|
|
@@ -222,7 +222,7 @@ declare function isRenderPropLoose(context: RuleContext, node: TSESTree.JSXAttri
|
|
|
222
222
|
declare function isDirectValueOfRenderPropertyLoose(node: TSESTree.Node): boolean;
|
|
223
223
|
/**
|
|
224
224
|
* Unsafe check whether given node is declared inside a render prop
|
|
225
|
-
* ```
|
|
225
|
+
* ```tsx
|
|
226
226
|
* _ = <Component renderRow={"node"} />
|
|
227
227
|
* ` ^^^^^^ `
|
|
228
228
|
* _ = <Component rows={ [{ render: "node" }] } />
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ declare const ERComponentHint: {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly SkipForwardRef: bigint;
|
|
22
22
|
/**
|
|
23
|
-
* Skip function component defined
|
|
23
|
+
* Skip function component defined as array map argument
|
|
24
24
|
*/
|
|
25
|
-
readonly
|
|
25
|
+
readonly SkipArrayMapArgument: bigint;
|
|
26
26
|
/**
|
|
27
27
|
* Skip function component defined on object method
|
|
28
28
|
*/
|
|
@@ -149,7 +149,7 @@ declare function isRenderMethodLike(node: TSESTree.Node): node is AST.TSESTreeMe
|
|
|
149
149
|
declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
|
|
150
150
|
/**
|
|
151
151
|
* Check whether given node is declared inside class component's render block
|
|
152
|
-
* ```
|
|
152
|
+
* ```tsx
|
|
153
153
|
* class Component extends React.Component {
|
|
154
154
|
* render() {
|
|
155
155
|
* class NestedClassComponent extends React.Component {
|
|
@@ -185,7 +185,7 @@ declare const isInversePhase: {
|
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Unsafe check whether given node is a render function
|
|
188
|
-
* ```
|
|
188
|
+
* ```tsx
|
|
189
189
|
* const renderRow = () => <div />
|
|
190
190
|
* ` ^^^^^^^^^^^^`
|
|
191
191
|
* _ = <Component renderRow={() => <div />} />
|
|
@@ -198,7 +198,7 @@ declare const isInversePhase: {
|
|
|
198
198
|
declare function isRenderFunctionLoose(context: RuleContext, node: AST.TSESTreeFunction): boolean;
|
|
199
199
|
/**
|
|
200
200
|
* Unsafe check whether given JSXAttribute is a render prop
|
|
201
|
-
* ```
|
|
201
|
+
* ```tsx
|
|
202
202
|
* _ = <Component renderRow={() => <div />} />
|
|
203
203
|
* ` ^^^^^^^^^^^^^^^^^^^^^^^^^ `
|
|
204
204
|
* ```
|
|
@@ -209,7 +209,7 @@ declare function isRenderFunctionLoose(context: RuleContext, node: AST.TSESTreeF
|
|
|
209
209
|
declare function isRenderPropLoose(context: RuleContext, node: TSESTree.JSXAttribute): boolean;
|
|
210
210
|
/**
|
|
211
211
|
* Unsafe check whether given node is declared directly inside a render property
|
|
212
|
-
* ```
|
|
212
|
+
* ```tsx
|
|
213
213
|
* const rows = { render: () => <div /> }
|
|
214
214
|
* ` ^^^^^^^^^^^^^ `
|
|
215
215
|
* _ = <Component rows={ [{ render: () => <div /> }] } />
|
|
@@ -222,7 +222,7 @@ declare function isRenderPropLoose(context: RuleContext, node: TSESTree.JSXAttri
|
|
|
222
222
|
declare function isDirectValueOfRenderPropertyLoose(node: TSESTree.Node): boolean;
|
|
223
223
|
/**
|
|
224
224
|
* Unsafe check whether given node is declared inside a render prop
|
|
225
|
-
* ```
|
|
225
|
+
* ```tsx
|
|
226
226
|
* _ = <Component renderRow={"node"} />
|
|
227
227
|
* ` ^^^^^^ `
|
|
228
228
|
* _ = <Component rows={ [{ render: "node" }] } />
|
package/dist/index.js
CHANGED
|
@@ -829,9 +829,9 @@ var ERComponentHint = {
|
|
|
829
829
|
*/
|
|
830
830
|
SkipForwardRef: 1n << 65n,
|
|
831
831
|
/**
|
|
832
|
-
* Skip function component defined
|
|
832
|
+
* Skip function component defined as array map argument
|
|
833
833
|
*/
|
|
834
|
-
|
|
834
|
+
SkipArrayMapArgument: 1n << 66n,
|
|
835
835
|
/**
|
|
836
836
|
* Skip function component defined on object method
|
|
837
837
|
*/
|
|
@@ -845,7 +845,7 @@ var ERComponentHint = {
|
|
|
845
845
|
*/
|
|
846
846
|
SkipClassProperty: 1n << 69n
|
|
847
847
|
};
|
|
848
|
-
var DEFAULT_COMPONENT_HINT = 0n | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipEmptyArray | ERComponentHint.
|
|
848
|
+
var DEFAULT_COMPONENT_HINT = 0n | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipEmptyArray | ERComponentHint.SkipArrayMapArgument | ERComponentHint.SkipNumberLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipUndefined | ERComponentHint.StrictArray | ERComponentHint.StrictConditional | ERComponentHint.StrictLogical;
|
|
849
849
|
|
|
850
850
|
// src/component/component-flag.ts
|
|
851
851
|
var ERComponentFlag = {
|
|
@@ -959,9 +959,6 @@ function hasValidHierarchy(context, node, hint) {
|
|
|
959
959
|
if (isChildrenOfCreateElement(context, node) || isFunctionOfRenderMethod(node)) {
|
|
960
960
|
return false;
|
|
961
961
|
}
|
|
962
|
-
if (hint & ERComponentHint.SkipMapCallback && AST6__namespace.isMapCallLoose(node.parent)) {
|
|
963
|
-
return false;
|
|
964
|
-
}
|
|
965
962
|
if (hint & ERComponentHint.SkipObjectMethod && isFunctionOfObjectMethod(node.parent)) {
|
|
966
963
|
return false;
|
|
967
964
|
}
|
|
@@ -971,6 +968,9 @@ function hasValidHierarchy(context, node, hint) {
|
|
|
971
968
|
if (hint & ERComponentHint.SkipClassProperty && isFunctionOfClassProperty(node.parent)) {
|
|
972
969
|
return false;
|
|
973
970
|
}
|
|
971
|
+
if (hint & ERComponentHint.SkipArrayMapArgument && AST6__namespace.isArrayMapCallLoose(node.parent)) {
|
|
972
|
+
return false;
|
|
973
|
+
}
|
|
974
974
|
const boundaryNode = AST6__namespace.findParentNode(
|
|
975
975
|
node,
|
|
976
976
|
AST6__namespace.isOneOf([
|
package/dist/index.mjs
CHANGED
|
@@ -802,9 +802,9 @@ var ERComponentHint = {
|
|
|
802
802
|
*/
|
|
803
803
|
SkipForwardRef: 1n << 65n,
|
|
804
804
|
/**
|
|
805
|
-
* Skip function component defined
|
|
805
|
+
* Skip function component defined as array map argument
|
|
806
806
|
*/
|
|
807
|
-
|
|
807
|
+
SkipArrayMapArgument: 1n << 66n,
|
|
808
808
|
/**
|
|
809
809
|
* Skip function component defined on object method
|
|
810
810
|
*/
|
|
@@ -818,7 +818,7 @@ var ERComponentHint = {
|
|
|
818
818
|
*/
|
|
819
819
|
SkipClassProperty: 1n << 69n
|
|
820
820
|
};
|
|
821
|
-
var DEFAULT_COMPONENT_HINT = 0n | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipEmptyArray | ERComponentHint.
|
|
821
|
+
var DEFAULT_COMPONENT_HINT = 0n | ERComponentHint.SkipBooleanLiteral | ERComponentHint.SkipEmptyArray | ERComponentHint.SkipArrayMapArgument | ERComponentHint.SkipNumberLiteral | ERComponentHint.SkipStringLiteral | ERComponentHint.SkipUndefined | ERComponentHint.StrictArray | ERComponentHint.StrictConditional | ERComponentHint.StrictLogical;
|
|
822
822
|
|
|
823
823
|
// src/component/component-flag.ts
|
|
824
824
|
var ERComponentFlag = {
|
|
@@ -932,9 +932,6 @@ function hasValidHierarchy(context, node, hint) {
|
|
|
932
932
|
if (isChildrenOfCreateElement(context, node) || isFunctionOfRenderMethod(node)) {
|
|
933
933
|
return false;
|
|
934
934
|
}
|
|
935
|
-
if (hint & ERComponentHint.SkipMapCallback && AST6.isMapCallLoose(node.parent)) {
|
|
936
|
-
return false;
|
|
937
|
-
}
|
|
938
935
|
if (hint & ERComponentHint.SkipObjectMethod && isFunctionOfObjectMethod(node.parent)) {
|
|
939
936
|
return false;
|
|
940
937
|
}
|
|
@@ -944,6 +941,9 @@ function hasValidHierarchy(context, node, hint) {
|
|
|
944
941
|
if (hint & ERComponentHint.SkipClassProperty && isFunctionOfClassProperty(node.parent)) {
|
|
945
942
|
return false;
|
|
946
943
|
}
|
|
944
|
+
if (hint & ERComponentHint.SkipArrayMapArgument && AST6.isArrayMapCallLoose(node.parent)) {
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
947
|
const boundaryNode = AST6.findParentNode(
|
|
948
948
|
node,
|
|
949
949
|
AST6.isOneOf([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.1-beta.1",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
39
|
-
"@typescript-eslint/type-utils": "^8.
|
|
40
|
-
"@typescript-eslint/types": "^8.
|
|
41
|
-
"@typescript-eslint/utils": "^8.
|
|
38
|
+
"@typescript-eslint/scope-manager": "^8.28.0",
|
|
39
|
+
"@typescript-eslint/type-utils": "^8.28.0",
|
|
40
|
+
"@typescript-eslint/types": "^8.28.0",
|
|
41
|
+
"@typescript-eslint/utils": "^8.28.0",
|
|
42
42
|
"birecord": "^0.1.1",
|
|
43
43
|
"ts-pattern": "^5.6.2",
|
|
44
|
-
"@eslint-react/ast": "1.38.
|
|
45
|
-
"@eslint-react/eff": "1.38.
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
44
|
+
"@eslint-react/ast": "1.38.1-beta.1",
|
|
45
|
+
"@eslint-react/eff": "1.38.1-beta.1",
|
|
46
|
+
"@eslint-react/jsx": "1.38.1-beta.1",
|
|
47
|
+
"@eslint-react/kit": "1.38.1-beta.1",
|
|
48
|
+
"@eslint-react/var": "1.38.1-beta.1",
|
|
49
|
+
"@eslint-react/shared": "1.38.1-beta.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"tsup": "^8.4.0",
|