@eslint-react/shared 5.1.0-beta.0 → 5.1.0-beta.1
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 +2 -29
- package/dist/index.js +1 -29
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
-
import { ReportFixFunction, RuleFix, RuleFixer, RuleListener, RuleListener as RuleListener$1 } from "@typescript-eslint/utils/ts-eslint";
|
|
4
3
|
|
|
5
|
-
//#region src/define-rule-listener.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Defines a rule listener by merging multiple visitor objects
|
|
8
|
-
*
|
|
9
|
-
* @param base Base visitor object (target of merge)
|
|
10
|
-
* @param rest Additional visitor objects to merge (one or more)
|
|
11
|
-
* @returns Merged RuleListener object
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const listener1 = { Identifier: () => console.log(1) };
|
|
16
|
-
* const listener2 = { Identifier: () => console.log(2) };
|
|
17
|
-
* const merged = defineRuleListener(listener1, listener2);
|
|
18
|
-
* // When encountering Identifier nodes, outputs 1 then 2
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
declare function defineRuleListener(base: RuleListener$1, ...rest: RuleListener$1[]): RuleListener$1;
|
|
22
|
-
//#endregion
|
|
23
4
|
//#region src/regexp.d.ts
|
|
24
5
|
/**
|
|
25
6
|
* Regular expressions for matching a HTML tag name
|
|
@@ -112,6 +93,7 @@ declare function toRegExp(string: string | null | undefined): RegExpLike;
|
|
|
112
93
|
*/
|
|
113
94
|
declare function isRegExp(string: string): boolean;
|
|
114
95
|
//#endregion
|
|
96
|
+
//#region ../eslint/dist/index.d.ts
|
|
115
97
|
//#region src/types.d.ts
|
|
116
98
|
/**
|
|
117
99
|
* Rule context.
|
|
@@ -122,15 +104,6 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
122
104
|
* Rule feature.
|
|
123
105
|
* @since 1.20.0
|
|
124
106
|
*/
|
|
125
|
-
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
126
|
-
/**
|
|
127
|
-
* A suggestion for fixing a reported issue.
|
|
128
|
-
*/
|
|
129
|
-
type RuleSuggest<MessageIds extends string = string> = {
|
|
130
|
-
/** Optional data to pass to the message formatter. */data?: Record<string, unknown>; /** The fix function to apply the suggestion. */
|
|
131
|
-
fix: tseslint.ReportFixFunction; /** The message ID for the suggestion. */
|
|
132
|
-
messageId: MessageIds;
|
|
133
|
-
};
|
|
134
107
|
//#endregion
|
|
135
108
|
//#region src/settings.d.ts
|
|
136
109
|
/**
|
|
@@ -210,4 +183,4 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
210
183
|
}
|
|
211
184
|
}
|
|
212
185
|
//#endregion
|
|
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,
|
|
186
|
+
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, decodeESLintSettings, decodeSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
|
package/dist/index.js
CHANGED
|
@@ -3,34 +3,6 @@ import path from "node:path";
|
|
|
3
3
|
import { P, match } from "ts-pattern";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
5
|
|
|
6
|
-
//#region src/define-rule-listener.ts
|
|
7
|
-
/**
|
|
8
|
-
* Defines a rule listener by merging multiple visitor objects
|
|
9
|
-
*
|
|
10
|
-
* @param base Base visitor object (target of merge)
|
|
11
|
-
* @param rest Additional visitor objects to merge (one or more)
|
|
12
|
-
* @returns Merged RuleListener object
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const listener1 = { Identifier: () => console.log(1) };
|
|
17
|
-
* const listener2 = { Identifier: () => console.log(2) };
|
|
18
|
-
* const merged = defineRuleListener(listener1, listener2);
|
|
19
|
-
* // When encountering Identifier nodes, outputs 1 then 2
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
function defineRuleListener(base, ...rest) {
|
|
23
|
-
for (const r of rest) for (const key in r) {
|
|
24
|
-
const existing = base[key];
|
|
25
|
-
base[key] = existing ? (...args) => {
|
|
26
|
-
existing(...args);
|
|
27
|
-
r[key]?.(...args);
|
|
28
|
-
} : r[key];
|
|
29
|
-
}
|
|
30
|
-
return base;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//#endregion
|
|
34
6
|
//#region ../../../.pkgs/eff/dist/index.js
|
|
35
7
|
/**
|
|
36
8
|
* Returns its argument.
|
|
@@ -337,4 +309,4 @@ function getSettingsFromContext(context) {
|
|
|
337
309
|
}
|
|
338
310
|
|
|
339
311
|
//#endregion
|
|
340
|
-
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, 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, decodeESLintSettings, decodeSettings,
|
|
312
|
+
export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettingsSchema, 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, decodeESLintSettings, decodeSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "5.1.0-beta.
|
|
3
|
+
"version": "5.1.0-beta.1",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"eslint": "^10.2.0",
|
|
47
|
-
"typescript": "*"
|
|
47
|
+
"typescript": "*",
|
|
48
|
+
"@eslint-react/eslint": "5.1.0-beta.1"
|
|
48
49
|
},
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=22.0.0"
|