import-js/eslint-plugin-import

Use globbing with `no-unused-modules` options

Open

#1,326 opened on Apr 14, 2019

View on GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
enhancementhelp wantedquestion

Description

I would like to check for dead code in my test helpers using the no-unused-modules rule.

My test folder is test/ and my helpers are in test/helpers/ (which is a common setup with Ava).

The src and ignoreExports are file paths, which makes it hard to use in such a setup. Indeed I need src to target my test files + helpers (test/) but ignoreExports should exclude the test files since they do not export anything.

One possible solution would be to allow globbing in src and ignoreExports, e.g. { src: 'test/', ignoreExports: ['test/', '!test/helpers'] }. What do you think?

Contributor guide

Use globbing with `no-unused-modules` options · import-js/eslint-plugin-import#1326 | Good First Issue