Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@eslint-react/shared

Package Overview
Dependencies
Maintainers
1
Versions
2345
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eslint-react/shared - npm Package Compare versions

Comparing version
3.0.0-next.55
to
3.0.0-next.56
+52
-111
dist/index.d.ts

@@ -24,111 +24,2 @@ import { unit } from "@eslint-react/eff";

//#endregion
//#region src/types.d.ts
/**
* Rule severity.
* @since 0.0.1
*/
type SeverityName = "off" | "warn" | "error";
/**
* The numeric severity level for a rule.
*
* - `0` means off.
* - `1` means warn.
* - `2` means error.
*/
type SeverityLevel = 0 | 1 | 2;
/**
* The severity of a rule in a configuration.
*/
type Severity = SeverityName | SeverityLevel;
/**
* Rule declaration.
* @internal
* @since 0.0.1
*/
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
/**
* Rule context.
* @since 0.0.1
*/
type RuleContext<MessageIds extends string = string, Options extends readonly unknown[] = readonly unknown[]> = tseslint.RuleContext<MessageIds, Options>;
/**
* Rule feature.
* @since 1.20.0
*/
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
/**
* The numeric policy value for a rule (severity level).
*/
type RulePolicy = number;
/**
* A suggestion for fixing a reported issue.
*/
type RuleSuggest<MessageIds extends string = string> = {
/** The message ID for the suggestion. */messageId: MessageIds; /** Optional data to pass to the message formatter. */
data?: Record<string, unknown>; /** The fix function to apply the suggestion. */
fix: tseslint.ReportFixFunction;
};
/**
* A collection of settings.
*/
interface SettingsConfig {
[key: string]: unknown;
}
/**
* A rule with a compatible shape for use with `defineConfig()` and `tseslint.config()`.
* Intentionally wide/inaccurate for compatibility purposes.
*/
interface CompatibleRule {
meta: Record<string, any>;
create: (...args: any[]) => any;
}
/**
* A plugin with a compatible shape for use with `defineConfig()` and `tseslint.config()`.
* Intentionally wide/inaccurate for compatibility purposes.
*/
interface CompatiblePlugin {
meta: {
name: string;
version: string;
};
rules: Record<string, CompatibleRule>;
}
/**
* A configuration object with a compatible shape for use with `defineConfig()` and `tseslint.config()`.
* Intentionally wide/inaccurate for compatibility purposes.
*/
interface CompatibleConfig {
/** Optional configuration name. */
name?: string;
/** Rule configurations. */
rules?: Record<string, RuleConfig>;
/** Shared settings. */
settings?: SettingsConfig;
}
type CompilationMode = "infer" | "annotation" | "syntax" | "all";
//#endregion
//#region src/config-adapters.d.ts
/**
* Get configuration adapters for converting between flat and legacy config formats
* @param pluginName The name of the plugin
* @param plugin The plugin instance
* @returns Object with toFlatConfig and toLegacyConfig functions
*/
declare function getConfigAdapters(pluginName: string, plugin: CompatiblePlugin): {
readonly toFlatConfig: (config: CompatibleConfig) => {
plugins: {
[pluginName]: CompatiblePlugin;
};
name?: string;
rules?: Record<string, RuleConfig>;
settings?: SettingsConfig;
};
readonly toLegacyConfig: ({
rules
}: CompatibleConfig) => {
plugins: string[];
rules: Record<string, RuleConfig<unknown[]>> | undefined;
};
};
//#endregion
//#region src/constants.d.ts

@@ -274,2 +165,51 @@ /**

//#endregion
//#region src/types.d.ts
/**
* Rule severity.
* @since 0.0.1
*/
type SeverityName = "off" | "warn" | "error";
/**
* The numeric severity level for a rule.
*
* - `0` means off.
* - `1` means warn.
* - `2` means error.
*/
type SeverityLevel = 0 | 1 | 2;
/**
* The severity of a rule in a configuration.
*/
type Severity = SeverityName | SeverityLevel;
/**
* Rule declaration.
* @internal
* @since 0.0.1
*/
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
/**
* Rule context.
* @since 0.0.1
*/
type RuleContext<MessageIds extends string = string, Options extends readonly unknown[] = readonly unknown[]> = tseslint.RuleContext<MessageIds, Options>;
/**
* Rule feature.
* @since 1.20.0
*/
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
/**
* A suggestion for fixing a reported issue.
*/
type RuleSuggest<MessageIds extends string = string> = {
/** The message ID for the suggestion. */messageId: MessageIds; /** Optional data to pass to the message formatter. */
data?: Record<string, unknown>; /** The fix function to apply the suggestion. */
fix: tseslint.ReportFixFunction;
};
/**
* A collection of settings.
*/
interface SettingsConfig {
[key: string]: unknown;
}
//#endregion
//#region src/report.d.ts

@@ -316,2 +256,3 @@ /**

type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>;
type CompilationMode = "infer" | "annotation" | "syntax" | "all";
/**

@@ -390,3 +331,3 @@ * Normalized ESLint React settings with processed values

readonly importSource: string;
readonly compilationMode: "off" | "infer" | "annotation" | "syntax" | "all";
readonly compilationMode: "infer" | "annotation" | "syntax" | "all" | "off";
readonly polymorphicPropName: string;

@@ -414,2 +355,2 @@ readonly version: string;

//#endregion
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, 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, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
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 };

@@ -32,29 +32,2 @@ import module from "node:module";

//#endregion
//#region src/config-adapters.ts
/**
* Get configuration adapters for converting between flat and legacy config formats
* @param pluginName The name of the plugin
* @param plugin The plugin instance
* @returns Object with toFlatConfig and toLegacyConfig functions
*/
function getConfigAdapters(pluginName, plugin) {
function toFlatConfig(config) {
return {
...config,
plugins: { [pluginName]: plugin }
};
}
function toLegacyConfig({ rules }) {
return {
plugins: [pluginName],
rules
};
}
return {
toFlatConfig,
toLegacyConfig
};
}
//#endregion
//#region src/constants.ts

@@ -605,2 +578,2 @@ /**

//#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, getConfigAdapters, 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, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
{
"name": "@eslint-react/shared",
"version": "3.0.0-next.55",
"version": "3.0.0-next.56",
"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-next.55"
"@eslint-react/eff": "3.0.0-next.56"
},

@@ -43,3 +43,3 @@ "devDependencies": {

"@types/picomatch": "^4.0.2",
"tsdown": "^0.21.0-beta.1",
"tsdown": "^0.21.0-beta.2",
"@local/configs": "0.0.0"

@@ -46,0 +46,0 @@ },