import-js/eslint-plugin-import

Use globbing with `no-unused-modules` options

オープン

#1,326 opened on 2019/04/14

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (1,549 件のフォーク)batch import
enhancementhelp wantedquestion

Repository metrics

Stars
 (5,939 個のスター)
PR merge metrics
 (平均マージ 138d 22h) (30d で 3 merged PRs)

説明

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?

コントリビューターガイド