@eslint-react/shared 1.37.1-beta.4 → 1.37.1-next.0

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.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { _ } from '@eslint-react/eff';
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  import * as tseslint from '@typescript-eslint/utils/ts-eslint';
3
3
  import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
4
- import { ESLintUtils } from '@typescript-eslint/utils';
4
+ import { _ } from '@eslint-react/eff';
5
5
 
6
6
  /**
7
7
  * The NPM scope for this project.
@@ -38,6 +38,21 @@ declare const RE_CONSTANT_CASE: RegExp;
38
38
  declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
39
39
  declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
40
40
 
41
+ /**
42
+ * Get the ESLint rule creator for a plugin.
43
+ * @internal
44
+ * @param pluginName The name of the plugin.
45
+ * @returns The ESLint rule creator.
46
+ */
47
+ declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
48
+
49
+ declare function isInEditorEnv(): boolean;
50
+ declare function isInGitHooksOrLintStaged(): boolean;
51
+
52
+ declare const getId: () => string;
53
+
54
+ declare function getReactVersion(fallback?: string): string;
55
+
41
56
  /**
42
57
  * Rule severity.
43
58
  * @since 0.0.1
@@ -75,27 +90,7 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC";
75
90
  */
76
91
  type RuleStatus = "stable" | "experimental" | "deprecated" | "removed";
77
92
 
78
- /**
79
- * Creates a report function that can conditionally report a descriptor.
80
- * @param context - The context of the rule
81
- * @returns A function that takes a descriptor and reports it if it's not null or undefined
82
- */
83
- declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
84
-
85
- /**
86
- * Get the ESLint rule creator for a plugin.
87
- * @internal
88
- * @param pluginName The name of the plugin.
89
- * @returns The ESLint rule creator.
90
- */
91
- declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
92
-
93
- declare function isInEditorEnv(): boolean;
94
- declare function isInGitHooksOrLintStaged(): boolean;
95
-
96
- declare const getId: () => string;
97
-
98
- declare function getReactVersion(fallback?: string): string;
93
+ declare function report<MessageID extends string>(context: RuleContext): (descriptor: undefined | null | ReportDescriptor<MessageID>) => void;
99
94
 
100
95
  /**
101
96
  * Fallback type.
@@ -2366,4 +2361,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2366
2361
  }
2367
2362
  }
2368
2363
 
2369
- export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RulePreset, type RuleSeverity, type RuleStatus, WEBSITE_URL, createReport, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
2364
+ export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RulePreset, type RuleSeverity, type RuleStatus, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, report, toNormalizedSettings, unsafeDecodeSettings };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { _ } from '@eslint-react/eff';
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  import * as tseslint from '@typescript-eslint/utils/ts-eslint';
3
3
  import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
4
- import { ESLintUtils } from '@typescript-eslint/utils';
4
+ import { _ } from '@eslint-react/eff';
5
5
 
6
6
  /**
7
7
  * The NPM scope for this project.
@@ -38,6 +38,21 @@ declare const RE_CONSTANT_CASE: RegExp;
38
38
  declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
39
39
  declare const REACT_BUILD_IN_HOOKS: readonly ["use", "useActionState", "useCallback", "useContext", "useDebugValue", "useDeferredValue", "useEffect", "useFormStatus", "useId", "useImperativeHandle", "useInsertionEffect", "useLayoutEffect", "useMemo", "useOptimistic", "useReducer", "useRef", "useState", "useSyncExternalStore", "useTransition"];
40
40
 
41
+ /**
42
+ * Get the ESLint rule creator for a plugin.
43
+ * @internal
44
+ * @param pluginName The name of the plugin.
45
+ * @returns The ESLint rule creator.
46
+ */
47
+ declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
48
+
49
+ declare function isInEditorEnv(): boolean;
50
+ declare function isInGitHooksOrLintStaged(): boolean;
51
+
52
+ declare const getId: () => string;
53
+
54
+ declare function getReactVersion(fallback?: string): string;
55
+
41
56
  /**
42
57
  * Rule severity.
43
58
  * @since 0.0.1
@@ -75,27 +90,7 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC";
75
90
  */
76
91
  type RuleStatus = "stable" | "experimental" | "deprecated" | "removed";
77
92
 
78
- /**
79
- * Creates a report function that can conditionally report a descriptor.
80
- * @param context - The context of the rule
81
- * @returns A function that takes a descriptor and reports it if it's not null or undefined
82
- */
83
- declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
84
-
85
- /**
86
- * Get the ESLint rule creator for a plugin.
87
- * @internal
88
- * @param pluginName The name of the plugin.
89
- * @returns The ESLint rule creator.
90
- */
91
- declare const createRuleForPlugin: (pluginName: string) => <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
92
-
93
- declare function isInEditorEnv(): boolean;
94
- declare function isInGitHooksOrLintStaged(): boolean;
95
-
96
- declare const getId: () => string;
97
-
98
- declare function getReactVersion(fallback?: string): string;
93
+ declare function report<MessageID extends string>(context: RuleContext): (descriptor: undefined | null | ReportDescriptor<MessageID>) => void;
99
94
 
100
95
  /**
101
96
  * Fallback type.
@@ -2366,4 +2361,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
2366
2361
  }
2367
2362
  }
2368
2363
 
2369
- export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RulePreset, type RuleSeverity, type RuleStatus, WEBSITE_URL, createReport, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
2364
+ export { type CustomComponent, type CustomComponentNormalized, type CustomComponentProp, type CustomComponentPropNormalized, CustomComponentPropSchema, CustomComponentSchema, type CustomHooks, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RuleNamespace, type RulePreset, type RuleSeverity, type RuleStatus, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, report, toNormalizedSettings, unsafeDecodeSettings };
package/dist/index.js CHANGED
@@ -43,13 +43,6 @@ var REACT_BUILD_IN_HOOKS = [
43
43
  "useSyncExternalStore",
44
44
  "useTransition"
45
45
  ];
46
-
47
- // src/create-report.ts
48
- function createReport(context) {
49
- return (descriptor) => {
50
- if (descriptor != null) context.report(descriptor);
51
- };
52
- }
53
46
  var getDocsUrl = (pluginName) => (ruleName) => {
54
47
  if (pluginName === "x") {
55
48
  return `${WEBSITE_URL}/docs/rules/${ruleName}`;
@@ -84,6 +77,13 @@ function getReactVersion(fallback = "19.0.0") {
84
77
  }
85
78
  }
86
79
 
80
+ // src/report.ts
81
+ function report(context) {
82
+ return (descriptor) => {
83
+ if (descriptor != null) context.report(descriptor);
84
+ };
85
+ }
86
+
87
87
  // ../../node_modules/.pnpm/valibot@1.0.0_typescript@5.8.2/node_modules/valibot/dist/index.js
88
88
  var store;
89
89
  // @__NO_SIDE_EFFECTS__
@@ -1334,7 +1334,6 @@ exports.RE_KEBAB_CASE = RE_KEBAB_CASE;
1334
1334
  exports.RE_PASCAL_CASE = RE_PASCAL_CASE;
1335
1335
  exports.RE_SNAKE_CASE = RE_SNAKE_CASE;
1336
1336
  exports.WEBSITE_URL = WEBSITE_URL;
1337
- exports.createReport = createReport;
1338
1337
  exports.createRuleForPlugin = createRuleForPlugin;
1339
1338
  exports.decodeSettings = decodeSettings;
1340
1339
  exports.defineSettings = defineSettings;
@@ -1343,5 +1342,6 @@ exports.getReactVersion = getReactVersion;
1343
1342
  exports.getSettingsFromContext = getSettingsFromContext;
1344
1343
  exports.isInEditorEnv = isInEditorEnv;
1345
1344
  exports.isInGitHooksOrLintStaged = isInGitHooksOrLintStaged;
1345
+ exports.report = report;
1346
1346
  exports.toNormalizedSettings = toNormalizedSettings;
1347
1347
  exports.unsafeDecodeSettings = unsafeDecodeSettings;
package/dist/index.mjs CHANGED
@@ -35,13 +35,6 @@ var REACT_BUILD_IN_HOOKS = [
35
35
  "useSyncExternalStore",
36
36
  "useTransition"
37
37
  ];
38
-
39
- // src/create-report.ts
40
- function createReport(context) {
41
- return (descriptor) => {
42
- if (descriptor != null) context.report(descriptor);
43
- };
44
- }
45
38
  var getDocsUrl = (pluginName) => (ruleName) => {
46
39
  if (pluginName === "x") {
47
40
  return `${WEBSITE_URL}/docs/rules/${ruleName}`;
@@ -76,6 +69,13 @@ function getReactVersion(fallback = "19.0.0") {
76
69
  }
77
70
  }
78
71
 
72
+ // src/report.ts
73
+ function report(context) {
74
+ return (descriptor) => {
75
+ if (descriptor != null) context.report(descriptor);
76
+ };
77
+ }
78
+
79
79
  // ../../node_modules/.pnpm/valibot@1.0.0_typescript@5.8.2/node_modules/valibot/dist/index.js
80
80
  var store;
81
81
  // @__NO_SIDE_EFFECTS__
@@ -1310,4 +1310,4 @@ function getSettingsFromContext(context) {
1310
1310
  }
1311
1311
  var defineSettings = identity;
1312
1312
 
1313
- export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createReport, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, toNormalizedSettings, unsafeDecodeSettings };
1313
+ export { CustomComponentPropSchema, CustomComponentSchema, CustomHooksSchema, DEFAULT_ESLINT_REACT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged, report, toNormalizedSettings, unsafeDecodeSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.37.1-beta.4",
3
+ "version": "1.37.1-next.0",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -38,7 +38,7 @@
38
38
  "@typescript-eslint/utils": "^8.27.0",
39
39
  "picomatch": "^4.0.2",
40
40
  "ts-pattern": "^5.6.2",
41
- "@eslint-react/eff": "1.37.1-beta.4"
41
+ "@eslint-react/eff": "1.37.1-next.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/picomatch": "^3.0.2",