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

Incorrect error for relative import #11

Closed
steinybot opened this issue Dec 17, 2020 · 1 comment
Closed

Incorrect error for relative import #11

steinybot opened this issue Dec 17, 2020 · 1 comment

Comments

@steinybot
Copy link

I have the following modules:

root/
child/
├─ foo/

In child/foo/index.ts if I try:

import {x} from "root";

Then eslint fails with:

❯ yarn run fix
yarn run v1.22.10
$ yarn eslint . --ext .js,.jsx,.ts,.tsx --fix
$ /Users/jason/source/bug-reports/node_modules/.bin/eslint . --ext .js,.jsx,.ts,.tsx --fix

/Users/jason/source/bug-reports/child/foo/index.ts
  1:1  error  Relative imports of other packages are not allowed  workspaces/no-relative-imports

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Checkout the branch here for a reproduction: https://github.com/steinybot/bug-reports/tree/eslint-plugin-workspaces/relative-import

@joshuajaco
Copy link
Owner

Fix published in v0.7.0

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

No branches or pull requests

2 participants