@eslint-react/shared 1.48.2 → 1.48.3-next.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.js CHANGED
@@ -3,8 +3,8 @@
3
3
  var module$1 = require('module');
4
4
  var eff = require('@eslint-react/eff');
5
5
  var tsPattern = require('ts-pattern');
6
- var z = require('@zod/mini');
7
6
  var kit = require('@eslint-react/kit');
7
+ var z = require('@zod/mini');
8
8
 
9
9
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
10
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -47,7 +47,7 @@ var getDocsUrl = (pluginName) => (ruleName) => {
47
47
  var id = 0n;
48
48
  var getId = () => (id++).toString();
49
49
  var _require = module__default.default.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
50
- function getReactVersion(fallback = "19.0.0") {
50
+ function getReactVersion(fallback) {
51
51
  try {
52
52
  return tsPattern.match(_require("react")).with({ version: tsPattern.P.select(tsPattern.P.string) }, eff.identity).otherwise(() => fallback);
53
53
  } catch {
@@ -242,30 +242,30 @@ var normalizeSettings = ({
242
242
  version,
243
243
  ...rest
244
244
  }) => {
245
+ const fallbackVersion = DEFAULT_ESLINT_REACT_SETTINGS.version;
245
246
  return {
246
247
  ...rest,
247
- additionalComponents: additionalComponents.map(({
248
- name,
249
- as = name,
250
- attributes = [],
251
- ...rest2
252
- }) => ({
253
- ...rest2,
254
- name,
255
- as,
256
- attributes: attributes.map(({ name: name2, as: as2 = name2, ...rest3 }) => ({
257
- ...rest3,
258
- name: name2,
259
- as: as2
260
- })),
261
- re: kit.RegExp.toRegExp(name)
262
- })),
248
+ components: additionalComponents.map((component) => {
249
+ const { name, as = name, attributes = [], ...rest2 } = component;
250
+ const re = kit.RegExp.toRegExp(name);
251
+ return {
252
+ ...rest2,
253
+ name,
254
+ re,
255
+ as,
256
+ attributes: attributes.map(({ name: name2, as: as2 = name2, ...rest3 }) => ({
257
+ ...rest3,
258
+ name: name2,
259
+ as: as2
260
+ }))
261
+ };
262
+ }),
263
263
  additionalHooks,
264
264
  importSource,
265
265
  polymorphicPropName,
266
266
  skipImportCheck,
267
267
  strict,
268
- version: tsPattern.match(version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => getReactVersion("19.1.0")).otherwise(eff.identity)
268
+ version: tsPattern.match(version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => getReactVersion(fallbackVersion)).otherwise(eff.identity)
269
269
  };
270
270
  };
271
271
  var cache = /* @__PURE__ */ new Map();
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import module from 'node:module';
2
2
  import { identity, getOrElseUpdate } from '@eslint-react/eff';
3
3
  import { match, P } from 'ts-pattern';
4
- import * as z from '@zod/mini';
5
4
  import { RegExp } from '@eslint-react/kit';
5
+ import * as z from '@zod/mini';
6
6
 
7
7
  // src/constants.ts
8
8
  var NPM_SCOPE = "@eslint-react";
@@ -21,7 +21,7 @@ var getDocsUrl = (pluginName) => (ruleName) => {
21
21
  var id = 0n;
22
22
  var getId = () => (id++).toString();
23
23
  var _require = module.createRequire(import.meta.url);
24
- function getReactVersion(fallback = "19.0.0") {
24
+ function getReactVersion(fallback) {
25
25
  try {
26
26
  return match(_require("react")).with({ version: P.select(P.string) }, identity).otherwise(() => fallback);
27
27
  } catch {
@@ -216,30 +216,30 @@ var normalizeSettings = ({
216
216
  version,
217
217
  ...rest
218
218
  }) => {
219
+ const fallbackVersion = DEFAULT_ESLINT_REACT_SETTINGS.version;
219
220
  return {
220
221
  ...rest,
221
- additionalComponents: additionalComponents.map(({
222
- name,
223
- as = name,
224
- attributes = [],
225
- ...rest2
226
- }) => ({
227
- ...rest2,
228
- name,
229
- as,
230
- attributes: attributes.map(({ name: name2, as: as2 = name2, ...rest3 }) => ({
231
- ...rest3,
232
- name: name2,
233
- as: as2
234
- })),
235
- re: RegExp.toRegExp(name)
236
- })),
222
+ components: additionalComponents.map((component) => {
223
+ const { name, as = name, attributes = [], ...rest2 } = component;
224
+ const re = RegExp.toRegExp(name);
225
+ return {
226
+ ...rest2,
227
+ name,
228
+ re,
229
+ as,
230
+ attributes: attributes.map(({ name: name2, as: as2 = name2, ...rest3 }) => ({
231
+ ...rest3,
232
+ name: name2,
233
+ as: as2
234
+ }))
235
+ };
236
+ }),
237
237
  additionalHooks,
238
238
  importSource,
239
239
  polymorphicPropName,
240
240
  skipImportCheck,
241
241
  strict,
242
- version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.1.0")).otherwise(identity)
242
+ version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion(fallbackVersion)).otherwise(identity)
243
243
  };
244
244
  };
245
245
  var cache = /* @__PURE__ */ new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.48.2",
3
+ "version": "1.48.3-next.1",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -36,10 +36,10 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@typescript-eslint/utils": "^8.30.1",
39
- "@zod/mini": "^4.0.0-beta.0",
39
+ "@zod/mini": "^4.0.0-beta.20250415T232143",
40
40
  "ts-pattern": "^5.7.0",
41
- "@eslint-react/kit": "1.48.2",
42
- "@eslint-react/eff": "1.48.2"
41
+ "@eslint-react/kit": "1.48.3-next.1",
42
+ "@eslint-react/eff": "1.48.3-next.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@tsconfig/node22": "^22.0.1",