@eslint-react/shared
Advanced tools
Comparing version 1.20.0 to 1.20.1-beta.2
@@ -5,8 +5,10 @@ 'use strict'; | ||
var tools = require('@eslint-react/tools'); | ||
var localPkg = require('local-pkg'); | ||
var tsPattern = require('ts-pattern'); | ||
var module$1 = require('module'); | ||
var pm = require('picomatch'); | ||
var tsPattern = require('ts-pattern'); | ||
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; | ||
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } | ||
var module__default = /*#__PURE__*/_interopDefault(module$1); | ||
var pm__default = /*#__PURE__*/_interopDefault(pm); | ||
@@ -221,3 +223,20 @@ | ||
var createRuleForPlugin = (pluginName) => utils.ESLintUtils.RuleCreator(getDocsUrl(pluginName)); | ||
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))) { | ||
const _require = module__default.default.createRequire(at); | ||
try { | ||
return tools.E.right(_require(id)); | ||
} catch { | ||
return tools.E.left(new Error(`Module '${id}' not found`)); | ||
} | ||
} | ||
// src/get-react-version.ts | ||
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))) { | ||
return tools.F.pipe( | ||
tryRequire("react", at), | ||
tools.E.filterOrLeft(tsPattern.isMatching({ version: tsPattern.P.string }), tools.F.identity), | ||
tools.E.map((mod) => mod.version) | ||
); | ||
} | ||
// ../../node_modules/.pnpm/valibot@1.0.0-beta.9_typescript@5.7.2/node_modules/valibot/dist/index.js | ||
@@ -1366,3 +1385,3 @@ var store; | ||
}, /* @__PURE__ */ new Map()), | ||
version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => localPkg.getPackageInfoSync("react")?.version ?? "19.0.0").otherwise(tools.F.identity) | ||
version: tsPattern.match(settings.version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => tools.E.getOrElse(getReactVersion(), tools.F.constant("19.0.0"))).otherwise(tools.F.identity) | ||
}; | ||
@@ -1394,3 +1413,4 @@ }, { isEqual: shallowEqual }); | ||
exports.defineSettings = defineSettings; | ||
exports.getReactVersion = getReactVersion; | ||
exports.normalizeSettings = normalizeSettings; | ||
exports.unsafeReadSettings = unsafeReadSettings; |
{ | ||
"name": "@eslint-react/shared", | ||
"version": "1.20.0", | ||
"version": "1.20.1-beta.2", | ||
"description": "ESLint React's Shared constants and functions.", | ||
@@ -38,7 +38,6 @@ "homepage": "https://github.com/rel1cx/eslint-react", | ||
"dependencies": { | ||
"@typescript-eslint/utils": "^8.18.0", | ||
"local-pkg": "^0.5.1", | ||
"@typescript-eslint/utils": "^8.18.1", | ||
"picomatch": "^4.0.2", | ||
"ts-pattern": "^5.6.0", | ||
"@eslint-react/tools": "1.20.0" | ||
"@eslint-react/tools": "1.20.1-beta.2" | ||
}, | ||
@@ -50,3 +49,3 @@ "devDependencies": { | ||
"tsup": "^8.3.5", | ||
"type-fest": "^4.30.1", | ||
"type-fest": "^4.30.2", | ||
"valibot": "^1.0.0-beta.9", | ||
@@ -53,0 +52,0 @@ "@workspace/configs": "0.0.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
238767
4
4935
1
3
+ Added@eslint-react/tools@1.20.1-beta.2(transitive)
- Removedlocal-pkg@^0.5.1
- Removed@eslint-react/tools@1.20.0(transitive)
- Removedconfbox@0.1.8(transitive)
- Removedlocal-pkg@0.5.1(transitive)
- Removedmlly@1.7.3(transitive)
- Removedpathe@1.1.2(transitive)
- Removedpkg-types@1.2.1(transitive)
- Removedufo@1.5.4(transitive)