eslint-plugin-import-alias
eslint-plugin-import-alias copied to clipboard
Support eslint flat config
Hi,
ESLint 9 has a different config format. Would be great to have this supported.
I was using this plugin with eslint@8. Just sharing my workaround: I instead used the default no-restricted-imports rule to emulate the behaviour of this plugin.
Instead of:
// eslint config 8.x
"rules": {
"@dword-design/import-alias/prefer-alias": [
"error",
{
"alias": {
"@components": "./src/components"
}
}
]
}
This is close enough:
// eslint.config.mjs for eslint 9.x
export default [
{
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{ group: ['*/src/components/*'], message: 'Please use @components/* instead.' }
],
},
],
Is shipped.