@eslint-react/kit 4.0.0-beta.2 → 4.0.0-beta.3
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/README.md +6 -6
- package/dist/index.d.ts +59 -62
- package/dist/index.js +64 -73
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ ESLint React's toolkit for building custom React lint rules right inside your `e
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npm install --save-dev @eslint-react/kit
|
|
28
|
+
npm install --save-dev @eslint-react/kit@beta
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
|
@@ -294,7 +294,7 @@ defineReactConfig({
|
|
|
294
294
|
|
|
295
295
|
### Simple: Ban `forwardRef`
|
|
296
296
|
|
|
297
|
-
This is a simplified kit reimplementation of the built-in [`react-x/no-forwardRef`](https://eslint-react.xyz/docs/rules/no-
|
|
297
|
+
This is a simplified kit reimplementation of the built-in [`react-x/no-forwardRef`](https://beta.eslint-react.xyz/docs/rules/no-forward-ref) rule.
|
|
298
298
|
|
|
299
299
|
```ts
|
|
300
300
|
defineReactConfig({
|
|
@@ -311,7 +311,7 @@ defineReactConfig({
|
|
|
311
311
|
|
|
312
312
|
### Component: Destructure component props
|
|
313
313
|
|
|
314
|
-
This is a simplified kit reimplementation of the built-in [`react-x/prefer-destructuring-assignment`](https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment) rule.
|
|
314
|
+
This is a simplified kit reimplementation of the built-in [`react-x/prefer-destructuring-assignment`](https://beta.eslint-react.xyz/docs/rules/prefer-destructuring-assignment) rule.
|
|
315
315
|
|
|
316
316
|
```ts
|
|
317
317
|
defineReactConfig({
|
|
@@ -345,7 +345,7 @@ defineReactConfig({
|
|
|
345
345
|
|
|
346
346
|
### Hooks: Warn on custom hooks that don't call other hooks
|
|
347
347
|
|
|
348
|
-
This is a simplified kit reimplementation of the built-in [`react-x/no-unnecessary-use-prefix`](https://eslint-react.xyz/docs/rules/no-unnecessary-use-prefix) rule.
|
|
348
|
+
This is a simplified kit reimplementation of the built-in [`react-x/no-unnecessary-use-prefix`](https://beta.eslint-react.xyz/docs/rules/no-unnecessary-use-prefix) rule.
|
|
349
349
|
|
|
350
350
|
```ts
|
|
351
351
|
defineReactConfig({
|
|
@@ -372,7 +372,7 @@ defineReactConfig({
|
|
|
372
372
|
### Multiple Collectors: No component/hook factories
|
|
373
373
|
|
|
374
374
|
Disallow defining components or hooks inside other functions (factory pattern).
|
|
375
|
-
This is a simplified kit reimplementation of the built-in [`react-x/component-hook-factories`](https://eslint-react.xyz/docs/rules/component-hook-factories) rule.
|
|
375
|
+
This is a simplified kit reimplementation of the built-in [`react-x/component-hook-factories`](https://beta.eslint-react.xyz/docs/rules/component-hook-factories) rule.
|
|
376
376
|
|
|
377
377
|
```ts
|
|
378
378
|
defineReactConfig({
|
|
@@ -415,4 +415,4 @@ function isFunction({ type }: TSESTree.Node) {
|
|
|
415
415
|
|
|
416
416
|
## More Examples
|
|
417
417
|
|
|
418
|
-
Please check the [Rule Recipes](https://eslint-react.xyz/docs/configuration/configure-custom-rules#rule-recipes) in the documentation site.
|
|
418
|
+
Please check the [Rule Recipes](https://beta.eslint-react.xyz/docs/configuration/configure-custom-rules#rule-recipes) in the documentation site.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as core from "@eslint-react/core";
|
|
2
|
-
import { ESLintReactSettingsNormalized } from "@eslint-react/shared";
|
|
2
|
+
import { ESLintReactSettingsNormalized, RuleFix, RuleFixer, RuleListener, defineRuleListener as merge } from "@eslint-react/shared";
|
|
3
3
|
import { TSESTreeFunction } from "@eslint-react/ast";
|
|
4
4
|
import { TSESTree } from "@typescript-eslint/utils";
|
|
5
|
-
import { RuleContext
|
|
5
|
+
import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
|
|
6
6
|
import { Linter } from "eslint";
|
|
7
7
|
|
|
8
8
|
//#region src/index.d.ts
|
|
@@ -17,33 +17,76 @@ interface CollectorWithContext<T> extends Collector<T> {
|
|
|
17
17
|
all(program: TSESTree.Program): T[];
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
declare function hooks(ctx: RuleContext<string, unknown[]>): CollectorWithContext<core.HookSemanticNode>;
|
|
20
|
+
interface RuleDefinition {
|
|
21
|
+
name: string;
|
|
22
|
+
make(ctx: RuleContext, kit: RuleToolkit): RuleListener;
|
|
23
|
+
}
|
|
25
24
|
interface RuleToolkit {
|
|
25
|
+
collect: {
|
|
26
|
+
components(ctx: RuleContext, options?: {
|
|
27
|
+
collectDisplayName?: boolean;
|
|
28
|
+
hint?: bigint;
|
|
29
|
+
}): CollectorWithContext<core.FunctionComponentSemanticNode>;
|
|
30
|
+
hooks(ctx: RuleContext): CollectorWithContext<core.HookSemanticNode>;
|
|
31
|
+
};
|
|
32
|
+
flag: {
|
|
33
|
+
component: typeof core.ComponentFlag;
|
|
34
|
+
};
|
|
35
|
+
hint: {
|
|
36
|
+
component: typeof core.ComponentDetectionHint & {
|
|
37
|
+
Default: bigint;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
26
40
|
is: {
|
|
41
|
+
captureOwnerStack: (node: null | TSESTree.Node) => boolean;
|
|
42
|
+
captureOwnerStackCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
43
|
+
childrenCount: (node: null | TSESTree.Node) => boolean;
|
|
44
|
+
childrenCountCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
45
|
+
childrenForEach: (node: null | TSESTree.Node) => boolean;
|
|
46
|
+
childrenForEachCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
47
|
+
childrenMap: (node: null | TSESTree.Node) => boolean;
|
|
48
|
+
childrenMapCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
49
|
+
childrenOnly: (node: null | TSESTree.Node) => boolean;
|
|
50
|
+
childrenOnlyCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
51
|
+
childrenToArray: (node: null | TSESTree.Node) => boolean;
|
|
52
|
+
childrenToArrayCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
53
|
+
cloneElement: (node: null | TSESTree.Node) => boolean;
|
|
54
|
+
cloneElementCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
27
55
|
componentDefinition: (node: TSESTreeFunction, hint: bigint) => boolean;
|
|
28
56
|
componentName: typeof core.isComponentName;
|
|
29
57
|
componentNameLoose: typeof core.isComponentNameLoose;
|
|
30
58
|
componentWrapperCall: (node: TSESTree.Node) => boolean;
|
|
31
|
-
componentWrapperCallLoose: (node: TSESTree.Node) => boolean;
|
|
32
59
|
componentWrapperCallback: (node: TSESTree.Node) => boolean;
|
|
60
|
+
componentWrapperCallLoose: (node: TSESTree.Node) => boolean;
|
|
61
|
+
createContext: (node: null | TSESTree.Node) => boolean;
|
|
62
|
+
createContextCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
63
|
+
createElement: (node: null | TSESTree.Node) => boolean;
|
|
64
|
+
createElementCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
65
|
+
createRef: (node: null | TSESTree.Node) => boolean;
|
|
66
|
+
createRefCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
67
|
+
forwardRef: (node: null | TSESTree.Node) => boolean;
|
|
68
|
+
forwardRefCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
33
69
|
hook: typeof core.isHook;
|
|
34
70
|
hookCall: typeof core.isHookCall;
|
|
35
71
|
hookName: typeof core.isHookName;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
initializedFromReact: typeof core.isInitializedFromReact;
|
|
73
|
+
initializedFromReactNative: typeof core.isInitializedFromReactNative;
|
|
74
|
+
lazy: (node: null | TSESTree.Node) => boolean;
|
|
75
|
+
lazyCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
76
|
+
memo: (node: null | TSESTree.Node) => boolean;
|
|
77
|
+
memoCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
78
|
+
reactAPI: (api: string) => (node: null | TSESTree.Node) => boolean;
|
|
79
|
+
reactAPICall: (api: string) => (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
41
80
|
useActionStateCall: typeof core.isUseActionStateCall;
|
|
81
|
+
useCall: typeof core.isUseCall;
|
|
42
82
|
useCallbackCall: typeof core.isUseCallbackCall;
|
|
43
83
|
useContextCall: typeof core.isUseContextCall;
|
|
44
84
|
useDebugValueCall: typeof core.isUseDebugValueCall;
|
|
45
85
|
useDeferredValueCall: typeof core.isUseDeferredValueCall;
|
|
46
86
|
useEffectCall: typeof core.isUseEffectCall;
|
|
87
|
+
useEffectCleanupCallback: typeof core.isUseEffectCleanupCallback;
|
|
88
|
+
useEffectLikeCall: typeof core.isUseEffectLikeCall;
|
|
89
|
+
useEffectSetupCallback: typeof core.isUseEffectSetupCallback;
|
|
47
90
|
useFormStatusCall: typeof core.isUseFormStatusCall;
|
|
48
91
|
useIdCall: typeof core.isUseIdCall;
|
|
49
92
|
useImperativeHandleCall: typeof core.isUseImperativeHandleCall;
|
|
@@ -54,61 +97,15 @@ interface RuleToolkit {
|
|
|
54
97
|
useReducerCall: typeof core.isUseReducerCall;
|
|
55
98
|
useRefCall: typeof core.isUseRefCall;
|
|
56
99
|
useStateCall: typeof core.isUseStateCall;
|
|
100
|
+
useStateLikeCall: typeof core.isUseStateLikeCall;
|
|
57
101
|
useSyncExternalStoreCall: typeof core.isUseSyncExternalStoreCall;
|
|
58
102
|
useTransitionCall: typeof core.isUseTransitionCall;
|
|
59
|
-
reactAPI: (api: string) => (node: null | TSESTree.Node) => boolean;
|
|
60
|
-
reactAPICall: (api: string) => (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
61
|
-
captureOwnerStack: (node: null | TSESTree.Node) => boolean;
|
|
62
|
-
childrenCount: (node: null | TSESTree.Node) => boolean;
|
|
63
|
-
childrenForEach: (node: null | TSESTree.Node) => boolean;
|
|
64
|
-
childrenMap: (node: null | TSESTree.Node) => boolean;
|
|
65
|
-
childrenOnly: (node: null | TSESTree.Node) => boolean;
|
|
66
|
-
childrenToArray: (node: null | TSESTree.Node) => boolean;
|
|
67
|
-
cloneElement: (node: null | TSESTree.Node) => boolean;
|
|
68
|
-
createContext: (node: null | TSESTree.Node) => boolean;
|
|
69
|
-
createElement: (node: null | TSESTree.Node) => boolean;
|
|
70
|
-
createRef: (node: null | TSESTree.Node) => boolean;
|
|
71
|
-
forwardRef: (node: null | TSESTree.Node) => boolean;
|
|
72
|
-
memo: (node: null | TSESTree.Node) => boolean;
|
|
73
|
-
lazy: (node: null | TSESTree.Node) => boolean;
|
|
74
|
-
captureOwnerStackCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
75
|
-
childrenCountCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
76
|
-
childrenForEachCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
77
|
-
childrenMapCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
78
|
-
childrenOnlyCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
79
|
-
childrenToArrayCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
80
|
-
cloneElementCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
81
|
-
createContextCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
82
|
-
createElementCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
83
|
-
createRefCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
84
|
-
forwardRefCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
85
|
-
memoCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
86
|
-
lazyCall: (node: null | TSESTree.Node) => node is TSESTree.CallExpression;
|
|
87
|
-
initializedFromReact: typeof core.isInitializedFromReact;
|
|
88
|
-
initializedFromReactNative: typeof core.isInitializedFromReactNative;
|
|
89
|
-
};
|
|
90
|
-
hint: {
|
|
91
|
-
component: typeof core.ComponentDetectionHint & {
|
|
92
|
-
Default: bigint;
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
flag: {
|
|
96
|
-
component: typeof core.ComponentFlag;
|
|
97
|
-
};
|
|
98
|
-
collect: {
|
|
99
|
-
components: typeof components;
|
|
100
|
-
hooks: typeof hooks;
|
|
101
103
|
};
|
|
102
104
|
settings: ESLintReactSettingsNormalized;
|
|
103
105
|
}
|
|
104
|
-
interface RuleDefinition {
|
|
105
|
-
name: string;
|
|
106
|
-
make(ctx: RuleContext<string, unknown[]>, kit: RuleToolkit): RuleListener;
|
|
107
|
-
}
|
|
108
106
|
declare function defineConfig(...rules: RuleDefinition[]): Linter.Config;
|
|
109
|
-
declare function merge(...listeners: RuleListener[]): RuleListener;
|
|
110
107
|
declare module "@typescript-eslint/utils/ts-eslint" {
|
|
111
|
-
interface RuleContext<MessageIds extends string, Options extends readonly unknown[]> {
|
|
108
|
+
interface RuleContext<MessageIds extends string = string, Options extends readonly unknown[] = readonly unknown[]> {
|
|
112
109
|
report(descriptor: {
|
|
113
110
|
readonly data?: Readonly<Record<string, unknown>>;
|
|
114
111
|
readonly fix?: ((fixer: RuleFixer) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null) | null;
|
|
@@ -124,4 +121,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
123
|
//#endregion
|
|
127
|
-
export { Collector, CollectorWithContext, type
|
|
124
|
+
export { Collector, CollectorWithContext, RuleDefinition, type RuleFix, type RuleFixer, type RuleListener, defineConfig as default, defineConfig, merge };
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,89 @@
|
|
|
1
1
|
import * as core from "@eslint-react/core";
|
|
2
|
-
import { getSettingsFromContext } from "@eslint-react/shared";
|
|
2
|
+
import { defineRuleListener as merge, getSettingsFromContext } from "@eslint-react/shared";
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@eslint-react/kit";
|
|
6
|
-
var version = "4.0.0-beta.
|
|
6
|
+
var version = "4.0.0-beta.3";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/index.ts
|
|
10
|
-
function components(ctx, options) {
|
|
11
|
-
const { api, visitor } = core.getComponentCollector(ctx, options);
|
|
12
|
-
return {
|
|
13
|
-
query: { all: (program) => api.getAllComponents(program) },
|
|
14
|
-
visitor
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function hooks(ctx) {
|
|
18
|
-
const { api, visitor } = core.getHookCollector(ctx);
|
|
19
|
-
return {
|
|
20
|
-
query: { all: (program) => api.getAllHooks(program) },
|
|
21
|
-
visitor
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
10
|
function createKit(ctx) {
|
|
25
11
|
return {
|
|
12
|
+
collect: {
|
|
13
|
+
components(ctx, options) {
|
|
14
|
+
const { api, visitor } = core.getComponentCollector(ctx, options);
|
|
15
|
+
return {
|
|
16
|
+
query: { all(program) {
|
|
17
|
+
return api.getAllComponents(program);
|
|
18
|
+
} },
|
|
19
|
+
visitor
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
hooks(ctx) {
|
|
23
|
+
const { api, visitor } = core.getHookCollector(ctx);
|
|
24
|
+
return {
|
|
25
|
+
query: { all(program) {
|
|
26
|
+
return api.getAllHooks(program);
|
|
27
|
+
} },
|
|
28
|
+
visitor
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
flag: { component: core.ComponentFlag },
|
|
33
|
+
hint: { component: {
|
|
34
|
+
...core.ComponentDetectionHint,
|
|
35
|
+
Default: core.DEFAULT_COMPONENT_DETECTION_HINT
|
|
36
|
+
} },
|
|
26
37
|
is: {
|
|
38
|
+
captureOwnerStack: core.isCaptureOwnerStack(ctx),
|
|
39
|
+
captureOwnerStackCall: core.isCaptureOwnerStackCall(ctx),
|
|
40
|
+
childrenCount: core.isChildrenCount(ctx),
|
|
41
|
+
childrenCountCall: core.isChildrenCountCall(ctx),
|
|
42
|
+
childrenForEach: core.isChildrenForEach(ctx),
|
|
43
|
+
childrenForEachCall: core.isChildrenForEachCall(ctx),
|
|
44
|
+
childrenMap: core.isChildrenMap(ctx),
|
|
45
|
+
childrenMapCall: core.isChildrenMapCall(ctx),
|
|
46
|
+
childrenOnly: core.isChildrenOnly(ctx),
|
|
47
|
+
childrenOnlyCall: core.isChildrenOnlyCall(ctx),
|
|
48
|
+
childrenToArray: core.isChildrenToArray(ctx),
|
|
49
|
+
childrenToArrayCall: core.isChildrenToArrayCall(ctx),
|
|
50
|
+
cloneElement: core.isCloneElement(ctx),
|
|
51
|
+
cloneElementCall: core.isCloneElementCall(ctx),
|
|
27
52
|
componentDefinition: (node, hint) => core.isComponentDefinition(ctx, node, hint),
|
|
28
53
|
componentName: core.isComponentName,
|
|
29
54
|
componentNameLoose: core.isComponentNameLoose,
|
|
30
55
|
componentWrapperCall: (node) => core.isComponentWrapperCall(ctx, node),
|
|
31
|
-
componentWrapperCallLoose: (node) => core.isComponentWrapperCallLoose(ctx, node),
|
|
32
56
|
componentWrapperCallback: (node) => core.isComponentWrapperCallback(ctx, node),
|
|
57
|
+
componentWrapperCallLoose: (node) => core.isComponentWrapperCallLoose(ctx, node),
|
|
58
|
+
createContext: core.isCreateContext(ctx),
|
|
59
|
+
createContextCall: core.isCreateContextCall(ctx),
|
|
60
|
+
createElement: core.isCreateElement(ctx),
|
|
61
|
+
createElementCall: core.isCreateElementCall(ctx),
|
|
62
|
+
createRef: core.isCreateRef(ctx),
|
|
63
|
+
createRefCall: core.isCreateRefCall(ctx),
|
|
64
|
+
forwardRef: core.isForwardRef(ctx),
|
|
65
|
+
forwardRefCall: core.isForwardRefCall(ctx),
|
|
33
66
|
hook: core.isHook,
|
|
34
67
|
hookCall: core.isHookCall,
|
|
35
68
|
hookName: core.isHookName,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
69
|
+
initializedFromReact: core.isInitializedFromReact,
|
|
70
|
+
initializedFromReactNative: core.isInitializedFromReactNative,
|
|
71
|
+
lazy: core.isLazy(ctx),
|
|
72
|
+
lazyCall: core.isLazyCall(ctx),
|
|
73
|
+
memo: core.isMemo(ctx),
|
|
74
|
+
memoCall: core.isMemoCall(ctx),
|
|
75
|
+
reactAPI: (api) => core.isReactAPI(api)(ctx),
|
|
76
|
+
reactAPICall: (api) => core.isReactAPICall(api)(ctx),
|
|
41
77
|
useActionStateCall: core.isUseActionStateCall,
|
|
78
|
+
useCall: core.isUseCall,
|
|
42
79
|
useCallbackCall: core.isUseCallbackCall,
|
|
43
80
|
useContextCall: core.isUseContextCall,
|
|
44
81
|
useDebugValueCall: core.isUseDebugValueCall,
|
|
45
82
|
useDeferredValueCall: core.isUseDeferredValueCall,
|
|
46
83
|
useEffectCall: core.isUseEffectCall,
|
|
84
|
+
useEffectCleanupCallback: core.isUseEffectCleanupCallback,
|
|
85
|
+
useEffectLikeCall: core.isUseEffectLikeCall,
|
|
86
|
+
useEffectSetupCallback: core.isUseEffectSetupCallback,
|
|
47
87
|
useFormStatusCall: core.isUseFormStatusCall,
|
|
48
88
|
useIdCall: core.isUseIdCall,
|
|
49
89
|
useImperativeHandleCall: core.isUseImperativeHandleCall,
|
|
@@ -54,47 +94,9 @@ function createKit(ctx) {
|
|
|
54
94
|
useReducerCall: core.isUseReducerCall,
|
|
55
95
|
useRefCall: core.isUseRefCall,
|
|
56
96
|
useStateCall: core.isUseStateCall,
|
|
97
|
+
useStateLikeCall: core.isUseStateLikeCall,
|
|
57
98
|
useSyncExternalStoreCall: core.isUseSyncExternalStoreCall,
|
|
58
|
-
useTransitionCall: core.isUseTransitionCall
|
|
59
|
-
reactAPI: (api) => core.isReactAPI(api)(ctx),
|
|
60
|
-
reactAPICall: (api) => core.isReactAPICall(api)(ctx),
|
|
61
|
-
captureOwnerStack: core.isCaptureOwnerStack(ctx),
|
|
62
|
-
childrenCount: core.isChildrenCount(ctx),
|
|
63
|
-
childrenForEach: core.isChildrenForEach(ctx),
|
|
64
|
-
childrenMap: core.isChildrenMap(ctx),
|
|
65
|
-
childrenOnly: core.isChildrenOnly(ctx),
|
|
66
|
-
childrenToArray: core.isChildrenToArray(ctx),
|
|
67
|
-
cloneElement: core.isCloneElement(ctx),
|
|
68
|
-
createContext: core.isCreateContext(ctx),
|
|
69
|
-
createElement: core.isCreateElement(ctx),
|
|
70
|
-
createRef: core.isCreateRef(ctx),
|
|
71
|
-
forwardRef: core.isForwardRef(ctx),
|
|
72
|
-
memo: core.isMemo(ctx),
|
|
73
|
-
lazy: core.isLazy(ctx),
|
|
74
|
-
captureOwnerStackCall: core.isCaptureOwnerStackCall(ctx),
|
|
75
|
-
childrenCountCall: core.isChildrenCountCall(ctx),
|
|
76
|
-
childrenForEachCall: core.isChildrenForEachCall(ctx),
|
|
77
|
-
childrenMapCall: core.isChildrenMapCall(ctx),
|
|
78
|
-
childrenOnlyCall: core.isChildrenOnlyCall(ctx),
|
|
79
|
-
childrenToArrayCall: core.isChildrenToArrayCall(ctx),
|
|
80
|
-
cloneElementCall: core.isCloneElementCall(ctx),
|
|
81
|
-
createContextCall: core.isCreateContextCall(ctx),
|
|
82
|
-
createElementCall: core.isCreateElementCall(ctx),
|
|
83
|
-
createRefCall: core.isCreateRefCall(ctx),
|
|
84
|
-
forwardRefCall: core.isForwardRefCall(ctx),
|
|
85
|
-
memoCall: core.isMemoCall(ctx),
|
|
86
|
-
lazyCall: core.isLazyCall(ctx),
|
|
87
|
-
initializedFromReact: core.isInitializedFromReact,
|
|
88
|
-
initializedFromReactNative: core.isInitializedFromReactNative
|
|
89
|
-
},
|
|
90
|
-
hint: { component: {
|
|
91
|
-
...core.ComponentDetectionHint,
|
|
92
|
-
Default: core.DEFAULT_COMPONENT_DETECTION_HINT
|
|
93
|
-
} },
|
|
94
|
-
flag: { component: core.ComponentFlag },
|
|
95
|
-
collect: {
|
|
96
|
-
components,
|
|
97
|
-
hooks
|
|
99
|
+
useTransitionCall: core.isUseTransitionCall
|
|
98
100
|
},
|
|
99
101
|
settings: getSettingsFromContext(ctx)
|
|
100
102
|
};
|
|
@@ -126,17 +128,6 @@ function defineConfig(...rules) {
|
|
|
126
128
|
}, {})
|
|
127
129
|
};
|
|
128
130
|
}
|
|
129
|
-
function merge(...listeners) {
|
|
130
|
-
const [base = {}, ...rest] = listeners;
|
|
131
|
-
for (const r of rest) for (const key in r) {
|
|
132
|
-
const existing = base[key];
|
|
133
|
-
base[key] = existing ? (...args) => {
|
|
134
|
-
existing(...args);
|
|
135
|
-
r[key]?.(...args);
|
|
136
|
-
} : r[key];
|
|
137
|
-
}
|
|
138
|
-
return base;
|
|
139
|
-
}
|
|
140
131
|
|
|
141
132
|
//#endregion
|
|
142
133
|
export { defineConfig as default, defineConfig, merge };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.3",
|
|
4
4
|
"description": "ESLint React's utility module for building custom rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@typescript-eslint/utils": "^8.57.2",
|
|
40
|
-
"@eslint-react/
|
|
41
|
-
"@eslint-react/shared": "4.0.0-beta.
|
|
42
|
-
"@eslint-react/
|
|
40
|
+
"@eslint-react/core": "4.0.0-beta.3",
|
|
41
|
+
"@eslint-react/shared": "4.0.0-beta.3",
|
|
42
|
+
"@eslint-react/ast": "4.0.0-beta.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"eslint": "^10.1.0",
|
|
46
|
-
"tsdown": "^0.21.
|
|
46
|
+
"tsdown": "^0.21.6",
|
|
47
47
|
"@local/configs": "0.0.0",
|
|
48
48
|
"@local/eff": "3.0.0-beta.72"
|
|
49
49
|
},
|