Open controversial opened 3 months ago
still exists in 1.1.33 it blocks for use ESLint 9
For context:
$ bunx --bun eslint .
Oops! Something went wrong! :(
ESLint: 9.13.0
TypeError: Cannot read config file: /node_modules/eslint-config-next/core-web-vitals.js
Error: parent.require is not a function. (In 'parent.require(filePath)', 'parent.require' is undefined)
File content: node_modules/eslint-config-next/core-web-vitals.js
:
module.exports = {
extends: [require.resolve('.'), 'plugin:@next/next/core-web-vitals'],
}
Directly running bun --bun ./node_modules/eslint-config-next/core-web-vitals.js
gives no errror.
Minimal setup to reproduce:
// eslint.config.mjs
import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat();
export default [...compat.extends("next/core-web-vitals")];
package.json:
{
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"eslint-config-next": "^15.0.1"
}
}
Now run: bun install && bunx --bun eslint .
What version of Bun is running?
1.1.24+85a329911
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
The
FlatCompat
class exported by@eslint/eslintrc
is designed to help “legacy” eslint configs (pre-flat config) work with eslint 9+.The following produces an error in bun:
What is the expected behavior?
What do you see instead?
An error from within the
import-fresh
moduleAdditional information
No response