Skip to content

Commit

Permalink
Fix eslint loading on Windows (#30040)
Browse files Browse the repository at this point in the history
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:'
```
  • Loading branch information
ijjk committed Oct 18, 2021
1 parent 071ecb0 commit dfd4069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/lib/eslint/runLintCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function lint(
return null
}

const mod = await import(deps.resolved.get('eslint')!)
const mod = await Promise.resolve(require(deps.resolved.get('eslint')!))

const { ESLint } = mod
let eslintVersion = ESLint?.version ?? mod?.CLIEngine?.version
Expand Down

0 comments on commit dfd4069

Please sign in to comment.