-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eslint Migration - Nextjs #2935
Comments
Please provide us with a minimal reproduction |
Some idea: If you use a package manager that doesn't make accessible indirect dependencies, then Biome cam not be able to load these dependencies. Anyway we need more info to understand your issue. |
the repro is very simple: npm create next-app # Yes to everthing
cd my-app # Or what you called your app
npm install --save-dev --save-exact @biomejs/biome
npx @biomejs/biome init
npx @biomejs/biome migrate eslint --write |
The reported error is not so informative and even misleading. I will open a PR to fix that. With a proper error propagation I am getting the following error:
Under the hood Biome executes the ESLint configuration files. |
Even though it is not a Biome issue, it is an issue with the migration tool, no? Maybe I am misunderstanding. The ESLint config that comes with Next works, thus the migration tool, if perfect, should be able to migrate it(?) I just want what is best for adoption of Biome. Next is a really popular framework and i believe that if the migration tool works for Next, the adoption would increase a lot. |
Our migration tool is a best effort tool. While we try to do our best to accommodate possible bugs on our end, bugs that could come from other plugins can't be solved on our end. |
Ok, and how can we migrate manually ? |
The issue seems to be the same as microsoft/rushstack#4301 Biome uses node to run the file. If you execute the following command, you will get the same error. node ./node_modules/eslint-config-next/index.js I think that ESLint encounters the issue, but silence this?
Reading the stack trace, you could just remove the line that imports {
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": {
"noAriaUnsupportedElements": "warn",
"noBlankTarget": "off",
"useAltText": "warn",
"useAriaPropsForRole": "warn",
"useValidAriaProps": "warn",
"useValidAriaValues": "warn"
},
"correctness": {
"noChildrenProp": "error",
"useExhaustiveDependencies": "warn",
"useHookAtTopLevel": "error",
"useJsxKeyInIterable": "error"
},
"security": { "noDangerouslySetInnerHtmlWithChildren": "error" },
"suspicious": { "noCommentText": "error", "noDuplicateJsxProps": "error" }
}
}
} |
I am having the same issue how can i fix it. |
I don't have ./node_modules/eslint-config-next/index.js in my repo |
Could you open a new issue with detailed information? It is hard to help without any information. |
It might be worthwhile adding this as a note in the migration doc, as this fix is likely applicable for any given NextJS project. |
These steps work for me, but using the following command:
I'm using next 15.0.1 |
A possible solution could be using a NodeJs module hook in order to skip the loading of |
Thank you for checking and addressing the issue (#4528) I posted last week. |
@maronnjapan I just released a new nightly version of Biome. You can use it for testing the fixes :) |
@Conaclos |
Environment information
What happened?
npx biome migrate eslint --write
Received Error:
Migration has encountered an error: The module '..../node_modules/eslint-config-next/index.js' cannot be loaded. Make sure that the module exists.
Expected result
It should migrate Nextjs Eslint config
Code of Conduct
The text was updated successfully, but these errors were encountered: