Argument list too long
See original GitHub issueDescription
I have a big project where I use a tslint, and I needed to check 450 files before committing, but an error occurred. But if I copy this command directly, there will be no error.
~/admin-webapp/node_modules/.bin/tslint: Argument list too long npm ERR! code ELIFECYCLE npm ERR! errno 126
My lint-staged config:
{
"linters": {
"*.ts": ["npm run lint", "git add"]
},
"ignore": ["**/*.spec.ts"]
}
package.json
"lint": "tslint -c tslint.json --project src/tsconfig.json",
Steps to reproduce
Add more 360 files
run lint-staged through npm run lint
Debug Logs
expand to view
~/admin-webapp/node_modules/.bin/tslint: Argument list too long
npm ERR! code ELIFECYCLE
npm ERR! errno 126
Environment
- OS: macOS High Sierra
- Node.js: v8.9.1
lint-staged
: v7.3.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
bash: /usr/bin/rm: Argument list too long - Solution
“Argument list too long” indicates when a user feeds too many arguments into a single command which hits the ARG_MAX limit.
Read more >Argument list too long error for rm, cp, mv commands
No, rm has no such limit on the number of files it will process (other than that its argc cannot be larger than...
Read more >The “Argument List Too Long” Error in Linux Commands
In this tutorial, we'll look at the “argument list too long” problem, often encountered while working with a large number of files.
Read more >SOLUTION: /bin/rm: argument list too long - Linux Hint
The “Argument list too long” error does not come, for that the user can find out what the length of the command should...
Read more >(Resolved) – /bin/rm: Argument list too long - TecAdmin
If there are a large number of files in a single directory, Then the traditional rm command can not delete all files and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, but I think that’s the behavior I’d like to enforce in this case. Linting hundreds of files is no different from linting the whole project, which should be done on CI. It’s about common sense and best practices. I don’t want lint-staged to be the single point of failure.
I think we should just print a more friendlier message and suggest to skip the run for such cases. The splitting part is rather complex and makes the code harder to maintain. I also believe the case is so rare it’s not worth doing. I hardly believe there is value in using lint-stages on hundreds of files. CI should cover that. What do you think @sudo-suhas?