@eslint-react/shared 1.5.31-beta.0 → 1.5.31-beta.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 CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  import * as valibot from 'valibot';
3
3
  import { InferOutput } from 'valibot';
4
- import { ReadonlyDeep } from 'type-fest';
5
4
 
6
5
  /**
7
6
  * -----------------------------------------------------------------------------
@@ -118,7 +117,7 @@ declare const CustomComponentSchema: valibot.ObjectSchema<{
118
117
  /**
119
118
  * @internal
120
119
  */
121
- declare const ESLintReactXSettingsSchema: valibot.ObjectSchema<{
120
+ declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
122
121
  readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
123
122
  readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
124
123
  readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
@@ -255,6 +254,7 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
255
254
  }, undefined>, never>;
256
255
  }, undefined>, never>;
257
256
  /**
257
+ * @internal
258
258
  * @deprecated
259
259
  */
260
260
  readonly reactOptions: valibot.OptionalSchema<valibot.ObjectSchema<{
@@ -324,9 +324,13 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
324
324
  }, undefined>, never>;
325
325
  }, undefined>, never>;
326
326
  }, undefined>;
327
- type ESLintReactXSettings = ReadonlyDeep<InferOutput<typeof ESLintReactXSettingsSchema>>;
328
- type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
327
+ type CustomHook = InferOutput<typeof CustomHookSchema>;
328
+ type CustomAttribute = InferOutput<typeof CustomAttributeSchema>;
329
+ type CustomComponent = InferOutput<typeof CustomComponentSchema>;
330
+ type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
331
+ type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
329
332
 
330
333
  declare function parseESLintSettings(data: unknown): ESLintSettings;
334
+ declare const DEFAULT_ESLINT_REACT_SETTINGS: ESLintReactSettings;
331
335
 
332
- export { CustomAttributeSchema, CustomComponentSchema, CustomHookSchema, type ESLintReactXSettings, ESLintReactXSettingsSchema, 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, parseESLintSettings };
336
+ 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, parseESLintSettings };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  import * as valibot from 'valibot';
3
3
  import { InferOutput } from 'valibot';
4
- import { ReadonlyDeep } from 'type-fest';
5
4
 
6
5
  /**
7
6
  * -----------------------------------------------------------------------------
@@ -118,7 +117,7 @@ declare const CustomComponentSchema: valibot.ObjectSchema<{
118
117
  /**
119
118
  * @internal
120
119
  */
121
- declare const ESLintReactXSettingsSchema: valibot.ObjectSchema<{
120
+ declare const ESLintReactSettingsSchema: valibot.ObjectSchema<{
122
121
  readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
123
122
  readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
124
123
  readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
@@ -255,6 +254,7 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
255
254
  }, undefined>, never>;
256
255
  }, undefined>, never>;
257
256
  /**
257
+ * @internal
258
258
  * @deprecated
259
259
  */
260
260
  readonly reactOptions: valibot.OptionalSchema<valibot.ObjectSchema<{
@@ -324,9 +324,13 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
324
324
  }, undefined>, never>;
325
325
  }, undefined>, never>;
326
326
  }, undefined>;
327
- type ESLintReactXSettings = ReadonlyDeep<InferOutput<typeof ESLintReactXSettingsSchema>>;
328
- type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
327
+ type CustomHook = InferOutput<typeof CustomHookSchema>;
328
+ type CustomAttribute = InferOutput<typeof CustomAttributeSchema>;
329
+ type CustomComponent = InferOutput<typeof CustomComponentSchema>;
330
+ type ESLintReactSettings = InferOutput<typeof ESLintReactSettingsSchema>;
331
+ type ESLintSettings = InferOutput<typeof ESLintSettingsSchema>;
329
332
 
330
333
  declare function parseESLintSettings(data: unknown): ESLintSettings;
334
+ declare const DEFAULT_ESLINT_REACT_SETTINGS: ESLintReactSettings;
331
335
 
332
- export { CustomAttributeSchema, CustomComponentSchema, CustomHookSchema, type ESLintReactXSettings, ESLintReactXSettingsSchema, 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, parseESLintSettings };
336
+ 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, parseESLintSettings };
package/dist/index.js CHANGED
@@ -515,7 +515,7 @@ var CustomComponentSchema = object({
515
515
  */
516
516
  attributes: optional(array(CustomAttributeSchema))
517
517
  });
518
- var ESLintReactXSettingsSchema = object({
518
+ var ESLintReactSettingsSchema = object({
519
519
  importSource: optional(string()),
520
520
  jsxPragma: optional(string()),
521
521
  jsxPragmaFrag: optional(string()),
@@ -544,22 +544,44 @@ var ESLintReactXSettingsSchema = object({
544
544
  }))
545
545
  });
546
546
  var ESLintSettingsSchema = object({
547
- "react-x": optional(ESLintReactXSettingsSchema),
547
+ "react-x": optional(ESLintReactSettingsSchema),
548
548
  /**
549
+ * @internal
549
550
  * @deprecated
550
551
  */
551
- reactOptions: optional(ESLintReactXSettingsSchema)
552
+ reactOptions: optional(ESLintReactSettingsSchema)
552
553
  });
553
554
 
554
555
  // src/settings.ts
555
556
  function parseESLintSettings(data) {
556
557
  return parse(ESLintSettingsSchema, data);
557
558
  }
559
+ var DEFAULT_ESLINT_REACT_SETTINGS = {
560
+ additionalComponents: [
561
+ {
562
+ name: "Link",
563
+ as: "a",
564
+ attributes: [
565
+ {
566
+ name: "to",
567
+ as: "href"
568
+ }
569
+ ]
570
+ }
571
+ ],
572
+ additionalHooks: {
573
+ useLayoutEffect: [
574
+ "useIsomorphicLayoutEffect"
575
+ ]
576
+ },
577
+ version: "detect"
578
+ };
558
579
 
559
580
  exports.CustomAttributeSchema = CustomAttributeSchema;
560
581
  exports.CustomComponentSchema = CustomComponentSchema;
561
582
  exports.CustomHookSchema = CustomHookSchema;
562
- exports.ESLintReactXSettingsSchema = ESLintReactXSettingsSchema;
583
+ exports.DEFAULT_ESLINT_REACT_SETTINGS = DEFAULT_ESLINT_REACT_SETTINGS;
584
+ exports.ESLintReactSettingsSchema = ESLintReactSettingsSchema;
563
585
  exports.ESLintSettingsSchema = ESLintSettingsSchema;
564
586
  exports.GITHUB_URL = GITHUB_URL;
565
587
  exports.HOST_HTML_COMPONENT_TYPES = HOST_HTML_COMPONENT_TYPES;
package/dist/index.mjs CHANGED
@@ -513,7 +513,7 @@ var CustomComponentSchema = object({
513
513
  */
514
514
  attributes: optional(array(CustomAttributeSchema))
515
515
  });
516
- var ESLintReactXSettingsSchema = object({
516
+ var ESLintReactSettingsSchema = object({
517
517
  importSource: optional(string()),
518
518
  jsxPragma: optional(string()),
519
519
  jsxPragmaFrag: optional(string()),
@@ -542,16 +542,37 @@ var ESLintReactXSettingsSchema = object({
542
542
  }))
543
543
  });
544
544
  var ESLintSettingsSchema = object({
545
- "react-x": optional(ESLintReactXSettingsSchema),
545
+ "react-x": optional(ESLintReactSettingsSchema),
546
546
  /**
547
+ * @internal
547
548
  * @deprecated
548
549
  */
549
- reactOptions: optional(ESLintReactXSettingsSchema)
550
+ reactOptions: optional(ESLintReactSettingsSchema)
550
551
  });
551
552
 
552
553
  // src/settings.ts
553
554
  function parseESLintSettings(data) {
554
555
  return parse(ESLintSettingsSchema, data);
555
556
  }
557
+ var DEFAULT_ESLINT_REACT_SETTINGS = {
558
+ additionalComponents: [
559
+ {
560
+ name: "Link",
561
+ as: "a",
562
+ attributes: [
563
+ {
564
+ name: "to",
565
+ as: "href"
566
+ }
567
+ ]
568
+ }
569
+ ],
570
+ additionalHooks: {
571
+ useLayoutEffect: [
572
+ "useIsomorphicLayoutEffect"
573
+ ]
574
+ },
575
+ version: "detect"
576
+ };
556
577
 
557
- export { CustomAttributeSchema, CustomComponentSchema, CustomHookSchema, ESLintReactXSettingsSchema, 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, parseESLintSettings };
578
+ export { CustomAttributeSchema, CustomComponentSchema, CustomHookSchema, DEFAULT_ESLINT_REACT_SETTINGS, ESLintReactSettingsSchema, 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, parseESLintSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.5.31-beta.0",
3
+ "version": "1.5.31-beta.4",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {