eslint-plugin-import-alias icon indicating copy to clipboard operation
eslint-plugin-import-alias copied to clipboard

Support eslint flat config

Open Goldziher opened this issue 11 months ago • 1 comments

Hi,

ESLint 9 has a different config format. Would be great to have this supported.

Goldziher avatar Dec 25 '24 11:12 Goldziher

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.' }
          ],
        },
      ],

rstacruz avatar Mar 12 '25 01:03 rstacruz

Is shipped.

dword-design avatar Jun 05 '25 03:06 dword-design