@eslint-react/shared 2.7.2-next.2 → 2.7.2-next.4
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 +11 -2
- package/dist/index.js +20 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unit } from "@eslint-react/eff";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
-
import { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
+
import { ReportDescriptor, RuleListener } from "@typescript-eslint/utils/ts-eslint";
|
|
5
5
|
|
|
6
6
|
//#region src/_id.d.ts
|
|
7
7
|
/**
|
|
@@ -185,6 +185,15 @@ declare const RE_COMPONENT_NAME_LOOSE: RegExp;
|
|
|
185
185
|
*/
|
|
186
186
|
declare const RE_HOOK_NAME: RegExp;
|
|
187
187
|
//#endregion
|
|
188
|
+
//#region src/define-rule-listener.d.ts
|
|
189
|
+
/**
|
|
190
|
+
* Defines a RuleListener by merging multiple visitor objects
|
|
191
|
+
* @param visitor The base visitor object
|
|
192
|
+
* @param visitors Additional visitor objects to merge
|
|
193
|
+
* @returns The merged RuleListener
|
|
194
|
+
*/
|
|
195
|
+
declare function defineRuleListener(visitor: RuleListener, ...visitors: RuleListener[]): RuleListener;
|
|
196
|
+
//#endregion
|
|
188
197
|
//#region src/react-version.d.ts
|
|
189
198
|
declare function getReactVersion(fallback: string): string;
|
|
190
199
|
//#endregion
|
|
@@ -324,4 +333,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
324
333
|
}
|
|
325
334
|
}
|
|
326
335
|
//#endregion
|
|
327
|
-
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, 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, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
|
|
336
|
+
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, GITHUB_URL, 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, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, SettingsConfig, Severity, SeverityLevel, SeverityName, WEBSITE_URL, coerceESLintSettings, coerceSettings, decodeESLintSettings, decodeSettings, defineRuleListener, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
|
package/dist/index.js
CHANGED
|
@@ -133,6 +133,25 @@ const RE_COMPONENT_NAME_LOOSE = /^_?[A-Z]/u;
|
|
|
133
133
|
*/
|
|
134
134
|
const RE_HOOK_NAME = /^use/u;
|
|
135
135
|
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/define-rule-listener.ts
|
|
138
|
+
/**
|
|
139
|
+
* Defines a RuleListener by merging multiple visitor objects
|
|
140
|
+
* @param visitor The base visitor object
|
|
141
|
+
* @param visitors Additional visitor objects to merge
|
|
142
|
+
* @returns The merged RuleListener
|
|
143
|
+
*/
|
|
144
|
+
function defineRuleListener(visitor, ...visitors) {
|
|
145
|
+
for (const v of visitors) for (const key in v) if (visitor[key] != null) {
|
|
146
|
+
const o = visitor[key];
|
|
147
|
+
visitor[key] = (...args) => {
|
|
148
|
+
o(...args);
|
|
149
|
+
v[key]?.(...args);
|
|
150
|
+
};
|
|
151
|
+
} else visitor[key] = v[key];
|
|
152
|
+
return visitor;
|
|
153
|
+
}
|
|
154
|
+
|
|
136
155
|
//#endregion
|
|
137
156
|
//#region src/react-version.ts
|
|
138
157
|
const _require = module.createRequire(process.cwd() + path.sep);
|
|
@@ -281,4 +300,4 @@ function getSettingsFromContext(context) {
|
|
|
281
300
|
const defineSettings = identity;
|
|
282
301
|
|
|
283
302
|
//#endregion
|
|
284
|
-
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, 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, defineSettings, getConfigAdapters, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, report, toRegExp };
|
|
303
|
+
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "2.7.2-next.
|
|
3
|
+
"version": "2.7.2-next.4",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@typescript-eslint/utils": "^8.53.0",
|
|
34
34
|
"ts-pattern": "^5.9.0",
|
|
35
35
|
"zod": "^3.25.0 || ^4.0.0",
|
|
36
|
-
"@eslint-react/eff": "2.7.2-next.
|
|
36
|
+
"@eslint-react/eff": "2.7.2-next.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@tsconfig/node22": "^22.0.5",
|