@eslint-react/shared 2.0.0-next.159 → 2.0.0-next.160

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
@@ -1,5 +1,6 @@
1
1
  import { unit } from "@eslint-react/eff";
2
- import { RuleContext } from "@eslint-react/kit";
2
+ import * as _eslint_react_kit0 from "@eslint-react/kit";
3
+ import { CompatibleConfig, CompatiblePlugin, RuleContext } from "@eslint-react/kit";
3
4
  import { z } from "zod/v4";
4
5
  import { PartialDeep } from "type-fest";
5
6
 
@@ -29,6 +30,24 @@ declare const GITHUB_URL = "https://github.com/Rel1cx/eslint-react";
29
30
  */
30
31
  declare const WEBSITE_URL = "https://eslint-react.xyz";
31
32
  //#endregion
33
+ //#region src/get-config-adapters.d.ts
34
+ declare function getConfigAdapters(pluginName: string, plugin: CompatiblePlugin): {
35
+ readonly toFlatConfig: (config: CompatibleConfig) => {
36
+ plugins: {
37
+ [pluginName]: CompatiblePlugin;
38
+ };
39
+ name?: string;
40
+ rules?: Record<string, _eslint_react_kit0.RuleConfig>;
41
+ settings?: _eslint_react_kit0.SettingsConfig;
42
+ };
43
+ readonly toLegacyConfig: ({
44
+ rules
45
+ }: CompatibleConfig) => {
46
+ plugins: string[];
47
+ rules: Record<string, _eslint_react_kit0.RuleConfig<unknown[]>> | undefined;
48
+ };
49
+ };
50
+ //#endregion
32
51
  //#region src/get-doc-url.d.ts
33
52
  /**
34
53
  * Get the URL for the documentation of a rule in a plugin.
@@ -311,4 +330,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
311
330
  }
312
331
  }
313
332
  //#endregion
314
- export { CustomComponent, CustomComponentNormalized, CustomComponentProp, CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, _require, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };
333
+ export { CustomComponent, CustomComponentNormalized, CustomComponentProp, CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, _require, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getConfigAdapters, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };
package/dist/index.js CHANGED
@@ -34,6 +34,27 @@ const GITHUB_URL = "https://github.com/Rel1cx/eslint-react";
34
34
  */
35
35
  const WEBSITE_URL = "https://eslint-react.xyz";
36
36
 
37
+ //#endregion
38
+ //#region src/get-config-adapters.ts
39
+ function getConfigAdapters(pluginName, plugin) {
40
+ function toFlatConfig(config) {
41
+ return {
42
+ ...config,
43
+ plugins: { [pluginName]: plugin }
44
+ };
45
+ }
46
+ function toLegacyConfig({ rules }) {
47
+ return {
48
+ plugins: [pluginName],
49
+ rules
50
+ };
51
+ }
52
+ return {
53
+ toFlatConfig,
54
+ toLegacyConfig
55
+ };
56
+ }
57
+
37
58
  //#endregion
38
59
  //#region src/get-doc-url.ts
39
60
  /**
@@ -231,4 +252,4 @@ function getSettingsFromContext(context) {
231
252
  const defineSettings = identity;
232
253
 
233
254
  //#endregion
234
- export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, _require, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };
255
+ export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, WEBSITE_URL, _require, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getConfigAdapters, getDocsUrl, getId, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, normalizeSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "2.0.0-next.159",
3
+ "version": "2.0.0-next.160",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -30,8 +30,8 @@
30
30
  "@typescript-eslint/utils": "^8.41.0",
31
31
  "ts-pattern": "^5.8.0",
32
32
  "zod": "^4.1.5",
33
- "@eslint-react/eff": "2.0.0-next.159",
34
- "@eslint-react/kit": "2.0.0-next.159"
33
+ "@eslint-react/eff": "2.0.0-next.160",
34
+ "@eslint-react/kit": "2.0.0-next.160"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/node22": "^22.0.2",