@eslint-react/shared
Advanced tools
+2
-60
@@ -223,3 +223,2 @@ import { unit } from "@eslint-react/eff"; | ||
| /** | ||
| * Schema for ESLint React settings configuration | ||
| * @internal | ||
@@ -241,3 +240,2 @@ */ | ||
| /** | ||
| * Schema for ESLint settings | ||
| * @internal | ||
@@ -248,18 +246,8 @@ */ | ||
| }, z.core.$strip>>; | ||
| /** | ||
| * ESLint settings type inferred from the settings schema. | ||
| */ | ||
| type ESLintSettings = z.infer<typeof ESLintSettingsSchema>; | ||
| /** | ||
| * ESLint React settings type inferred from the React settings schema. | ||
| */ | ||
| type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>; | ||
| type CompilationMode = "infer" | "annotation" | "syntax" | "all"; | ||
| /** | ||
| * Normalized ESLint React settings with processed values | ||
| */ | ||
| interface ESLintReactSettingsNormalized { | ||
| version: string; | ||
| importSource: string; | ||
| compilationMode: CompilationMode | "off"; | ||
| compilationMode: ESLintReactSettings["compilationMode"] | "off"; | ||
| polymorphicPropName: string | unit; | ||
@@ -269,5 +257,2 @@ additionalStateHooks: RegExpLike; | ||
| } | ||
| /** | ||
| * Default ESLint React settings | ||
| */ | ||
| declare const DEFAULT_ESLINT_REACT_SETTINGS: { | ||
@@ -278,5 +263,2 @@ readonly version: "detect"; | ||
| }; | ||
| /** | ||
| * Default ESLint settings with React settings included | ||
| */ | ||
| declare const DEFAULT_ESLINT_SETTINGS: { | ||
@@ -289,36 +271,6 @@ readonly "react-x": { | ||
| }; | ||
| /** | ||
| * Check if the provided settings conform to ESLintSettings schema | ||
| * @param settings The settings object to validate | ||
| */ | ||
| declare function isESLintSettings(settings: unknown): settings is ESLintSettings; | ||
| /** | ||
| * Check if the provided settings conform to ESLintReactSettings schema | ||
| * @param settings The settings object to validate | ||
| */ | ||
| declare function isESLintReactSettings(settings: unknown): settings is ESLintReactSettings; | ||
| /** | ||
| * Coerces unknown input to ESLintSettings type | ||
| * @param settings The settings object to coerce | ||
| */ | ||
| declare const coerceESLintSettings: (settings: unknown) => Partial<ESLintSettings>; | ||
| /** | ||
| * Decodes and validates ESLint settings, using defaults if invalid | ||
| * @param settings The settings object to decode | ||
| */ | ||
| declare const decodeESLintSettings: (settings: unknown) => ESLintSettings; | ||
| /** | ||
| * Coerces unknown input to ESLintReactSettings type | ||
| * @param settings The settings object to coerce | ||
| */ | ||
| declare const coerceSettings: (settings: unknown) => Partial<ESLintReactSettings>; | ||
| /** | ||
| * Decodes and validates ESLint React settings, using defaults if invalid | ||
| * @param settings The settings object to decode | ||
| */ | ||
| declare const decodeSettings: (settings: unknown) => ESLintReactSettings; | ||
| /** | ||
| * Normalizes ESLint React settings to a consistent internal format | ||
| * Transforms component definitions and resolves version information | ||
| */ | ||
| declare const normalizeSettings: ({ | ||
@@ -340,13 +292,3 @@ importSource, | ||
| }; | ||
| /** | ||
| * Retrieves normalized ESLint React settings from the rule context | ||
| * Uses caching for performance optimization | ||
| * @param context The ESLint rule context | ||
| */ | ||
| declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized; | ||
| /** | ||
| * Helper function for defining typed settings for "react-x" in JavaScript files | ||
| * Provides type checking without runtime transformation | ||
| */ | ||
| declare const defineSettings: (settings: ESLintReactSettings) => ESLintReactSettings; | ||
| declare module "@typescript-eslint/utils/ts-eslint" { | ||
@@ -358,2 +300,2 @@ interface SharedConfigurationSettings { | ||
| //#endregion | ||
| export { CompilationMode, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IMPURE_CTORS, IMPURE_FUNCS, 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, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp }; | ||
| export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, IMPURE_CTORS, IMPURE_FUNCS, 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, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, decodeESLintSettings, decodeSettings, defineRuleListener, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp }; |
+1
-53
@@ -468,3 +468,2 @@ import module from "node:module"; | ||
| /** | ||
| * Schema for ESLint React settings configuration | ||
| * @internal | ||
@@ -486,9 +485,5 @@ */ | ||
| /** | ||
| * Schema for ESLint settings | ||
| * @internal | ||
| */ | ||
| const ESLintSettingsSchema = z.optional(z.object({ "react-x": z.optional(z.unknown()) })); | ||
| /** | ||
| * Default ESLint React settings | ||
| */ | ||
| const DEFAULT_ESLINT_REACT_SETTINGS = { | ||
@@ -499,31 +494,9 @@ version: "detect", | ||
| }; | ||
| /** | ||
| * Default ESLint settings with React settings included | ||
| */ | ||
| const DEFAULT_ESLINT_SETTINGS = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS }; | ||
| /** | ||
| * Check if the provided settings conform to ESLintSettings schema | ||
| * @param settings The settings object to validate | ||
| */ | ||
| function isESLintSettings(settings) { | ||
| return ESLintSettingsSchema.safeParse(settings).success; | ||
| } | ||
| /** | ||
| * Check if the provided settings conform to ESLintReactSettings schema | ||
| * @param settings The settings object to validate | ||
| */ | ||
| function isESLintReactSettings(settings) { | ||
| return ESLintReactSettingsSchema.safeParse(settings).success; | ||
| } | ||
| /** | ||
| * Coerces unknown input to ESLintSettings type | ||
| * @param settings The settings object to coerce | ||
| */ | ||
| const coerceESLintSettings = (settings) => { | ||
| return settings; | ||
| }; | ||
| /** | ||
| * Decodes and validates ESLint settings, using defaults if invalid | ||
| * @param settings The settings object to decode | ||
| */ | ||
| const decodeESLintSettings = (settings) => { | ||
@@ -533,13 +506,2 @@ if (isESLintSettings(settings)) return settings; | ||
| }; | ||
| /** | ||
| * Coerces unknown input to ESLintReactSettings type | ||
| * @param settings The settings object to coerce | ||
| */ | ||
| const coerceSettings = (settings) => { | ||
| return settings; | ||
| }; | ||
| /** | ||
| * Decodes and validates ESLint React settings, using defaults if invalid | ||
| * @param settings The settings object to decode | ||
| */ | ||
| const decodeSettings = (settings) => { | ||
@@ -549,6 +511,2 @@ if (isESLintReactSettings(settings)) return settings; | ||
| }; | ||
| /** | ||
| * Normalizes ESLint React settings to a consistent internal format | ||
| * Transforms component definitions and resolves version information | ||
| */ | ||
| const normalizeSettings = ({ importSource = "react", compilationMode, polymorphicPropName = "as", version, additionalStateHooks, additionalEffectHooks, ...rest }) => { | ||
@@ -566,7 +524,2 @@ return { | ||
| const cache = /* @__PURE__ */ new Map(); | ||
| /** | ||
| * Retrieves normalized ESLint React settings from the rule context | ||
| * Uses caching for performance optimization | ||
| * @param context The ESLint rule context | ||
| */ | ||
| function getSettingsFromContext(context) { | ||
@@ -576,9 +529,4 @@ const settings = context.settings; | ||
| } | ||
| /** | ||
| * Helper function for defining typed settings for "react-x" in JavaScript files | ||
| * Provides type checking without runtime transformation | ||
| */ | ||
| const defineSettings = identity; | ||
| //#endregion | ||
| export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, IMPURE_CTORS, IMPURE_FUNCS, 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, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp }; | ||
| export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, IMPURE_CTORS, IMPURE_FUNCS, 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, WEBSITE_URL, decodeESLintSettings, decodeSettings, defineRuleListener, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp }; |
+2
-2
| { | ||
| "name": "@eslint-react/shared", | ||
| "version": "3.0.0-beta.56", | ||
| "version": "3.0.0-beta.57", | ||
| "description": "ESLint React's Shared constants and functions.", | ||
@@ -36,3 +36,3 @@ "homepage": "https://github.com/Rel1cx/eslint-react", | ||
| "zod": "^3.25.0 || ^4.0.0", | ||
| "@eslint-react/eff": "3.0.0-beta.56" | ||
| "@eslint-react/eff": "3.0.0-beta.57" | ||
| }, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
24649
-12.41%807
-12%+ Added
- Removed