@eslint-react/shared 1.20.2-next.2 → 1.20.2-next.5
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var utils = require('@typescript-eslint/utils');
|
|
4
|
-
var
|
|
4
|
+
var eff = require('@eslint-react/eff');
|
|
5
5
|
var tsPattern = require('ts-pattern');
|
|
6
6
|
var module$1 = require('module');
|
|
7
7
|
var pm = require('picomatch');
|
|
@@ -222,18 +222,18 @@ var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsU
|
|
|
222
222
|
function tryRequire(id, at = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))) {
|
|
223
223
|
const _require = module__default.default.createRequire(at);
|
|
224
224
|
try {
|
|
225
|
-
return
|
|
225
|
+
return eff.E.right(_require(id));
|
|
226
226
|
} catch {
|
|
227
|
-
return
|
|
227
|
+
return eff.E.left(new Error(`Module '${id}' not found`));
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
// src/get-react-version.ts
|
|
232
232
|
function getReactVersion(at = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))) {
|
|
233
|
-
return
|
|
233
|
+
return eff.F.pipe(
|
|
234
234
|
tryRequire("react", at),
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
eff.E.filterOrLeft(tsPattern.isMatching({ version: tsPattern.P.string }), eff.F.identity),
|
|
236
|
+
eff.E.map((mod) => mod.version)
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
239
|
|
|
@@ -1380,10 +1380,10 @@ var normalizeSettings = createMemoizedFunction((settings) => {
|
|
|
1380
1380
|
if (!/^[\w-]+$/u.test(name)) return acc;
|
|
1381
1381
|
return acc.set(name, as);
|
|
1382
1382
|
}, /* @__PURE__ */ new Map()),
|
|
1383
|
-
version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () =>
|
|
1383
|
+
version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => eff.E.getOrElse(getReactVersion(), eff.F.constant("19.0.0"))).otherwise(eff.F.identity)
|
|
1384
1384
|
};
|
|
1385
1385
|
}, { isEqual: shallowEqual });
|
|
1386
|
-
var defineSettings =
|
|
1386
|
+
var defineSettings = eff.F.identity;
|
|
1387
1387
|
|
|
1388
1388
|
exports.CustomAttributeSchema = CustomAttributeSchema;
|
|
1389
1389
|
exports.CustomComponentNormalizedSchema = CustomComponentNormalizedSchema;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.20.2-next.
|
|
3
|
+
"version": "1.20.2-next.5",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@typescript-eslint/utils": "^8.18.1",
|
|
39
39
|
"picomatch": "^4.0.2",
|
|
40
40
|
"ts-pattern": "^5.6.0",
|
|
41
|
-
"@eslint-react/
|
|
41
|
+
"@eslint-react/eff": "1.20.2-next.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/picomatch": "^3.0.1",
|