Unverified Commit dfd40697 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Fix eslint loading on Windows (#30040)

This fixes the failing Azure tests from `import` being used to load `eslint` with an absolute path: 

```sh
error - ESLint: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
```
parent 071ecb0b
...@@ -101,7 +101,7 @@ async function lint( ...@@ -101,7 +101,7 @@ async function lint(
return null return null
} }
const mod = await import(deps.resolved.get('eslint')!) const mod = await Promise.resolve(require(deps.resolved.get('eslint')!))
const { ESLint } = mod const { ESLint } = mod
let eslintVersion = ESLint?.version ?? mod?.CLIEngine?.version let eslintVersion = ESLint?.version ?? mod?.CLIEngine?.version
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment