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 see this in our codebase with the current rulset:
C:\Users\matt\workspace\app\packages\home-ui\src\components\Home\__tests__\index.test.js
6:1 error 'test-utils' should be listed in the project's dependencies. Run 'npm i -S test-utils' to add it import/no-extraneous-dependencies
In this particular instance, 'test-utils' is another package in the monorepo located at C:\Users\matt\workspace\app\packages\test-utils. (Even so, it seems like a bug in eslint-plugin-import that they say to add a test dependency to regular dependencies instead of devDependencies.)
In our local eslintrc we have this override in our configuration to eliminate this class of false-positive warnings (and a few others) :
eslint-plugin-import does have a way to specify package directories to accomodate monorepos, but I'm not sure if that could be used generically in this config package since monorepos structure can vary quite a bit.
Does someone have an idea how to use the packageDir option to this rule to not fire on this case? Would a PR to turn off this rule for test and mock directories be accepted?
The text was updated successfully, but these errors were encountered:
Ask your Question
I see this in our codebase with the current rulset:
In this particular instance, 'test-utils' is another package in the monorepo located at
C:\Users\matt\workspace\app\packages\test-utils
. (Even so, it seems like a bug in eslint-plugin-import that they say to add a test dependency to regular dependencies instead of devDependencies.)In our local eslintrc we have this override in our configuration to eliminate this class of false-positive warnings (and a few others) :
eslint-plugin-import does have a way to specify package directories to accomodate monorepos, but I'm not sure if that could be used generically in this config package since monorepos structure can vary quite a bit.
Does someone have an idea how to use the packageDir option to this rule to not fire on this case? Would a PR to turn off this rule for test and mock directories be accepted?
The text was updated successfully, but these errors were encountered: