@eslint-react/shared 5.0.2-next.3 → 5.0.2-next.5

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 CHANGED
@@ -113,29 +113,6 @@ declare function toRegExp(string: string | null | undefined): RegExpLike;
113
113
  declare function isRegExp(string: string): boolean;
114
114
  //#endregion
115
115
  //#region src/types.d.ts
116
- /**
117
- * Rule severity.
118
- * @since 0.0.1
119
- */
120
- type SeverityName = "off" | "warn" | "error";
121
- /**
122
- * The numeric severity level for a rule.
123
- *
124
- * - `0` means off.
125
- * - `1` means warn.
126
- * - `2` means error.
127
- */
128
- type SeverityLevel = 0 | 1 | 2;
129
- /**
130
- * The severity of a rule in a configuration.
131
- */
132
- type Severity = SeverityName | SeverityLevel;
133
- /**
134
- * Rule declaration.
135
- * @internal
136
- * @since 0.0.1
137
- */
138
- type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
139
116
  /**
140
117
  * Rule context.
141
118
  * @since 0.0.1
@@ -154,12 +131,6 @@ type RuleSuggest<MessageIds extends string = string> = {
154
131
  fix: tseslint.ReportFixFunction; /** The message ID for the suggestion. */
155
132
  messageId: MessageIds;
156
133
  };
157
- /**
158
- * A collection of settings.
159
- */
160
- interface SettingsConfig {
161
- [key: string]: unknown;
162
- }
163
134
  //#endregion
164
135
  //#region src/settings.d.ts
165
136
  /**
@@ -239,4 +210,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
239
210
  }
240
211
  }
241
212
  //#endregion
242
- export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, 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, type RuleListener, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, decodeESLintSettings, decodeSettings, defineRuleListener, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
213
+ export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, 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, RuleContext, RuleFeature, type RuleFix, type RuleFixer, type RuleListener, RuleSuggest, decodeESLintSettings, decodeSettings, defineRuleListener, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
package/dist/index.js CHANGED
@@ -267,7 +267,6 @@ function isRegExp(string) {
267
267
 
268
268
  //#endregion
269
269
  //#region src/settings.ts
270
- const _require = module.createRequire(process.cwd() + path.sep);
271
270
  /**
272
271
  * @internal
273
272
  */
@@ -327,7 +326,7 @@ const cache = /* @__PURE__ */ new Map();
327
326
  */
328
327
  function getReactVersion(fallback) {
329
328
  try {
330
- return match(_require("react")).with({ version: P.select(P.string) }, identity).otherwise(() => fallback);
329
+ return match(module.createRequire(process.cwd() + path.sep)("react")).with({ version: P.select(P.string) }, identity).otherwise(() => fallback);
331
330
  } catch {
332
331
  return fallback;
333
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "5.0.2-next.3",
3
+ "version": "5.0.2-next.5",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {