You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that import/no-unresolved is not warning me when I forgot to export a function from a Yarn workspace which will be imported from another Yarn workspace.
yarn lint
yarn run v1.22.4
$ eslint .
✨ Done in 1.23s.
When I then try to execute yarn bar which calls bar/index.js NodeJS fails due to calling helloFooV2 which does not exist.
yarn run v1.22.4
$ yarn workspace @my/bar start
$ node index.js
hello foo
/Users/chrisdoc/dev/eslint-plugin-import-bug-minimal-repo/bar/index.js:4
helloFooV2();
^
TypeError: helloFooV2 is not a function
at Object.<anonymous> (/Users/chrisdoc/dev/eslint-plugin-import-bug-minimal-repo/bar/index.js:4:1)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /Users/chrisdoc/.nvm/versions/node/v12.13.0/bin/node
Arguments: /Users/chrisdoc/.yarn/lib/cli.js start
Directory: /Users/chrisdoc/dev/eslint-plugin-import-bug-minimal-repo/bar
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace 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.
Here you can see an example being run on Github Workflows that shows that yarn lint succeeds and that yarn bar fails
I noticed that
import/no-unresolved
is not warning me when I forgot to export a function from a Yarn workspace which will be imported from another Yarn workspace.I created a minimal repo https://github.com/chrisdoc/eslint-plugin-import-bug-minimal-repo which consists of two workspaces
foo
andbar
.Inside
foo/index.js
there is a single functionhelloFoo
which is exported so that it can be consumed bybar
Now in
bar/index.js
I import bothhelloFoo
and a none existinghelloFooV2
via:Now when I run
yarn lint
no errors are reported:When I then try to execute
yarn bar
which callsbar/index.js
NodeJS fails due to callinghelloFooV2
which does not exist.Here you can see an example being run on Github Workflows that shows that
yarn lint
succeeds and thatyarn bar
failshttps://github.com/chrisdoc/eslint-plugin-import-bug-minimal-repo/runs/787914292
The text was updated successfully, but these errors were encountered: