@eslint-react/kit 1.40.5-next.1 → 1.41.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 +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -38,16 +38,16 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
|
38
38
|
*/
|
|
39
39
|
declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
|
|
40
40
|
|
|
41
|
-
type
|
|
41
|
+
type JsxConfig = Pick<CompilerOptions, "reactNamespace" | "jsx" | "jsxFactory" | "jsxFragmentFactory" | "jsxImportSource">;
|
|
42
42
|
/**
|
|
43
|
-
* Create a
|
|
44
|
-
* @returns
|
|
43
|
+
* Create a JsxConfig object
|
|
44
|
+
* @returns JsxConfig
|
|
45
45
|
*/
|
|
46
|
-
declare function make$1():
|
|
46
|
+
declare function make$1(): JsxConfig;
|
|
47
47
|
/**
|
|
48
|
-
* Get
|
|
48
|
+
* Get JsxConfig from RuleContext
|
|
49
49
|
* @param context The RuleContext
|
|
50
|
-
* @returns
|
|
50
|
+
* @returns JsxConfig
|
|
51
51
|
*/
|
|
52
52
|
declare function getFromContext$1(context: RuleContext): {
|
|
53
53
|
jsx: JsxEmit;
|
|
@@ -57,16 +57,16 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
57
57
|
reactNamespace: string;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
|
-
* Get
|
|
60
|
+
* Get JsxConfig from annotation
|
|
61
61
|
* @param context The RuleContext
|
|
62
|
-
* @returns
|
|
62
|
+
* @returns JsxConfig
|
|
63
63
|
*/
|
|
64
|
-
declare function getFromAnnotation(context: RuleContext):
|
|
64
|
+
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
65
65
|
|
|
66
|
-
type index$
|
|
66
|
+
type index$1_JsxConfig = JsxConfig;
|
|
67
67
|
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
68
68
|
declare namespace index$1 {
|
|
69
|
-
export { type index$
|
|
69
|
+
export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$1 as make };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -186,4 +186,4 @@ declare function toRegExp(string: string): {
|
|
|
186
186
|
*/
|
|
187
187
|
declare function isRegExp(string: string): boolean;
|
|
188
188
|
|
|
189
|
-
export { index$1 as
|
|
189
|
+
export { index$1 as JsxConfig, index as LanguagePreference, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isRegExp, toRegExp };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,16 +38,16 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
|
38
38
|
*/
|
|
39
39
|
declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
|
|
40
40
|
|
|
41
|
-
type
|
|
41
|
+
type JsxConfig = Pick<CompilerOptions, "reactNamespace" | "jsx" | "jsxFactory" | "jsxFragmentFactory" | "jsxImportSource">;
|
|
42
42
|
/**
|
|
43
|
-
* Create a
|
|
44
|
-
* @returns
|
|
43
|
+
* Create a JsxConfig object
|
|
44
|
+
* @returns JsxConfig
|
|
45
45
|
*/
|
|
46
|
-
declare function make$1():
|
|
46
|
+
declare function make$1(): JsxConfig;
|
|
47
47
|
/**
|
|
48
|
-
* Get
|
|
48
|
+
* Get JsxConfig from RuleContext
|
|
49
49
|
* @param context The RuleContext
|
|
50
|
-
* @returns
|
|
50
|
+
* @returns JsxConfig
|
|
51
51
|
*/
|
|
52
52
|
declare function getFromContext$1(context: RuleContext): {
|
|
53
53
|
jsx: JsxEmit;
|
|
@@ -57,16 +57,16 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
57
57
|
reactNamespace: string;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
|
-
* Get
|
|
60
|
+
* Get JsxConfig from annotation
|
|
61
61
|
* @param context The RuleContext
|
|
62
|
-
* @returns
|
|
62
|
+
* @returns JsxConfig
|
|
63
63
|
*/
|
|
64
|
-
declare function getFromAnnotation(context: RuleContext):
|
|
64
|
+
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
65
65
|
|
|
66
|
-
type index$
|
|
66
|
+
type index$1_JsxConfig = JsxConfig;
|
|
67
67
|
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
68
68
|
declare namespace index$1 {
|
|
69
|
-
export { type index$
|
|
69
|
+
export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$1 as make };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -186,4 +186,4 @@ declare function toRegExp(string: string): {
|
|
|
186
186
|
*/
|
|
187
187
|
declare function isRegExp(string: string): boolean;
|
|
188
188
|
|
|
189
|
-
export { index$1 as
|
|
189
|
+
export { index$1 as JsxConfig, index as LanguagePreference, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isRegExp, toRegExp };
|
package/dist/index.js
CHANGED
|
@@ -9,9 +9,9 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
// src/
|
|
13
|
-
var
|
|
14
|
-
__export(
|
|
12
|
+
// src/JsxConfig/index.ts
|
|
13
|
+
var JsxConfig_exports = {};
|
|
14
|
+
__export(JsxConfig_exports, {
|
|
15
15
|
getFromAnnotation: () => getFromAnnotation,
|
|
16
16
|
getFromContext: () => getFromContext,
|
|
17
17
|
make: () => make
|
|
@@ -41,7 +41,7 @@ function isRegExp(string) {
|
|
|
41
41
|
return Boolean(RE_REGEXP_STR.test(string));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// src/
|
|
44
|
+
// src/JsxConfig/JsxConfig.ts
|
|
45
45
|
function make() {
|
|
46
46
|
return {};
|
|
47
47
|
}
|
|
@@ -58,17 +58,17 @@ function getFromContext(context) {
|
|
|
58
58
|
function getFromAnnotation(context) {
|
|
59
59
|
if (!context.sourceCode.text.includes("@jsx")) return {};
|
|
60
60
|
let jsx, jsxFrag, jsxRuntime, jsxImportSource;
|
|
61
|
-
for (const comment of context.sourceCode.getAllComments()) {
|
|
61
|
+
for (const comment of context.sourceCode.getAllComments().reverse()) {
|
|
62
62
|
const value = comment.value;
|
|
63
|
-
jsx
|
|
64
|
-
jsxFrag
|
|
65
|
-
jsxRuntime
|
|
66
|
-
jsxImportSource
|
|
63
|
+
jsx ??= value.match(RE_ANNOTATION_JSX)?.[1];
|
|
64
|
+
jsxFrag ??= value.match(RE_ANNOTATION_JSX_FRAG)?.[1];
|
|
65
|
+
jsxRuntime ??= value.match(RE_ANNOTATION_JSX_RUNTIME)?.[1];
|
|
66
|
+
jsxImportSource ??= value.match(RE_ANNOTATION_JSX_IMPORT_SOURCE)?.[1];
|
|
67
67
|
}
|
|
68
68
|
const options = make();
|
|
69
69
|
if (jsx != null) options.jsxFactory = jsx;
|
|
70
70
|
if (jsxFrag != null) options.jsxFragmentFactory = jsxFrag;
|
|
71
|
-
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? typescript.JsxEmit.
|
|
71
|
+
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? typescript.JsxEmit.React : typescript.JsxEmit.ReactJSX;
|
|
72
72
|
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
73
73
|
return options;
|
|
74
74
|
}
|
|
@@ -145,7 +145,7 @@ function createReport(context) {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
exports.
|
|
148
|
+
exports.JsxConfig = JsxConfig_exports;
|
|
149
149
|
exports.LanguagePreference = LanguagePreference_exports;
|
|
150
150
|
exports.RE_ANNOTATION_JSX = RE_ANNOTATION_JSX;
|
|
151
151
|
exports.RE_ANNOTATION_JSX_FRAG = RE_ANNOTATION_JSX_FRAG;
|
package/dist/index.mjs
CHANGED
|
@@ -7,9 +7,9 @@ var __export = (target, all) => {
|
|
|
7
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
// src/
|
|
11
|
-
var
|
|
12
|
-
__export(
|
|
10
|
+
// src/JsxConfig/index.ts
|
|
11
|
+
var JsxConfig_exports = {};
|
|
12
|
+
__export(JsxConfig_exports, {
|
|
13
13
|
getFromAnnotation: () => getFromAnnotation,
|
|
14
14
|
getFromContext: () => getFromContext,
|
|
15
15
|
make: () => make
|
|
@@ -39,7 +39,7 @@ function isRegExp(string) {
|
|
|
39
39
|
return Boolean(RE_REGEXP_STR.test(string));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// src/
|
|
42
|
+
// src/JsxConfig/JsxConfig.ts
|
|
43
43
|
function make() {
|
|
44
44
|
return {};
|
|
45
45
|
}
|
|
@@ -56,17 +56,17 @@ function getFromContext(context) {
|
|
|
56
56
|
function getFromAnnotation(context) {
|
|
57
57
|
if (!context.sourceCode.text.includes("@jsx")) return {};
|
|
58
58
|
let jsx, jsxFrag, jsxRuntime, jsxImportSource;
|
|
59
|
-
for (const comment of context.sourceCode.getAllComments()) {
|
|
59
|
+
for (const comment of context.sourceCode.getAllComments().reverse()) {
|
|
60
60
|
const value = comment.value;
|
|
61
|
-
jsx
|
|
62
|
-
jsxFrag
|
|
63
|
-
jsxRuntime
|
|
64
|
-
jsxImportSource
|
|
61
|
+
jsx ??= value.match(RE_ANNOTATION_JSX)?.[1];
|
|
62
|
+
jsxFrag ??= value.match(RE_ANNOTATION_JSX_FRAG)?.[1];
|
|
63
|
+
jsxRuntime ??= value.match(RE_ANNOTATION_JSX_RUNTIME)?.[1];
|
|
64
|
+
jsxImportSource ??= value.match(RE_ANNOTATION_JSX_IMPORT_SOURCE)?.[1];
|
|
65
65
|
}
|
|
66
66
|
const options = make();
|
|
67
67
|
if (jsx != null) options.jsxFactory = jsx;
|
|
68
68
|
if (jsxFrag != null) options.jsxFragmentFactory = jsxFrag;
|
|
69
|
-
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? JsxEmit.
|
|
69
|
+
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? JsxEmit.React : JsxEmit.ReactJSX;
|
|
70
70
|
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
71
71
|
return options;
|
|
72
72
|
}
|
|
@@ -143,4 +143,4 @@ function createReport(context) {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export {
|
|
146
|
+
export { JsxConfig_exports as JsxConfig, LanguagePreference_exports as LanguagePreference, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, createReport, isRegExp, toRegExp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0-beta.1",
|
|
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": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@typescript-eslint/utils": "^8.29.0",
|
|
39
39
|
"ts-pattern": "^5.7.0",
|
|
40
40
|
"valibot": "^1.0.0",
|
|
41
|
-
"@eslint-react/eff": "1.
|
|
41
|
+
"@eslint-react/eff": "1.41.0-beta.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@tsconfig/node22": "^22.0.1",
|