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

In import/order, modules starting with @/ are always treated as unknown #2249

Open
ykzts opened this issue Oct 7, 2021 · 3 comments
Open

Comments

@ykzts
Copy link

ykzts commented Oct 7, 2021

If you run yarn lint on https://github.com/ykzts-sandbox/nextjs-with-module-path-aliases, you will get the following output.

$ yarn lint
yarn run v1.22.11
$ next lint
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5

./pages/index.tsx
5:1  Error: `../styles/Home.module.css` import should occur before import of `@/components/hello`  import/order

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

regression from #2146

@ykzts ykzts changed the title In import/order, modules starting with @/ are always treated as unknown. In import/order, modules starting with @/ are always treated as unknown Oct 7, 2021
@ljharb
Copy link
Member

ljharb commented Oct 7, 2021

The order rule should likely use the resolver to get the type.

@rygine
Copy link

rygine commented Nov 4, 2021

This bug seems to also be present in the no-internal-modules rule. I'm getting back unknown for aliased paths.

@karl-run
Copy link

karl-run commented Feb 7, 2023

Seeing it both with NextJS' default "paths": { "@/*": ["./src/*"] } as well as Remix' default "paths": { "~/*": ["./src/*"] }.

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

No branches or pull requests

4 participants