@eslint-react/shared 1.48.3-next.0 → 1.48.3
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 +307 -308
- package/dist/index.d.ts +307 -308
- package/dist/index.js +19 -19
- package/dist/index.mjs +19 -19
- package/package.json +3 -3
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
|
|
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
|
-
|
|
248
|
-
name,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
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(
|
|
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
|
|
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
|
-
|
|
222
|
-
name,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
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(
|
|
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.3
|
|
3
|
+
"version": "1.48.3",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@typescript-eslint/utils": "^8.30.1",
|
|
39
39
|
"@zod/mini": "^4.0.0-beta.20250415T232143",
|
|
40
40
|
"ts-pattern": "^5.7.0",
|
|
41
|
-
"@eslint-react/eff": "1.48.3
|
|
42
|
-
"@eslint-react/kit": "1.48.3
|
|
41
|
+
"@eslint-react/eff": "1.48.3",
|
|
42
|
+
"@eslint-react/kit": "1.48.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@tsconfig/node22": "^22.0.1",
|