typescript-eslint
Advanced tools
Comparing version
@@ -8,2 +8,3 @@ "use strict"; | ||
const node_path_1 = __importDefault(require("node:path")); | ||
const node_url_1 = require("node:url"); | ||
/** | ||
@@ -31,6 +32,12 @@ * Infers the `tsconfigRootDir` from the current call stack, using the V8 API. | ||
for (const callSite of getStack()) { | ||
const stackFrameFilePath = callSite.getFileName(); | ||
if (!stackFrameFilePath) { | ||
const stackFrameFilePathOrUrl = callSite.getFileName(); | ||
if (!stackFrameFilePathOrUrl) { | ||
continue; | ||
} | ||
// ESM seem to return a file URL, so we'll convert it to a file path. | ||
// AFAICT this isn't documented in the v8 API docs, but it seems to be the case. | ||
// See https://github.com/typescript-eslint/typescript-eslint/issues/11429 | ||
const stackFrameFilePath = stackFrameFilePathOrUrl.startsWith('file://') | ||
? (0, node_url_1.fileURLToPath)(stackFrameFilePathOrUrl) | ||
: stackFrameFilePathOrUrl; | ||
const parsedPath = node_path_1.default.parse(stackFrameFilePath); | ||
@@ -37,0 +44,0 @@ if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) { |
{ | ||
"name": "typescript-eslint", | ||
"version": "8.39.1-alpha.2", | ||
"version": "8.39.1-alpha.3", | ||
"description": "Tooling which enables you to use TypeScript with ESLint", | ||
@@ -53,6 +53,6 @@ "files": [ | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "8.39.1-alpha.2", | ||
"@typescript-eslint/parser": "8.39.1-alpha.2", | ||
"@typescript-eslint/typescript-estree": "8.39.1-alpha.2", | ||
"@typescript-eslint/utils": "8.39.1-alpha.2" | ||
"@typescript-eslint/eslint-plugin": "8.39.1-alpha.3", | ||
"@typescript-eslint/parser": "8.39.1-alpha.3", | ||
"@typescript-eslint/typescript-estree": "8.39.1-alpha.3", | ||
"@typescript-eslint/utils": "8.39.1-alpha.3" | ||
}, | ||
@@ -59,0 +59,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
31425
1.58%565
1.25%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed