You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i am migrating from eslintrc to flat config, i got the following error
> eslint .
Oops! Something went wrong! :(
ESLint: 9.2.0
A config object has a "plugins" key defined as an array of strings.
Flat config requires "plugins" to be an object in this form:
{
plugins: {
import-x: pluginObject
}
}
Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#importing-plugins-and-custom-parsers
If you're using a shareable config that you cannot rewrite in flat config format, then use the compatibility utility:https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config ELIFECYCLE Command failed with exit code 2.
After some research, i found the "plugins" key is defined in recommended preset:
The configs does not support flat config yet, see also #29
But you can config it manually by not using the configs
importpluginImportXfrom"eslint-plugin-import-x";exportdefault[{plugins: {import: pluginImportX},rules: {"import/order": ["error"]// make sure to use same prefix as you defined above in `plugins`}}]
When i am migrating from eslintrc to flat config, i got the following error
After some research, i found the "plugins" key is defined in recommended preset:
eslint-plugin-import-x/src/config/recommended.ts
Line 7 in 8b53954
Is it supposed to be a virtual plugin or a module? I'm glad to help improving it.
Full code example
The text was updated successfully, but these errors were encountered: