Skip to content
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

Error [ConfigError]: Config (unnamed): Key "language" on convertErrorToWarningPerFile #360

Closed
danielpza opened this issue Aug 8, 2024 · 9 comments · Fixed by #362
Closed
Labels
Type: Bug Bug or Bug fixes

Comments

@danielpza
Copy link
Sponsor

When choosing the option to convert the error to warning per file it crashes:

✔ Which rules would you like to apply action? · @typescript-eslint/no-explicit-any
✔ Which action do you want to do? · convertErrorToWarningPerFile
✔ Leave a code comment with your reason for fixing (Optional) · 
✖ Fixing...
Error [ConfigError]: Config (unnamed): Key "language": Expected string in the form "pluginName/objectName" but found "[object Object]".
    at rethrowConfigError (/home/daniel/projects/typescript-transform-paths/node_modules/@eslint/config-array/dist/cjs/index.cjs:303:8)
    at /home/daniel/projects/typescript-transform-paths/node_modules/@eslint/config-array/dist/cjs/index.cjs:1098:5
    at Array.reduce (<anonymous>)
    at FlatConfigArray.getConfigWithStatus (/home/daniel/projects/typescript-transform-paths/node_modules/@eslint/config-array/dist/cjs/index.cjs:1091:43)
    at FlatConfigArray.getConfig (/home/daniel/projects/typescript-transform-paths/node_modules/@eslint/config-array/dist/cjs/index.cjs:1120:15)
    at Linter._verifyWithFlatConfigArray (/home/daniel/projects/typescript-transform-paths/node_modules/eslint/lib/linter/linter.js:2052:36)
    at Linter.verify (/home/daniel/projects/typescript-transform-paths/node_modules/eslint/lib/linter/linter.js:1547:61)
    at verifyAndFix (/home/daniel/projects/typescript-transform-paths/node_modules/eslint-interactive/src/eslint/linter.ts:53:8)
    at Core.fix (/home/daniel/projects/typescript-transform-paths/node_modules/eslint-interactive/src/core.ts:207:27)
    at SerializableCore.convertErrorToWarningPerFile (/home/daniel/projects/typescript-transform-paths/node_modules/eslint-interactive/src/core-worker.ts:47:18)
❯ yarn eslint --version
v9.8.0
❯ yarn eslint-interactive --version
11.0.2

The other options seem to be working fine so far.

btw thanks for this awesome package. I've used it in some large scale codebases and it has been a huge time saver.

@mizdra
Copy link
Owner

mizdra commented Aug 8, 2024

Can you provide a minimal repository that reproduces the problem? Without it, we cannot investigate.

@mizdra mizdra added the Status: Need More Info Lacks enough info to make progress label Aug 8, 2024
@danielpza
Copy link
Sponsor Author

danielpza commented Aug 8, 2024

Hey @mizdra, thanks for the quick reponse.

If it helps although not minimal this is where I got the error https://github.com/LeDDGroup/typescript-transform-paths/compare/fix-eslint

I'll check again and try to make a minimal reproduction

@tamasfabi
Copy link

tamasfabi commented Aug 15, 2024

I did encounter the same error message on my private pnpm monorepo too (with flatconfig for eslint), when using with these packages:

"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.8.0",
"@typescript-eslint/parser": "^8.0.1",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-interactive": "^11.0.2",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.1",

Added a console.log to the sourcecode before the error happens, to log the configArray object that has the "wrong" language set, this might be handy. @mizdra

Screenshot 2024-08-15 at 12 30 05

@nocive
Copy link

nocive commented Aug 16, 2024

Facing the same error while using eslint flat config.

@mizdra
Copy link
Owner

mizdra commented Sep 2, 2024

@danielpza Thanks for providing your repository! I could reproduce the issue. I will fix it.

@mizdra mizdra added Type: Bug Bug or Bug fixes and removed Status: Need More Info Lacks enough info to make progress labels Sep 2, 2024
@mizdra
Copy link
Owner

mizdra commented Sep 2, 2024

This problem seems to occur with ESLint 9.5.0+. It is not reproduced in 9.4.0 or lower.

minimum reproduction:
https://github.com/mizdra/typescript-transform-paths/tree/minimum-reproduction

@danielpza
Copy link
Sponsor Author

Sorry, I couldn't provide a minimal repo, I got distracted with work.

Thanks for taking a look @mizdra ❤️.

@mizdra
Copy link
Owner

mizdra commented Sep 2, 2024

@danielpza, @tamasfabi This bug fix is shipped in v11.0.3. Thanks for contributing!

@nocive
Copy link

nocive commented Sep 3, 2024

Can also confirm that it's fixed, thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants