import-js/eslint-plugin-import

Use globbing with `no-unused-modules` options

开放

#1,326 创建于 2019年4月14日

 (3 条评论) (1 个反应) (0 位负责人)JavaScript (1,549 个派生)batch import
enhancementhelp wantedquestion

仓库指标

星标
 (5,938 个星标)
PR 合并指标
 (平均合并 138天 22小时) (30 天内合并 3 个 PR)

描述

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?

贡献者指南