import-js/eslint-plugin-import

Use globbing with `no-unused-modules` options

Aberta

#1.326 aberto em 14 de abr. de 2019

 (3 comentários) (1 reação) (0 responsável)JavaScript (1.549 forks)batch import
enhancementhelp wantedquestion

Métricas do repositório

Stars
 (5.940 estrelas)
Métricas de merge de PR
 (Mesclagem média 138d 22h) (3 fundiu PRs em 30d)

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?

Guia do colaborador