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
If no src option is passed to import/no-unused-modules it falls over with the following error:
TypeError: Error while loading rule 'import/no-unused-modules': Cannot read property 'src' of undefined
Occurred while linting /root/static/js/apps/account/components/account-header/account-header-loadable.jsx
at Object.create (/root/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js:289:35)
at createRuleListeners (/root/node_modules/eslint/lib/linter.js:578:21)
at Object.keys.forEach.ruleId (/root/node_modules/eslint/lib/linter.js:732:31)
at Array.forEach (<anonymous>)
at runRules (/root/node_modules/eslint/lib/linter.js:690:34)
at Linter._verifyWithoutProcessors (/root/node_modules/eslint/lib/linter.js:899:31)
at preprocess.map.textBlock (/root/node_modules/eslint/lib/linter.js:955:35)
at Array.map (<anonymous>)
at Linter.verify (/root/node_modules/eslint/lib/linter.js:954:42)
at Linter.verifyAndFix (/root/node_modules/eslint/lib/linter.js:1047:29)
error Command failed with exit code 2.
The documentation claims it defaults to process.cwd() which would be fine, but it still seems to provide that error, implying that it's maybe not being set correctly? Seems to originate from around here in the source.
I would still prefer that it looks at the directory provided by running the command before falling back to process.cwd(), but that can be addressed later. Thanks for fixing @Kiwka!
Hope we can cut a new version soon, but until then I don't mind supplying the src explicitly.
If no
src
option is passed toimport/no-unused-modules
it falls over with the following error:The documentation claims it defaults to
process.cwd()
which would be fine, but it still seems to provide that error, implying that it's maybe not being set correctly? Seems to originate from around here in the source.Here are my versions:
I wish this rule would just use whatever
dir
/glob is being used from the command being run. So for us it's something like this:...where I would expect this rule to just pick up
static/js/
instead of me manually having to set that in the rule config.I am happy to help fix this and would just need to be pointed in the right direction! 👍
The text was updated successfully, but these errors were encountered: