jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

v0.13.0 tsdx lint including examples folder goes off the deep end #639

Open lookfirst opened 4 years ago

lookfirst commented 4 years ago

Current Behavior

This worked prior to v13.

After v13, I get 100% cpu usage and it never finishes.

tsdx lint src test example --ignore-pattern node_modules

This works fine:

tsdx lint src test --ignore-pattern node_modules

Expected behavior

The command works.

Your environment

Software Version(s)
TSDX v13
TypeScript 3.8.3
npm/Yarn 6.13.7 / 1.22.4
Node v13.11.0
Operating System OSX Catalina
agilgur5 commented 4 years ago

Well that's a weird one, the only thing that changed about lint is that it now lints JS/JSX files as well. Sounds like it's reading node_modules inside of example despite the ignore?

agilgur5 commented 4 years ago

Not totally sure why that pattern isn't working, but ESLint says it by default only excludes root node_modules.

Should probably add a .eslintignore to the templates as the reason it didn't dig into example/node_modules previously was incidental (and it probably did, to an extent). Or symlink .gitignore (c.f. #517 )

agilgur5 commented 4 years ago

Ah, in ESLint v6 it only ignored root node_modules and not all node_modules. In ESLint v7, it ignores nested node_modules as well by default.

From there, the difference in pattern is /node_modules/* (v6) vs. /**/node_modules/* (v7). We could change to that early though by adding a default .eslintignore to the templates.