Skip to content

Aliasing with @ is not recognized as 'internal' #2333

@ombene

Description

@ombene

This seems to be a repeat of an issue that has been resolved and regressed twice now, see #2145 and #2249.

In my case the source code is private, but we're using a config that looks like:

// ...
"import/resolver": {
  "alias": [
    ["@", "./src"]
  ]
}
// ...

(See also https://github.com/johvin/eslint-import-resolver-alias.) And with source code like:

// ...
import exampleInternalViaAlias from '@/exampleInternalViaAlias';

import exampleSibling from './exampleSibling';
// ...

When upgrading to v2.25.3 from v2.22.1, without any other changes to source code or other dependencies, we have now started getting false negatives like:

  3:1  error  `@/exampleInternalViaAlias` import should occur after import of `./exampleSibling`  import/order

Injecting some logs into the installed version of eslint-plugin-import in our node_modules, I can see that the import type is getting calculated as 'unknown' (instead of 'internal') for '@/exampleInternalViaAlias'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions