@eslint-react/kit 4.0.2-beta.1 → 4.0.2-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 +27 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @eslint-react/kit
|
|
2
2
|
|
|
3
|
-
ESLint React's toolkit for building custom React
|
|
3
|
+
ESLint React's toolkit for building custom React rules with JavasSript functions right inside your `eslint.config.ts`.
|
|
4
4
|
|
|
5
5
|
## Index
|
|
6
6
|
|
|
@@ -123,7 +123,7 @@ function forbidElements({ forbidden }: ForbidElementsOptions): RuleDefinition {
|
|
|
123
123
|
```ts
|
|
124
124
|
interface Builder {
|
|
125
125
|
use<F extends (...args: any[]) => RuleDefinition>(factory: F, ...args: Parameters<F>): Builder;
|
|
126
|
-
getConfig(
|
|
126
|
+
getConfig(options?: { files?: string[] }): Linter.Config;
|
|
127
127
|
getPlugin(): ESLint.Plugin;
|
|
128
128
|
}
|
|
129
129
|
```
|
|
@@ -258,11 +258,33 @@ Factory functions (context pre-bound):
|
|
|
258
258
|
|
|
259
259
|
Pre-built identifier predicates (context pre-bound):
|
|
260
260
|
|
|
261
|
-
`captureOwnerStack
|
|
261
|
+
- `captureOwnerStack`
|
|
262
|
+
- `childrenCount`
|
|
263
|
+
- `childrenForEach`
|
|
264
|
+
- `childrenMap`
|
|
265
|
+
- `childrenOnly`
|
|
266
|
+
- `childrenToArray`
|
|
267
|
+
- `cloneElement`
|
|
268
|
+
- `createContext`
|
|
269
|
+
- `createElement`
|
|
270
|
+
- `forwardRef`
|
|
271
|
+
- `memo`
|
|
272
|
+
- `lazy`
|
|
262
273
|
|
|
263
274
|
Pre-built call predicates (context pre-bound):
|
|
264
275
|
|
|
265
|
-
`captureOwnerStackCall
|
|
276
|
+
- `captureOwnerStackCall`
|
|
277
|
+
- `childrenCountCall`
|
|
278
|
+
- `childrenForEachCall`
|
|
279
|
+
- `childrenMapCall`
|
|
280
|
+
- `childrenOnlyCall`
|
|
281
|
+
- `childrenToArrayCall`
|
|
282
|
+
- `cloneElementCall`
|
|
283
|
+
- `createContextCall`
|
|
284
|
+
- `createElementCall`
|
|
285
|
+
- `forwardRefCall`
|
|
286
|
+
- `memoCall`
|
|
287
|
+
- `lazyCall`
|
|
266
288
|
|
|
267
289
|
All React API predicates and factories have `context` pre-bound — no need to pass the rule context manually:
|
|
268
290
|
|
|
@@ -569,8 +591,8 @@ export default [
|
|
|
569
591
|
},
|
|
570
592
|
rules: {
|
|
571
593
|
// Set individual severities
|
|
572
|
-
"react/version": "error",
|
|
573
594
|
"react/no-forward-ref": "error",
|
|
595
|
+
"react/version": "error",
|
|
574
596
|
},
|
|
575
597
|
},
|
|
576
598
|
];
|
package/dist/index.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ interface RuleToolkit {
|
|
|
101
101
|
}
|
|
102
102
|
type RuleDefinition = (context: RuleContext, toolkit: RuleToolkit) => RuleListener;
|
|
103
103
|
interface Builder {
|
|
104
|
-
getConfig(
|
|
104
|
+
getConfig(options?: {
|
|
105
105
|
files?: string[];
|
|
106
106
|
}): Linter.Config;
|
|
107
107
|
getPlugin(): ESLint.Plugin;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { kebabCase } from "string-ts";
|
|
|
4
4
|
|
|
5
5
|
//#region package.json
|
|
6
6
|
var name = "@eslint-react/kit";
|
|
7
|
-
var version = "4.0.2-beta.
|
|
7
|
+
var version = "4.0.2-beta.3";
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/index.ts
|
|
@@ -106,7 +106,7 @@ function build() {
|
|
|
106
106
|
const idGen = new IdGenerator();
|
|
107
107
|
const rules = {};
|
|
108
108
|
const builder = {
|
|
109
|
-
getConfig({ files = ["**/*.ts
|
|
109
|
+
getConfig({ files = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,mts,tsx,mtsx}"] } = {}) {
|
|
110
110
|
return {
|
|
111
111
|
files,
|
|
112
112
|
plugins: { [name]: builder.getPlugin() },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "4.0.2-beta.
|
|
4
|
-
"description": "ESLint React's utility module for building custom rules.",
|
|
3
|
+
"version": "4.0.2-beta.3",
|
|
4
|
+
"description": "ESLint React's utility module for building custom React rules with JavasSript functions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"eslint",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@typescript-eslint/utils": "^8.57.2",
|
|
40
40
|
"string-ts": "^2.3.1",
|
|
41
|
-
"@eslint-react/
|
|
42
|
-
"@eslint-react/shared": "4.0.2-beta.
|
|
43
|
-
"@eslint-react/
|
|
41
|
+
"@eslint-react/core": "4.0.2-beta.3",
|
|
42
|
+
"@eslint-react/shared": "4.0.2-beta.3",
|
|
43
|
+
"@eslint-react/ast": "4.0.2-beta.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"eslint": "^10.1.0",
|
|
47
|
-
"tsdown": "^0.21.
|
|
47
|
+
"tsdown": "^0.21.7",
|
|
48
48
|
"@local/configs": "0.0.0",
|
|
49
49
|
"@local/eff": "3.0.0-beta.72"
|
|
50
50
|
},
|