You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And just hangs. I've been running lint-staged both with --verbose and --debug flags, but this does not yield any usable debugging info unfortunately.
My lint-staged config looks like:
exportdefault{'src/**/*.ts': 'ng-lint-staged lint:dwp --',// works fine'*.json': (filenames)=>filenames.map((filename)=>`npm run validjson ${filename}`),// or just npx validjson ${filename}};
This is what I see when 3 .json files are found:
The text was updated successfully, but these errors were encountered:
a more pragmatic solution would be to "not try re-using your npm scripts",
the other thing to note is that npm scripts do not accept arguments without decoration (unlike yarn and pnpm), so you need to add -- :
npm run validjson -- ./path/to/filename.json
otherwise npm thinks ./path/to/filename.json is an argument for npm and not what ever the command you have in validjson:
check what happens when you make your lintstaged look like:
exportdefault{'src/**/*.ts': 'ng-lint-staged lint:dwp --',// works fine'*.json': (filenames)=>filenames.map((filename)=>`npm run validjson -- ${filename}`),// or just npx validjson ${filename}};
your comment there indicates that you're just running a tool called validjson, so did you try just having this:
exportdefault{'src/**/*.ts': 'ng-lint-staged lint:dwp --',// works fine'*.json': 'validjson'};
lint-staged will pass the filename(s) as argument to validjson.
which brings up another thing: does validjson support this:
And just hangs. I've been running
lint-staged
both with--verbose
and--debug
flags, but this does not yield any usable debugging info unfortunately.My lint-staged config looks like:
This is what I see when 3
.json
files are found:The text was updated successfully, but these errors were encountered: