plantain-00 / type-coverage

A CLI tool to check type coverage for typescript code
MIT License
1.26k stars 44 forks source link

Ignore file doesn't work for root matching #94

Closed konsalex closed 3 years ago

konsalex commented 3 years ago

Version(if relevant): 1.0.0

2.18.8

Environment(if relevant):

Typescript v4.3.5 Node 12.14.1

Code(if relevant):

typescript-coverage-report --ignore-files '*.js' --ignore-files 'src/**/*.js' --ignore-files 'src/**/*.jsx' --threshold=98

Expected:

To ignore all js files, even on the root dir.

Actual:

tailwind.config.js I think should be ignored from *.js, but this is not the case. Any clue why this is happening?

image

konsalex commented 3 years ago

Update, when I use the package.json approach of ignoring files it works properly 🤔

plantain-00 commented 3 years ago

You can add a log here (./node_modules/type-coverage/dist/index.js https://github.com/plantain-00/type-coverage/blob/master/packages/cli/src/index.ts#L204 ) to see whether ignoreFiles is correct.

konsalex commented 3 years ago

They are indeed logged [ '*.js', 'src/**/*.js', 'src/**/*.jsx' ] and removed from type-coverage but not from typescript-coverage-report.

Weird

plantain-00 commented 3 years ago

I cannot reproduce it, more information is required. if yarn type-coverage --ignore-files '*.js' --ignore-files 'src/**/*.js' --ignore-files 'src/**/*.jsx' --detail works but typescript-coverage-report --ignore-files '*.js' --ignore-files 'src/**/*.js' --ignore-files 'src/**/*.jsx' not work, maybe it's typescript-coverage-report's bug.

konsalex commented 3 years ago

I will issue this later to typescript-coverage-report