@eslint-react/kit 5.2.4-beta.1 → 5.2.4-beta.2
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.ts +24 -3
- package/dist/index.js +34 -2
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as core from "@eslint-react/core";
|
|
2
2
|
import { ESLintReactSettingsNormalized } from "@eslint-react/shared";
|
|
3
|
-
import {
|
|
4
|
-
import { TSESTreeFunction } from "@eslint-react/ast";
|
|
3
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
5
4
|
import { SyntaxKind } from "typescript";
|
|
6
|
-
import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
|
|
5
|
+
import { RuleContext, RuleFix, RuleFixer, RuleListener, RuleListener as RuleListener$1 } from "@typescript-eslint/utils/ts-eslint";
|
|
7
6
|
import { ESLint, Linter } from "eslint";
|
|
8
7
|
|
|
9
8
|
//#region ../../node_modules/.pnpm/@typescript-eslint+types@8.58.2/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts
|
|
@@ -2332,6 +2331,28 @@ declare module './generated/ast-spec' {
|
|
|
2332
2331
|
}
|
|
2333
2332
|
}
|
|
2334
2333
|
//#endregion
|
|
2334
|
+
//#region ../ast/dist/index.d.ts
|
|
2335
|
+
//#region src/types.d.ts
|
|
2336
|
+
type TSESTreeFunction = ArrowFunctionExpression | FunctionDeclaration | FunctionExpression;
|
|
2337
|
+
//#endregion
|
|
2338
|
+
//#region ../eslint/dist/index.d.ts
|
|
2339
|
+
/**
|
|
2340
|
+
* Merges multiple visitor objects into a single visitor object.
|
|
2341
|
+
*
|
|
2342
|
+
* @param base Base visitor object (target of merge)
|
|
2343
|
+
* @param rest Additional visitor objects to merge (one or more)
|
|
2344
|
+
* @returns Merged visitor object
|
|
2345
|
+
*
|
|
2346
|
+
* @example
|
|
2347
|
+
* ```typescript
|
|
2348
|
+
* const visitor1 = { Identifier: () => console.log(1) };
|
|
2349
|
+
* const visitor2 = { Identifier: () => console.log(2) };
|
|
2350
|
+
* const merged = merge(visitor1, visitor2);
|
|
2351
|
+
* // When encountering Identifier nodes, outputs 1 then 2
|
|
2352
|
+
* ```
|
|
2353
|
+
*/
|
|
2354
|
+
declare function merge(base: RuleListener$1, ...rest: RuleListener$1[]): RuleListener$1; //#endregion
|
|
2355
|
+
//#endregion
|
|
2335
2356
|
//#region src/index.d.ts
|
|
2336
2357
|
interface Collector<T> {
|
|
2337
2358
|
query: {
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,43 @@ import * as core from "@eslint-react/core";
|
|
|
2
2
|
import { getSettingsFromContext } from "@eslint-react/shared";
|
|
3
3
|
import { randomBytes } from "node:crypto";
|
|
4
4
|
import { kebabCase } from "string-ts";
|
|
5
|
-
import {
|
|
5
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
6
6
|
|
|
7
7
|
//#region package.json
|
|
8
8
|
var name = "@eslint-react/kit";
|
|
9
|
-
var version = "5.2.4-beta.
|
|
9
|
+
var version = "5.2.4-beta.2";
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region ../eslint/dist/index.js
|
|
13
|
+
function getDocsUrl(ruleName) {
|
|
14
|
+
return `https://eslint-react.xyz/docs/rules/${ruleName}`;
|
|
15
|
+
}
|
|
16
|
+
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
17
|
+
/**
|
|
18
|
+
* Merges multiple visitor objects into a single visitor object.
|
|
19
|
+
*
|
|
20
|
+
* @param base Base visitor object (target of merge)
|
|
21
|
+
* @param rest Additional visitor objects to merge (one or more)
|
|
22
|
+
* @returns Merged visitor object
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const visitor1 = { Identifier: () => console.log(1) };
|
|
27
|
+
* const visitor2 = { Identifier: () => console.log(2) };
|
|
28
|
+
* const merged = merge(visitor1, visitor2);
|
|
29
|
+
* // When encountering Identifier nodes, outputs 1 then 2
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function merge(base, ...rest) {
|
|
33
|
+
for (const r of rest) for (const key in r) {
|
|
34
|
+
const existing = base[key];
|
|
35
|
+
base[key] = existing ? (...args) => {
|
|
36
|
+
existing(...args);
|
|
37
|
+
r[key]?.(...args);
|
|
38
|
+
} : r[key];
|
|
39
|
+
}
|
|
40
|
+
return base;
|
|
41
|
+
}
|
|
10
42
|
|
|
11
43
|
//#endregion
|
|
12
44
|
//#region src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "5.2.4-beta.
|
|
3
|
+
"version": "5.2.4-beta.2",
|
|
4
4
|
"description": "ESLint React's utility module for building custom React rules with JavaScript functions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@typescript-eslint/utils": "^8.58.2",
|
|
40
40
|
"string-ts": "^2.3.1",
|
|
41
|
-
"@eslint-react/
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/shared": "5.2.4-beta.1",
|
|
44
|
-
"@eslint-react/eslint": "5.2.4-beta.1"
|
|
41
|
+
"@eslint-react/core": "5.2.4-beta.2",
|
|
42
|
+
"@eslint-react/shared": "5.2.4-beta.2"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"eslint": "^10.2.0",
|
|
48
|
-
"tsdown": "^0.21.
|
|
49
|
-
"@
|
|
50
|
-
"@local/eff": "3.0.0-beta.72"
|
|
46
|
+
"tsdown": "^0.21.9",
|
|
47
|
+
"@eslint-react/ast": "5.2.4-beta.2",
|
|
48
|
+
"@local/eff": "3.0.0-beta.72",
|
|
49
|
+
"@eslint-react/eslint": "5.2.4-beta.2",
|
|
50
|
+
"@local/configs": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"eslint": "^10.2.0",
|