@eslint-react/shared 3.0.0-next.2 → 3.0.0-next.20
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 +4 -9
- package/dist/index.js +2 -5
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unit } from "@eslint-react/eff";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
-
import { ReportDescriptor, RuleListener } from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
+
import { ReportDescriptor, ReportFixFunction, RuleFix, RuleFixer, RuleListener } from "@typescript-eslint/utils/ts-eslint";
|
|
5
5
|
|
|
6
6
|
//#region src/_id.d.ts
|
|
7
7
|
/**
|
|
@@ -104,7 +104,7 @@ interface CompatibleConfig {
|
|
|
104
104
|
/** Shared settings. */
|
|
105
105
|
settings?: SettingsConfig;
|
|
106
106
|
}
|
|
107
|
-
type CompilationMode = "
|
|
107
|
+
type CompilationMode = "infer" | "annotation" | "syntax" | "all";
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/config-adapters.d.ts
|
|
110
110
|
/**
|
|
@@ -286,7 +286,6 @@ declare function report(context: RuleContext): (descriptor?: null | ReportDescri
|
|
|
286
286
|
declare const ESLintReactSettingsSchema: z.ZodObject<{
|
|
287
287
|
importSource: z.ZodOptional<z.ZodString>;
|
|
288
288
|
compilationMode: z.ZodOptional<z.ZodEnum<{
|
|
289
|
-
off: "off";
|
|
290
289
|
infer: "infer";
|
|
291
290
|
annotation: "annotation";
|
|
292
291
|
syntax: "syntax";
|
|
@@ -317,8 +316,7 @@ type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>;
|
|
|
317
316
|
interface ESLintReactSettingsNormalized {
|
|
318
317
|
version: string;
|
|
319
318
|
importSource: string;
|
|
320
|
-
compilationMode: CompilationMode;
|
|
321
|
-
isCompilerEnabled: boolean;
|
|
319
|
+
compilationMode: CompilationMode | "off";
|
|
322
320
|
polymorphicPropName: string | unit;
|
|
323
321
|
additionalStateHooks: RegExpLike;
|
|
324
322
|
}
|
|
@@ -328,7 +326,6 @@ interface ESLintReactSettingsNormalized {
|
|
|
328
326
|
declare const DEFAULT_ESLINT_REACT_SETTINGS: {
|
|
329
327
|
readonly version: "detect";
|
|
330
328
|
readonly importSource: "react";
|
|
331
|
-
readonly compilationMode: "annotation";
|
|
332
329
|
readonly polymorphicPropName: "as";
|
|
333
330
|
};
|
|
334
331
|
/**
|
|
@@ -338,7 +335,6 @@ declare const DEFAULT_ESLINT_SETTINGS: {
|
|
|
338
335
|
readonly "react-x": {
|
|
339
336
|
readonly version: "detect";
|
|
340
337
|
readonly importSource: "react";
|
|
341
|
-
readonly compilationMode: "annotation";
|
|
342
338
|
readonly polymorphicPropName: "as";
|
|
343
339
|
};
|
|
344
340
|
};
|
|
@@ -386,7 +382,6 @@ declare const normalizeSettings: ({
|
|
|
386
382
|
}: ESLintReactSettings) => {
|
|
387
383
|
readonly importSource: string;
|
|
388
384
|
readonly compilationMode: "off" | "infer" | "annotation" | "syntax" | "all";
|
|
389
|
-
readonly isCompilerEnabled: boolean;
|
|
390
385
|
readonly polymorphicPropName: string;
|
|
391
386
|
readonly version: string;
|
|
392
387
|
readonly additionalStateHooks: RegExpLike;
|
|
@@ -408,4 +403,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
408
403
|
}
|
|
409
404
|
}
|
|
410
405
|
//#endregion
|
|
411
|
-
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, CompilationMode, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IMPURE_CONSTRUCTORS, IMPURE_FUNCTIONS, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, RegExpLike, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
|
|
406
|
+
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, CompilationMode, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IMPURE_CONSTRUCTORS, IMPURE_FUNCTIONS, IdGenerator, NPM_SCOPE, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, RegExpLike, type ReportFixFunction, RuleConfig, RuleContext, RuleFeature, type RuleFix, type RuleFixer, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
|
package/dist/index.js
CHANGED
|
@@ -498,7 +498,6 @@ function report(context) {
|
|
|
498
498
|
const ESLintReactSettingsSchema = z.object({
|
|
499
499
|
importSource: z.optional(z.string()),
|
|
500
500
|
compilationMode: z.optional(z.enum([
|
|
501
|
-
"off",
|
|
502
501
|
"infer",
|
|
503
502
|
"annotation",
|
|
504
503
|
"syntax",
|
|
@@ -519,7 +518,6 @@ const ESLintSettingsSchema = z.optional(z.object({ "react-x": z.optional(z.unkno
|
|
|
519
518
|
const DEFAULT_ESLINT_REACT_SETTINGS = {
|
|
520
519
|
version: "detect",
|
|
521
520
|
importSource: "react",
|
|
522
|
-
compilationMode: "annotation",
|
|
523
521
|
polymorphicPropName: "as"
|
|
524
522
|
};
|
|
525
523
|
/**
|
|
@@ -574,12 +572,11 @@ const decodeSettings = (settings) => {
|
|
|
574
572
|
* Normalizes ESLint React settings to a consistent internal format
|
|
575
573
|
* Transforms component definitions and resolves version information
|
|
576
574
|
*/
|
|
577
|
-
const normalizeSettings = ({ importSource = "react", compilationMode
|
|
575
|
+
const normalizeSettings = ({ importSource = "react", compilationMode, polymorphicPropName = "as", version, additionalStateHooks, ...rest }) => {
|
|
578
576
|
return {
|
|
579
577
|
...rest,
|
|
580
578
|
importSource,
|
|
581
|
-
compilationMode,
|
|
582
|
-
isCompilerEnabled: compilationMode !== "off",
|
|
579
|
+
compilationMode: compilationMode ?? "off",
|
|
583
580
|
polymorphicPropName,
|
|
584
581
|
version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.2.4")).otherwise(identity),
|
|
585
582
|
additionalStateHooks: toRegExp(additionalStateHooks)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.20",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"./package.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@typescript-eslint/utils": "
|
|
33
|
+
"@typescript-eslint/utils": "canary",
|
|
34
34
|
"ts-pattern": "^5.9.0",
|
|
35
35
|
"zod": "^3.25.0 || ^4.0.0",
|
|
36
|
-
"@eslint-react/eff": "3.0.0-next.
|
|
36
|
+
"@eslint-react/eff": "3.0.0-next.20"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@tsconfig/node24": "^24.0.4",
|