@eslint-react/shared 1.37.0 → 1.37.1-beta.3
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 +24 -19
- package/dist/index.d.ts +24 -19
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ } from '@eslint-react/eff';
|
|
2
2
|
import * as tseslint from '@typescript-eslint/utils/ts-eslint';
|
|
3
3
|
import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
|
|
4
|
-
import {
|
|
4
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The NPM scope for this project.
|
|
@@ -38,21 +38,6 @@ 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
|
-
|
|
56
41
|
/**
|
|
57
42
|
* Rule severity.
|
|
58
43
|
* @since 0.0.1
|
|
@@ -90,7 +75,27 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
|
90
75
|
*/
|
|
91
76
|
type RuleStatus = "stable" | "experimental" | "deprecated" | "removed";
|
|
92
77
|
|
|
93
|
-
|
|
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;
|
|
94
99
|
|
|
95
100
|
/**
|
|
96
101
|
* Fallback type.
|
|
@@ -2361,4 +2366,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
2361
2366
|
}
|
|
2362
2367
|
}
|
|
2363
2368
|
|
|
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,
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ } from '@eslint-react/eff';
|
|
2
2
|
import * as tseslint from '@typescript-eslint/utils/ts-eslint';
|
|
3
3
|
import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
|
|
4
|
-
import {
|
|
4
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The NPM scope for this project.
|
|
@@ -38,21 +38,6 @@ 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
|
-
|
|
56
41
|
/**
|
|
57
42
|
* Rule severity.
|
|
58
43
|
* @since 0.0.1
|
|
@@ -90,7 +75,27 @@ type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC";
|
|
|
90
75
|
*/
|
|
91
76
|
type RuleStatus = "stable" | "experimental" | "deprecated" | "removed";
|
|
92
77
|
|
|
93
|
-
|
|
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;
|
|
94
99
|
|
|
95
100
|
/**
|
|
96
101
|
* Fallback type.
|
|
@@ -2361,4 +2366,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
2361
2366
|
}
|
|
2362
2367
|
}
|
|
2363
2368
|
|
|
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,
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,13 @@ 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
|
+
}
|
|
46
53
|
var getDocsUrl = (pluginName) => (ruleName) => {
|
|
47
54
|
if (pluginName === "x") {
|
|
48
55
|
return `${WEBSITE_URL}/docs/rules/${ruleName}`;
|
|
@@ -77,13 +84,6 @@ function getReactVersion(fallback = "19.0.0") {
|
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|
|
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,6 +1334,7 @@ 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;
|
|
1337
1338
|
exports.createRuleForPlugin = createRuleForPlugin;
|
|
1338
1339
|
exports.decodeSettings = decodeSettings;
|
|
1339
1340
|
exports.defineSettings = defineSettings;
|
|
@@ -1342,6 +1343,5 @@ exports.getReactVersion = getReactVersion;
|
|
|
1342
1343
|
exports.getSettingsFromContext = getSettingsFromContext;
|
|
1343
1344
|
exports.isInEditorEnv = isInEditorEnv;
|
|
1344
1345
|
exports.isInGitHooksOrLintStaged = isInGitHooksOrLintStaged;
|
|
1345
|
-
exports.report = report;
|
|
1346
1346
|
exports.toNormalizedSettings = toNormalizedSettings;
|
|
1347
1347
|
exports.unsafeDecodeSettings = unsafeDecodeSettings;
|
package/dist/index.mjs
CHANGED
|
@@ -35,6 +35,13 @@ 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
|
+
}
|
|
38
45
|
var getDocsUrl = (pluginName) => (ruleName) => {
|
|
39
46
|
if (pluginName === "x") {
|
|
40
47
|
return `${WEBSITE_URL}/docs/rules/${ruleName}`;
|
|
@@ -69,13 +76,6 @@ function getReactVersion(fallback = "19.0.0") {
|
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
|
|
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, createRuleForPlugin, decodeSettings, defineSettings, getId, getReactVersion, getSettingsFromContext, isInEditorEnv, isInGitHooksOrLintStaged,
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.1-beta.3",
|
|
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.
|
|
41
|
+
"@eslint-react/eff": "1.37.1-beta.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/picomatch": "^3.0.2",
|