@eslint-react/core 1.22.2 → 1.23.0-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 +1 -9
- package/dist/index.d.ts +1 -9
- package/dist/index.js +5 -19
- package/dist/index.mjs +6 -16
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -174,14 +174,6 @@ declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleCo
|
|
|
174
174
|
*/
|
|
175
175
|
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
176
176
|
|
|
177
|
-
/**
|
|
178
|
-
* Check if a node is `<Fragment></Fragment>` or `<Pragma.Fragment></Pragma.Fragment>`
|
|
179
|
-
* @param node The JSX element node to check
|
|
180
|
-
* @param context The rule context
|
|
181
|
-
* @returns `true` if the node is a fragment element, `false` otherwise
|
|
182
|
-
*/
|
|
183
|
-
declare function isFragmentElement(node: TSESTree.JSXElement, context: RuleContext): boolean;
|
|
184
|
-
|
|
185
177
|
declare function isInsideReactHook(node: TSESTree.Node): boolean;
|
|
186
178
|
|
|
187
179
|
interface ERHook extends ERSemanticNode {
|
|
@@ -2568,4 +2560,4 @@ declare const isMemoCall: {
|
|
|
2568
2560
|
(node: Node, context: _eslint_react_types.RuleContext): node is CallExpression;
|
|
2569
2561
|
};
|
|
2570
2562
|
|
|
2571
|
-
export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall,
|
|
2563
|
+
export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/dist/index.d.ts
CHANGED
|
@@ -174,14 +174,6 @@ declare function isInsideCreateElementProps(node: TSESTree.Node, context: RuleCo
|
|
|
174
174
|
*/
|
|
175
175
|
declare function isChildrenOfCreateElement(node: TSESTree.Node, context: RuleContext): boolean;
|
|
176
176
|
|
|
177
|
-
/**
|
|
178
|
-
* Check if a node is `<Fragment></Fragment>` or `<Pragma.Fragment></Pragma.Fragment>`
|
|
179
|
-
* @param node The JSX element node to check
|
|
180
|
-
* @param context The rule context
|
|
181
|
-
* @returns `true` if the node is a fragment element, `false` otherwise
|
|
182
|
-
*/
|
|
183
|
-
declare function isFragmentElement(node: TSESTree.JSXElement, context: RuleContext): boolean;
|
|
184
|
-
|
|
185
177
|
declare function isInsideReactHook(node: TSESTree.Node): boolean;
|
|
186
178
|
|
|
187
179
|
interface ERHook extends ERSemanticNode {
|
|
@@ -2568,4 +2560,4 @@ declare const isMemoCall: {
|
|
|
2568
2560
|
(node: Node, context: _eslint_react_types.RuleContext): node is CallExpression;
|
|
2569
2561
|
};
|
|
2570
2562
|
|
|
2571
|
-
export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall,
|
|
2563
|
+
export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,12 @@ var AST9 = require('@eslint-react/ast');
|
|
|
4
4
|
var eff = require('@eslint-react/eff');
|
|
5
5
|
var JSX4 = require('@eslint-react/jsx');
|
|
6
6
|
var types = require('@typescript-eslint/types');
|
|
7
|
-
var ShortUniqueId = require('short-unique-id');
|
|
8
7
|
var tsPattern = require('ts-pattern');
|
|
8
|
+
var uid = require('uid');
|
|
9
9
|
var shared = require('@eslint-react/shared');
|
|
10
10
|
var VAR = require('@eslint-react/var');
|
|
11
11
|
var types$1 = require('@eslint-react/types');
|
|
12
12
|
|
|
13
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
13
|
function _interopNamespace(e) {
|
|
16
14
|
if (e && e.__esModule) return e;
|
|
17
15
|
var n = Object.create(null);
|
|
@@ -32,7 +30,6 @@ function _interopNamespace(e) {
|
|
|
32
30
|
|
|
33
31
|
var AST9__namespace = /*#__PURE__*/_interopNamespace(AST9);
|
|
34
32
|
var JSX4__namespace = /*#__PURE__*/_interopNamespace(JSX4);
|
|
35
|
-
var ShortUniqueId__default = /*#__PURE__*/_interopDefault(ShortUniqueId);
|
|
36
33
|
var VAR__namespace = /*#__PURE__*/_interopNamespace(VAR);
|
|
37
34
|
|
|
38
35
|
// src/component/component-collector.ts
|
|
@@ -148,13 +145,6 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
148
145
|
)
|
|
149
146
|
);
|
|
150
147
|
}
|
|
151
|
-
function isFragmentElement(node, context) {
|
|
152
|
-
const settings = shared.decodeSettings(context.settings);
|
|
153
|
-
const { jsxPragma = "React", jsxPragmaFrag = "Fragment" } = settings;
|
|
154
|
-
const { name } = node.openingElement;
|
|
155
|
-
if (name.type === types.AST_NODE_TYPES.JSXIdentifier && name.name === jsxPragmaFrag) return true;
|
|
156
|
-
return name.type === types.AST_NODE_TYPES.JSXMemberExpression && name.object.type === types.AST_NODE_TYPES.JSXIdentifier && (name.object.name === jsxPragma || isInitializedFromReact(name.object.name, context.sourceCode.getScope(node), settings)) && name.property.name === jsxPragmaFrag;
|
|
157
|
-
}
|
|
158
148
|
|
|
159
149
|
// src/hook/hook-name.ts
|
|
160
150
|
var RE_HOOK_NAME = /^use[A-Z\d]/u;
|
|
@@ -249,7 +239,6 @@ var isUseTransitionCall = eff.F.flip(isReactHookCallWithName)("useTransition");
|
|
|
249
239
|
function isInsideReactHook(node) {
|
|
250
240
|
return eff.O.exists(AST9__namespace.traverseUpGuard(node, AST9__namespace.isFunction), isReactHook);
|
|
251
241
|
}
|
|
252
|
-
var uid = new ShortUniqueId__default.default({ length: 10 });
|
|
253
242
|
function useHookCollector() {
|
|
254
243
|
const hooks = /* @__PURE__ */ new Map();
|
|
255
244
|
const fStack = [];
|
|
@@ -257,7 +246,7 @@ function useHookCollector() {
|
|
|
257
246
|
const id = AST9__namespace.getFunctionIdentifier(node);
|
|
258
247
|
const name = eff.O.flatMapNullable(id, (id2) => id2.name);
|
|
259
248
|
if (eff.O.isSome(id) && eff.O.isSome(name) && isReactHookName(name.value)) {
|
|
260
|
-
const key = uid.
|
|
249
|
+
const key = uid.uid(10);
|
|
261
250
|
fStack.push([node, eff.O.some(key)]);
|
|
262
251
|
hooks.set(key, {
|
|
263
252
|
_: key,
|
|
@@ -370,7 +359,6 @@ function getComponentNameFromIdentifier(node) {
|
|
|
370
359
|
function isComponentName(name) {
|
|
371
360
|
return !!name && RE_COMPONENT_NAME.test(name);
|
|
372
361
|
}
|
|
373
|
-
var uid2 = new ShortUniqueId__default.default({ length: 10 });
|
|
374
362
|
function isClassComponent(node) {
|
|
375
363
|
if (!("superClass" in node && node.superClass)) return false;
|
|
376
364
|
const { superClass } = node;
|
|
@@ -419,7 +407,7 @@ function useComponentCollectorLegacy() {
|
|
|
419
407
|
const collect = (node) => {
|
|
420
408
|
if (!isClassComponent(node)) return;
|
|
421
409
|
const id = AST9__namespace.getClassIdentifier(node);
|
|
422
|
-
const key =
|
|
410
|
+
const key = uid.uid(10);
|
|
423
411
|
const flag = isPureComponent(node) ? ERClassComponentFlag.PureComponent : ERClassComponentFlag.None;
|
|
424
412
|
components.set(
|
|
425
413
|
key,
|
|
@@ -482,7 +470,6 @@ function hasNoneOrValidComponentName(node, context) {
|
|
|
482
470
|
}
|
|
483
471
|
|
|
484
472
|
// src/component/component-collector.ts
|
|
485
|
-
var uid3 = new ShortUniqueId__default.default({ length: 10 });
|
|
486
473
|
function hasValidHierarchy(node, context, hint) {
|
|
487
474
|
if (isChildrenOfCreateElement(node, context) || isFunctionOfRenderMethod(node)) {
|
|
488
475
|
return false;
|
|
@@ -528,7 +515,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
528
515
|
const components = /* @__PURE__ */ new Map();
|
|
529
516
|
const functionStack = [];
|
|
530
517
|
const getCurrentFunction = () => eff.O.fromNullable(functionStack.at(-1));
|
|
531
|
-
const onFunctionEnter = (node) => functionStack.push([
|
|
518
|
+
const onFunctionEnter = (node) => functionStack.push([uid.uid(10), node, false, []]);
|
|
532
519
|
const onFunctionExit = () => {
|
|
533
520
|
const [key, fn, isComponent] = functionStack.at(-1) ?? [];
|
|
534
521
|
if (!key || !fn || !isComponent) return functionStack.pop();
|
|
@@ -563,7 +550,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
563
550
|
const initPath = AST9__namespace.getFunctionInitPath(currentFn);
|
|
564
551
|
const id = getFunctionComponentIdentifier(currentFn, context);
|
|
565
552
|
const name = eff.O.flatMapNullable(id, getComponentNameFromIdentifier);
|
|
566
|
-
const key =
|
|
553
|
+
const key = uid.uid(10);
|
|
567
554
|
components.set(key, {
|
|
568
555
|
_: key,
|
|
569
556
|
id,
|
|
@@ -732,7 +719,6 @@ exports.isDeclaredInRenderPropLoose = isDeclaredInRenderPropLoose;
|
|
|
732
719
|
exports.isDirectValueOfRenderPropertyLoose = isDirectValueOfRenderPropertyLoose;
|
|
733
720
|
exports.isForwardRef = isForwardRef;
|
|
734
721
|
exports.isForwardRefCall = isForwardRefCall;
|
|
735
|
-
exports.isFragmentElement = isFragmentElement;
|
|
736
722
|
exports.isFromReact = isFromReact;
|
|
737
723
|
exports.isFromReactMember = isFromReactMember;
|
|
738
724
|
exports.isFunctionOfRenderMethod = isFunctionOfRenderMethod;
|
package/dist/index.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import * as AST9 from '@eslint-react/ast';
|
|
|
2
2
|
import { F, isString, O } from '@eslint-react/eff';
|
|
3
3
|
import * as JSX4 from '@eslint-react/jsx';
|
|
4
4
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
5
|
-
import ShortUniqueId from 'short-unique-id';
|
|
6
5
|
import { isMatching, P, match } from 'ts-pattern';
|
|
6
|
+
import { uid } from 'uid';
|
|
7
7
|
import { normalizeSettings, decodeSettings, unsafeReadSettings } from '@eslint-react/shared';
|
|
8
8
|
import * as VAR from '@eslint-react/var';
|
|
9
9
|
import { birecord } from '@eslint-react/types';
|
|
@@ -121,13 +121,6 @@ function isChildrenOfCreateElement(node, context) {
|
|
|
121
121
|
)
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
|
-
function isFragmentElement(node, context) {
|
|
125
|
-
const settings = decodeSettings(context.settings);
|
|
126
|
-
const { jsxPragma = "React", jsxPragmaFrag = "Fragment" } = settings;
|
|
127
|
-
const { name } = node.openingElement;
|
|
128
|
-
if (name.type === AST_NODE_TYPES.JSXIdentifier && name.name === jsxPragmaFrag) return true;
|
|
129
|
-
return name.type === AST_NODE_TYPES.JSXMemberExpression && name.object.type === AST_NODE_TYPES.JSXIdentifier && (name.object.name === jsxPragma || isInitializedFromReact(name.object.name, context.sourceCode.getScope(node), settings)) && name.property.name === jsxPragmaFrag;
|
|
130
|
-
}
|
|
131
124
|
|
|
132
125
|
// src/hook/hook-name.ts
|
|
133
126
|
var RE_HOOK_NAME = /^use[A-Z\d]/u;
|
|
@@ -222,7 +215,6 @@ var isUseTransitionCall = F.flip(isReactHookCallWithName)("useTransition");
|
|
|
222
215
|
function isInsideReactHook(node) {
|
|
223
216
|
return O.exists(AST9.traverseUpGuard(node, AST9.isFunction), isReactHook);
|
|
224
217
|
}
|
|
225
|
-
var uid = new ShortUniqueId({ length: 10 });
|
|
226
218
|
function useHookCollector() {
|
|
227
219
|
const hooks = /* @__PURE__ */ new Map();
|
|
228
220
|
const fStack = [];
|
|
@@ -230,7 +222,7 @@ function useHookCollector() {
|
|
|
230
222
|
const id = AST9.getFunctionIdentifier(node);
|
|
231
223
|
const name = O.flatMapNullable(id, (id2) => id2.name);
|
|
232
224
|
if (O.isSome(id) && O.isSome(name) && isReactHookName(name.value)) {
|
|
233
|
-
const key = uid
|
|
225
|
+
const key = uid(10);
|
|
234
226
|
fStack.push([node, O.some(key)]);
|
|
235
227
|
hooks.set(key, {
|
|
236
228
|
_: key,
|
|
@@ -343,7 +335,6 @@ function getComponentNameFromIdentifier(node) {
|
|
|
343
335
|
function isComponentName(name) {
|
|
344
336
|
return !!name && RE_COMPONENT_NAME.test(name);
|
|
345
337
|
}
|
|
346
|
-
var uid2 = new ShortUniqueId({ length: 10 });
|
|
347
338
|
function isClassComponent(node) {
|
|
348
339
|
if (!("superClass" in node && node.superClass)) return false;
|
|
349
340
|
const { superClass } = node;
|
|
@@ -392,7 +383,7 @@ function useComponentCollectorLegacy() {
|
|
|
392
383
|
const collect = (node) => {
|
|
393
384
|
if (!isClassComponent(node)) return;
|
|
394
385
|
const id = AST9.getClassIdentifier(node);
|
|
395
|
-
const key =
|
|
386
|
+
const key = uid(10);
|
|
396
387
|
const flag = isPureComponent(node) ? ERClassComponentFlag.PureComponent : ERClassComponentFlag.None;
|
|
397
388
|
components.set(
|
|
398
389
|
key,
|
|
@@ -455,7 +446,6 @@ function hasNoneOrValidComponentName(node, context) {
|
|
|
455
446
|
}
|
|
456
447
|
|
|
457
448
|
// src/component/component-collector.ts
|
|
458
|
-
var uid3 = new ShortUniqueId({ length: 10 });
|
|
459
449
|
function hasValidHierarchy(node, context, hint) {
|
|
460
450
|
if (isChildrenOfCreateElement(node, context) || isFunctionOfRenderMethod(node)) {
|
|
461
451
|
return false;
|
|
@@ -501,7 +491,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
501
491
|
const components = /* @__PURE__ */ new Map();
|
|
502
492
|
const functionStack = [];
|
|
503
493
|
const getCurrentFunction = () => O.fromNullable(functionStack.at(-1));
|
|
504
|
-
const onFunctionEnter = (node) => functionStack.push([
|
|
494
|
+
const onFunctionEnter = (node) => functionStack.push([uid(10), node, false, []]);
|
|
505
495
|
const onFunctionExit = () => {
|
|
506
496
|
const [key, fn, isComponent] = functionStack.at(-1) ?? [];
|
|
507
497
|
if (!key || !fn || !isComponent) return functionStack.pop();
|
|
@@ -536,7 +526,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
536
526
|
const initPath = AST9.getFunctionInitPath(currentFn);
|
|
537
527
|
const id = getFunctionComponentIdentifier(currentFn, context);
|
|
538
528
|
const name = O.flatMapNullable(id, getComponentNameFromIdentifier);
|
|
539
|
-
const key =
|
|
529
|
+
const key = uid(10);
|
|
540
530
|
components.set(key, {
|
|
541
531
|
_: key,
|
|
542
532
|
id,
|
|
@@ -662,4 +652,4 @@ function isThisSetState(node) {
|
|
|
662
652
|
return callee.type === AST_NODE_TYPES.MemberExpression && AST9.isThisExpression(callee.object) && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "setState";
|
|
663
653
|
}
|
|
664
654
|
|
|
665
|
-
export { DEFAULT_COMPONENT_HINT, ERClassComponentFlag, ERComponentHint, ERFunctionComponentFlag, ERPhaseRelevance, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall,
|
|
655
|
+
export { DEFAULT_COMPONENT_HINT, ERClassComponentFlag, ERComponentHint, ERFunctionComponentFlag, ERPhaseRelevance, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0-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": {
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
"./package.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
37
|
-
"@typescript-eslint/type-utils": "^8.
|
|
38
|
-
"@typescript-eslint/types": "^8.
|
|
39
|
-
"@typescript-eslint/utils": "^8.
|
|
40
|
-
"short-unique-id": "^5.2.0",
|
|
36
|
+
"@typescript-eslint/scope-manager": "^8.19.0",
|
|
37
|
+
"@typescript-eslint/type-utils": "^8.19.0",
|
|
38
|
+
"@typescript-eslint/types": "^8.19.0",
|
|
39
|
+
"@typescript-eslint/utils": "^8.19.0",
|
|
41
40
|
"ts-pattern": "^5.6.0",
|
|
42
|
-
"
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/
|
|
45
|
-
"@eslint-react/shared": "1.
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
41
|
+
"uid": "^2.0.2",
|
|
42
|
+
"@eslint-react/ast": "1.23.0-beta.1",
|
|
43
|
+
"@eslint-react/eff": "1.23.0-beta.1",
|
|
44
|
+
"@eslint-react/shared": "1.23.0-beta.1",
|
|
45
|
+
"@eslint-react/types": "1.23.0-beta.1",
|
|
46
|
+
"@eslint-react/var": "1.23.0-beta.1",
|
|
47
|
+
"@eslint-react/jsx": "1.23.0-beta.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"tsup": "^8.3.5",
|