Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ombene opened this issue Dec 20, 2021 · 0 comments · Fixed by #2334
Closed

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

ombene opened this issue Dec 20, 2021 · 0 comments · Fixed by #2334

Comments

@ombene
Copy link
Contributor

ombene commented Dec 20, 2021

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant