@eslint-react/shared 1.6.0-next.2 → 1.6.0-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.mts +16 -22
- package/dist/index.d.ts +16 -22
- package/dist/index.js +4 -8
- package/dist/index.mjs +3 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -83,16 +83,12 @@ declare const CustomAttributeSchema: valibot.ObjectSchema<{
|
|
|
83
83
|
* Which attributes are used as `children` props for a user-defined `Button` component to receive children of that component.
|
|
84
84
|
*/
|
|
85
85
|
declare const CustomComponentSchema: valibot.ObjectSchema<{
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
90
86
|
/**
|
|
91
87
|
* The name of the user-defined component.
|
|
92
88
|
* @example
|
|
93
89
|
* "Link"
|
|
94
90
|
*/
|
|
95
|
-
readonly name: valibot.
|
|
91
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
96
92
|
/**
|
|
97
93
|
* The ESQuery selector to select the component precisely.
|
|
98
94
|
* @example
|
|
@@ -147,16 +143,12 @@ declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
|
|
|
147
143
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
148
144
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
149
145
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
150
|
-
/**
|
|
151
|
-
* @internal
|
|
152
|
-
*/
|
|
153
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
154
146
|
/**
|
|
155
147
|
* The name of the user-defined component.
|
|
156
148
|
* @example
|
|
157
149
|
* "Link"
|
|
158
150
|
*/
|
|
159
|
-
readonly name: valibot.
|
|
151
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
160
152
|
/**
|
|
161
153
|
* The ESQuery selector to select the component precisely.
|
|
162
154
|
* @example
|
|
@@ -233,16 +225,12 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
|
|
|
233
225
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
234
226
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
235
227
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
236
|
-
/**
|
|
237
|
-
* @internal
|
|
238
|
-
*/
|
|
239
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
240
228
|
/**
|
|
241
229
|
* The name of the user-defined component.
|
|
242
230
|
* @example
|
|
243
231
|
* "Link"
|
|
244
232
|
*/
|
|
245
|
-
readonly name: valibot.
|
|
233
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
246
234
|
/**
|
|
247
235
|
* The ESQuery selector to select the component precisely.
|
|
248
236
|
* @example
|
|
@@ -319,16 +307,12 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
|
|
|
319
307
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
320
308
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
321
309
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
322
|
-
/**
|
|
323
|
-
* @internal
|
|
324
|
-
*/
|
|
325
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
326
310
|
/**
|
|
327
311
|
* The name of the user-defined component.
|
|
328
312
|
* @example
|
|
329
313
|
* "Link"
|
|
330
314
|
*/
|
|
331
|
-
readonly name: valibot.
|
|
315
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
332
316
|
/**
|
|
333
317
|
* The ESQuery selector to select the component precisely.
|
|
334
318
|
* @example
|
|
@@ -401,8 +385,18 @@ type CustomComponent = InferOutput<typeof CustomComponentSchema>;
|
|
|
401
385
|
type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
|
|
402
386
|
type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
|
|
403
387
|
|
|
388
|
+
interface CustomComponentExpanded extends CustomComponent {
|
|
389
|
+
attributes: {
|
|
390
|
+
name: string;
|
|
391
|
+
as: string;
|
|
392
|
+
}[];
|
|
393
|
+
re: RegExp;
|
|
394
|
+
}
|
|
395
|
+
interface ESLintReactSettingsExpanded extends ESLintReactSettings {
|
|
396
|
+
additionalComponents: CustomComponentExpanded[];
|
|
397
|
+
}
|
|
404
398
|
declare function decodeSettings(data: unknown): ESLintReactSettings;
|
|
405
|
-
declare const expandSettings: micro_memoize.Memoized<(settings: ESLintReactSettings) =>
|
|
399
|
+
declare const expandSettings: micro_memoize.Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsExpanded>;
|
|
406
400
|
declare const DEFAULT_ESLINT_REACT_SETTINGS: ESLintReactSettings;
|
|
407
401
|
|
|
408
|
-
export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, expandSettings };
|
|
402
|
+
export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentExpanded, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsExpanded, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, expandSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -83,16 +83,12 @@ declare const CustomAttributeSchema: valibot.ObjectSchema<{
|
|
|
83
83
|
* Which attributes are used as `children` props for a user-defined `Button` component to receive children of that component.
|
|
84
84
|
*/
|
|
85
85
|
declare const CustomComponentSchema: valibot.ObjectSchema<{
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
90
86
|
/**
|
|
91
87
|
* The name of the user-defined component.
|
|
92
88
|
* @example
|
|
93
89
|
* "Link"
|
|
94
90
|
*/
|
|
95
|
-
readonly name: valibot.
|
|
91
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
96
92
|
/**
|
|
97
93
|
* The ESQuery selector to select the component precisely.
|
|
98
94
|
* @example
|
|
@@ -147,16 +143,12 @@ declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
|
|
|
147
143
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
148
144
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
149
145
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
150
|
-
/**
|
|
151
|
-
* @internal
|
|
152
|
-
*/
|
|
153
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
154
146
|
/**
|
|
155
147
|
* The name of the user-defined component.
|
|
156
148
|
* @example
|
|
157
149
|
* "Link"
|
|
158
150
|
*/
|
|
159
|
-
readonly name: valibot.
|
|
151
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
160
152
|
/**
|
|
161
153
|
* The ESQuery selector to select the component precisely.
|
|
162
154
|
* @example
|
|
@@ -233,16 +225,12 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
|
|
|
233
225
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
234
226
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
235
227
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
236
|
-
/**
|
|
237
|
-
* @internal
|
|
238
|
-
*/
|
|
239
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
240
228
|
/**
|
|
241
229
|
* The name of the user-defined component.
|
|
242
230
|
* @example
|
|
243
231
|
* "Link"
|
|
244
232
|
*/
|
|
245
|
-
readonly name: valibot.
|
|
233
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
246
234
|
/**
|
|
247
235
|
* The ESQuery selector to select the component precisely.
|
|
248
236
|
* @example
|
|
@@ -319,16 +307,12 @@ declare const ESLintSettingsSchema: valibot.OptionalSchema<valibot.ObjectSchema<
|
|
|
319
307
|
readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
|
|
320
308
|
readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
321
309
|
readonly additionalComponents: valibot.OptionalSchema<valibot.ArraySchema<valibot.ObjectSchema<{
|
|
322
|
-
/**
|
|
323
|
-
* @internal
|
|
324
|
-
*/
|
|
325
|
-
readonly re: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
|
|
326
310
|
/**
|
|
327
311
|
* The name of the user-defined component.
|
|
328
312
|
* @example
|
|
329
313
|
* "Link"
|
|
330
314
|
*/
|
|
331
|
-
readonly name: valibot.
|
|
315
|
+
readonly name: valibot.StringSchema<undefined>;
|
|
332
316
|
/**
|
|
333
317
|
* The ESQuery selector to select the component precisely.
|
|
334
318
|
* @example
|
|
@@ -401,8 +385,18 @@ type CustomComponent = InferOutput<typeof CustomComponentSchema>;
|
|
|
401
385
|
type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
|
|
402
386
|
type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
|
|
403
387
|
|
|
388
|
+
interface CustomComponentExpanded extends CustomComponent {
|
|
389
|
+
attributes: {
|
|
390
|
+
name: string;
|
|
391
|
+
as: string;
|
|
392
|
+
}[];
|
|
393
|
+
re: RegExp;
|
|
394
|
+
}
|
|
395
|
+
interface ESLintReactSettingsExpanded extends ESLintReactSettings {
|
|
396
|
+
additionalComponents: CustomComponentExpanded[];
|
|
397
|
+
}
|
|
404
398
|
declare function decodeSettings(data: unknown): ESLintReactSettings;
|
|
405
|
-
declare const expandSettings: micro_memoize.Memoized<(settings: ESLintReactSettings) =>
|
|
399
|
+
declare const expandSettings: micro_memoize.Memoized<(settings: ESLintReactSettings) => ESLintReactSettingsExpanded>;
|
|
406
400
|
declare const DEFAULT_ESLINT_REACT_SETTINGS: ESLintReactSettings;
|
|
407
401
|
|
|
408
|
-
export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, expandSettings };
|
|
402
|
+
export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentExpanded, CustomComponentSchema, type CustomHook, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, type ESLintReactSettings, type ESLintReactSettingsExpanded, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, expandSettings };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var utils = require('@typescript-eslint/utils');
|
|
4
|
-
var
|
|
4
|
+
var pm = require('picomatch');
|
|
5
5
|
|
|
6
6
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var pm__default = /*#__PURE__*/_interopDefault(pm);
|
|
9
9
|
|
|
10
10
|
// src/constants.ts
|
|
11
11
|
var NPM_SCOPE = "@eslint-react";
|
|
@@ -507,16 +507,12 @@ var CustomAttributeSchema = object({
|
|
|
507
507
|
defaultValue: optional(string())
|
|
508
508
|
});
|
|
509
509
|
var CustomComponentSchema = object({
|
|
510
|
-
/**
|
|
511
|
-
* @internal
|
|
512
|
-
*/
|
|
513
|
-
re: optional(string()),
|
|
514
510
|
/**
|
|
515
511
|
* The name of the user-defined component.
|
|
516
512
|
* @example
|
|
517
513
|
* "Link"
|
|
518
514
|
*/
|
|
519
|
-
name:
|
|
515
|
+
name: string(),
|
|
520
516
|
/**
|
|
521
517
|
* The ESQuery selector to select the component precisely.
|
|
522
518
|
* @example
|
|
@@ -871,7 +867,7 @@ var expandSettings = createMemoizedFunction((settings) => {
|
|
|
871
867
|
...attr,
|
|
872
868
|
as: attr.as ?? attr.name
|
|
873
869
|
})) ?? [],
|
|
874
|
-
re:
|
|
870
|
+
re: pm__default.default.toRegex(pm__default.default.parse(component.name).output)
|
|
875
871
|
})) ?? []
|
|
876
872
|
};
|
|
877
873
|
}, { isDeepEqual: false });
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
import
|
|
2
|
+
import pm from 'picomatch';
|
|
3
3
|
|
|
4
4
|
// src/constants.ts
|
|
5
5
|
var NPM_SCOPE = "@eslint-react";
|
|
@@ -501,16 +501,12 @@ var CustomAttributeSchema = object({
|
|
|
501
501
|
defaultValue: optional(string())
|
|
502
502
|
});
|
|
503
503
|
var CustomComponentSchema = object({
|
|
504
|
-
/**
|
|
505
|
-
* @internal
|
|
506
|
-
*/
|
|
507
|
-
re: optional(string()),
|
|
508
504
|
/**
|
|
509
505
|
* The name of the user-defined component.
|
|
510
506
|
* @example
|
|
511
507
|
* "Link"
|
|
512
508
|
*/
|
|
513
|
-
name:
|
|
509
|
+
name: string(),
|
|
514
510
|
/**
|
|
515
511
|
* The ESQuery selector to select the component precisely.
|
|
516
512
|
* @example
|
|
@@ -865,7 +861,7 @@ var expandSettings = createMemoizedFunction((settings) => {
|
|
|
865
861
|
...attr,
|
|
866
862
|
as: attr.as ?? attr.name
|
|
867
863
|
})) ?? [],
|
|
868
|
-
re:
|
|
864
|
+
re: pm.toRegex(pm.parse(component.name).output)
|
|
869
865
|
})) ?? []
|
|
870
866
|
};
|
|
871
867
|
}, { isDeepEqual: false });
|