@eslint-react/kit 1.48.4 → 1.48.5-next.0
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 +18 -4
- package/dist/index.d.ts +18 -4
- package/dist/index.js +11 -3
- package/dist/index.mjs +9 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as typescript from 'typescript';
|
|
1
2
|
import * as tseslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
3
|
import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
|
|
3
|
-
import { CompilerOptions, JsxEmit } from 'typescript';
|
|
4
4
|
import * as z from '@zod/mini';
|
|
5
5
|
import { _ } from '@eslint-react/eff';
|
|
6
6
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
@@ -32,7 +32,20 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
32
32
|
*/
|
|
33
33
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
declare const JsxEmit: {
|
|
36
|
+
readonly None: 0;
|
|
37
|
+
readonly Preserve: 1;
|
|
38
|
+
readonly React: 2;
|
|
39
|
+
readonly ReactNative: 3;
|
|
40
|
+
readonly ReactJSX: 4;
|
|
41
|
+
readonly ReactJSXDev: 5;
|
|
42
|
+
};
|
|
43
|
+
interface JsxConfig {
|
|
44
|
+
jsx?: number;
|
|
45
|
+
jsxFactory?: string;
|
|
46
|
+
jsxFragmentFactory?: string;
|
|
47
|
+
jsxImportSource?: string;
|
|
48
|
+
}
|
|
36
49
|
/**
|
|
37
50
|
* Create a JsxConfig object
|
|
38
51
|
* @returns JsxConfig
|
|
@@ -44,7 +57,7 @@ declare function make$2(): JsxConfig;
|
|
|
44
57
|
* @returns JsxConfig
|
|
45
58
|
*/
|
|
46
59
|
declare function getFromContext$1(context: RuleContext): {
|
|
47
|
-
jsx: JsxEmit;
|
|
60
|
+
jsx: 4 | typescript.JsxEmit;
|
|
48
61
|
jsxFactory: string;
|
|
49
62
|
jsxFragmentFactory: string;
|
|
50
63
|
jsxImportSource: string;
|
|
@@ -58,9 +71,10 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
58
71
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
59
72
|
|
|
60
73
|
type index$1_JsxConfig = JsxConfig;
|
|
74
|
+
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
61
75
|
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
62
76
|
declare namespace index$1 {
|
|
63
|
-
export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
77
|
+
export { type index$1_JsxConfig as JsxConfig, index$1_JsxEmit as JsxEmit, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as typescript from 'typescript';
|
|
1
2
|
import * as tseslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
3
|
import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
|
|
3
|
-
import { CompilerOptions, JsxEmit } from 'typescript';
|
|
4
4
|
import * as z from '@zod/mini';
|
|
5
5
|
import { _ } from '@eslint-react/eff';
|
|
6
6
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
@@ -32,7 +32,20 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
32
32
|
*/
|
|
33
33
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
declare const JsxEmit: {
|
|
36
|
+
readonly None: 0;
|
|
37
|
+
readonly Preserve: 1;
|
|
38
|
+
readonly React: 2;
|
|
39
|
+
readonly ReactNative: 3;
|
|
40
|
+
readonly ReactJSX: 4;
|
|
41
|
+
readonly ReactJSXDev: 5;
|
|
42
|
+
};
|
|
43
|
+
interface JsxConfig {
|
|
44
|
+
jsx?: number;
|
|
45
|
+
jsxFactory?: string;
|
|
46
|
+
jsxFragmentFactory?: string;
|
|
47
|
+
jsxImportSource?: string;
|
|
48
|
+
}
|
|
36
49
|
/**
|
|
37
50
|
* Create a JsxConfig object
|
|
38
51
|
* @returns JsxConfig
|
|
@@ -44,7 +57,7 @@ declare function make$2(): JsxConfig;
|
|
|
44
57
|
* @returns JsxConfig
|
|
45
58
|
*/
|
|
46
59
|
declare function getFromContext$1(context: RuleContext): {
|
|
47
|
-
jsx: JsxEmit;
|
|
60
|
+
jsx: 4 | typescript.JsxEmit;
|
|
48
61
|
jsxFactory: string;
|
|
49
62
|
jsxFragmentFactory: string;
|
|
50
63
|
jsxImportSource: string;
|
|
@@ -58,9 +71,10 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
58
71
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
59
72
|
|
|
60
73
|
type index$1_JsxConfig = JsxConfig;
|
|
74
|
+
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
61
75
|
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
62
76
|
declare namespace index$1 {
|
|
63
|
-
export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
77
|
+
export { type index$1_JsxConfig as JsxConfig, index$1_JsxEmit as JsxEmit, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var eff = require('@eslint-react/eff');
|
|
4
|
-
var typescript = require('typescript');
|
|
5
4
|
var z = require('@zod/mini');
|
|
6
5
|
|
|
7
6
|
function _interopNamespace(e) {
|
|
@@ -33,6 +32,7 @@ var __export = (target, all) => {
|
|
|
33
32
|
// src/JsxConfig/index.ts
|
|
34
33
|
var JsxConfig_exports = {};
|
|
35
34
|
__export(JsxConfig_exports, {
|
|
35
|
+
JsxEmit: () => JsxEmit,
|
|
36
36
|
getFromAnnotation: () => getFromAnnotation,
|
|
37
37
|
getFromContext: () => getFromContext,
|
|
38
38
|
make: () => make
|
|
@@ -90,13 +90,21 @@ function isRegExp(string) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// src/JsxConfig/JsxConfig.ts
|
|
93
|
+
var JsxEmit = {
|
|
94
|
+
None: 0,
|
|
95
|
+
Preserve: 1,
|
|
96
|
+
React: 2,
|
|
97
|
+
ReactNative: 3,
|
|
98
|
+
ReactJSX: 4,
|
|
99
|
+
ReactJSXDev: 5
|
|
100
|
+
};
|
|
93
101
|
function make() {
|
|
94
102
|
return {};
|
|
95
103
|
}
|
|
96
104
|
function getFromContext(context) {
|
|
97
105
|
const options = context.sourceCode.parserServices?.program?.getCompilerOptions() ?? {};
|
|
98
106
|
return {
|
|
99
|
-
jsx: options.jsx ??
|
|
107
|
+
jsx: options.jsx ?? JsxEmit.ReactJSX,
|
|
100
108
|
jsxFactory: options.jsxFactory ?? "React.createElement",
|
|
101
109
|
jsxFragmentFactory: options.jsxFragmentFactory ?? "React.Fragment",
|
|
102
110
|
jsxImportSource: options.jsxImportSource ?? "react",
|
|
@@ -121,7 +129,7 @@ function getFromAnnotation(context) {
|
|
|
121
129
|
}
|
|
122
130
|
if (jsx != null) options.jsxFactory = jsx;
|
|
123
131
|
if (jsxFrag != null) options.jsxFragmentFactory = jsxFrag;
|
|
124
|
-
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ?
|
|
132
|
+
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? JsxEmit.React : JsxEmit.ReactJSX;
|
|
125
133
|
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
126
134
|
return options;
|
|
127
135
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { dual, getOrElseUpdate } from '@eslint-react/eff';
|
|
2
|
-
import { JsxEmit } from 'typescript';
|
|
3
2
|
import * as z from '@zod/mini';
|
|
4
3
|
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
@@ -11,6 +10,7 @@ var __export = (target, all) => {
|
|
|
11
10
|
// src/JsxConfig/index.ts
|
|
12
11
|
var JsxConfig_exports = {};
|
|
13
12
|
__export(JsxConfig_exports, {
|
|
13
|
+
JsxEmit: () => JsxEmit,
|
|
14
14
|
getFromAnnotation: () => getFromAnnotation,
|
|
15
15
|
getFromContext: () => getFromContext,
|
|
16
16
|
make: () => make
|
|
@@ -68,6 +68,14 @@ function isRegExp(string) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// src/JsxConfig/JsxConfig.ts
|
|
71
|
+
var JsxEmit = {
|
|
72
|
+
None: 0,
|
|
73
|
+
Preserve: 1,
|
|
74
|
+
React: 2,
|
|
75
|
+
ReactNative: 3,
|
|
76
|
+
ReactJSX: 4,
|
|
77
|
+
ReactJSXDev: 5
|
|
78
|
+
};
|
|
71
79
|
function make() {
|
|
72
80
|
return {};
|
|
73
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.5-next.0",
|
|
4
4
|
"description": "ESLint React's plugin kit for building plugins and rules.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/utils": "^8.
|
|
39
|
-
"@zod/mini": "^4.0.0-beta.
|
|
38
|
+
"@typescript-eslint/utils": "^8.31.0",
|
|
39
|
+
"@zod/mini": "^4.0.0-beta.20250424T163858",
|
|
40
40
|
"ts-pattern": "^5.7.0",
|
|
41
|
-
"@eslint-react/eff": "1.48.
|
|
41
|
+
"@eslint-react/eff": "1.48.5-next.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@tsconfig/node22": "^22.0.1",
|