-
-
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 find/replace bug #3079
Comments
ESLint has some magic under the hood. EDIT: maybe the ESLInt docs is erroneous and ESLint checks |
I tried to test your config with ESLint and it seems that it also fails. ❯ npm init
❯ npm i -D --save-exact [email protected]
❯ mkdir -p node_modules/@mjgerace/eslint-configs
❯ cat node_modules/@mjgerace/eslint-configs/package.json
{
"name": "eslint-configs",
"version": "1.0.0",
"main": "index.js",
"exports": {
"./base-vitest": "./index.js"
}
}
❯ cat node_modules/@mjgerace/eslint-configs/index.js
module.exports = {}
❯ cat .eslintrc.json
{
"extends": ["@mjgerace/eslint-configs/base-vitest"]
}
❯ npx eslint -c .eslintrc.json
Oops! Something went wrong! :(
ESLint: 8.56.0
ESLint couldn't find the config "@mjgerace/eslint-configs/base-vitest" to extend from. Please check that the name of the config is correct.
The config "@mjgerace/eslint-configs/base-vitest" was referenced from the config file in ".eslintrc.json".
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
❯ # Even the base config failed to be loaded:
❯ cat .eslintrc.json
{
"extends": ["@mjgerace/eslint-configs"]
}
❯ npx eslint -c .eslintrc.json
Oops! Something went wrong! :(
ESLint: 8.56.0
ESLint couldn't find the config "@mjgerace/eslint-configs" to extend from. Please check that the name of the config is correct.
The config "@mjgerace/eslint-configs" was referenced from the config file in ".eslintrc.json".
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. |
Let me get you more info. I can assure you this setup works and has worked for a while - perhaps not having that package defined in package.json (despite having it in node_modules) is causing this issue. Something about this works fine for me for vanilla eslint, again, this idea is completely unrelated from the weird path modification I see happening - that is to say, I think that this works great in general, and even if it didn't, the path modification for biome migrate doesn't match eslint quite as it should. You can even test biome migrate to see what I am talking about (run it on your example!) |
I know it will fail, and I will get the same error you got. However, to be able to fix the issue, I must be sure that your example is valid in ESLint. My reproduction of your example shows that it is not valid in ESLint. Could you provide a reproduction that is valid for ESLint and invalid for Biome? |
I am not sure if it is a real issue. It seems that this also fails with ESLint. Closing because it is not actionable. |
@Conaclos I will follow up, this is a real issue. I will provide evidence to reopen. |
Hi there, I have the same Issue.
package.json devDependency: The command
as you can see it prepends I also looked at the biome code, and in file Oh btw, I can ensure this setup works in ESLint, It's beeing used this way for a while now. |
@TheSamsa Could you provide a reproduction? |
Its version 1.9.4, the most recent one in yarnpkgs. |
@Conaclos I've provided a public repo with the basics of the eslint-config stuff. |
Brilliant, thanks a lot! |
@TheSamsa I released a nightly version if you want to try it. |
Environment information
What happened?
I make use of the eslint "extends" section, where I extend a few of my own rules like so:
When running
npx @biomejs/biome migrate eslint --write
, I am hitting the following issue, repeated for every one of the extends imports above:Something fascinating is happening here - somewhere in the migration script, it appears
biome
is seeing@mjgerace/eslint-configs
, and transforming it to@mjgerace/eslint-config-eslint-configs
. How bizarre!Expected result
The imports are left unchanged so that node can resolve them, as eslint does today.
Code of Conduct
The text was updated successfully, but these errors were encountered: