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
I'd like to convert our ESLint configs to the flat config format.
However, I'm running into immediate problems where it seems I must choose to use FlatCompat for everything, or use FlatCompat for nothing.
For example, I have plugins and extends that apply to specific files.
Yet, in the documentation, it has plugins and extends spreading into the root configuration array.
Instead, what I want is:
module.exports = [
// other files
{
files: ['*.ts', '*.tsx', '*.vue'],
// this is an error, because it spreads configs, but I want it to apply extends to JUST THESE FILES based on the compat layer
...compat.extends(
'plugin:vue/vue3-strongly-recommended',
'standard-with-typescript'
),
languageOptions: {
parser: VueEsLintParser,
parserOptions: {
parser: TSParser,
project: './tsconfig.json',
extraFileExtensions: ['.vue']
}
}
}
]
In other words, with the old file format, I could use plugins / extends with specific matching files. Yet if I do that, it looks like I must use ...compat.config and use the old configuration for everything (so, not using languageOptions, direct parser imports, etc).
Is there not a way to get the best of both worlds, and import plugins / extends while maintaining the new format for everything else?
The text was updated successfully, but these errors were encountered:
I'd like to convert our ESLint configs to the flat config format.
However, I'm running into immediate problems where it seems I must choose to use FlatCompat for everything, or use FlatCompat for nothing.
For example, I have plugins and extends that apply to specific files.
Yet, in the documentation, it has plugins and extends spreading into the root configuration array.
Instead, what I want is:
In other words, with the old file format, I could use plugins / extends with specific matching files. Yet if I do that, it looks like I must use
...compat.config
and use the old configuration for everything (so, not usinglanguageOptions
, direct parser imports, etc).Is there not a way to get the best of both worlds, and import plugins / extends while maintaining the new format for everything else?
The text was updated successfully, but these errors were encountered: