I have lint-staged + husky configured in my app and
I need to run a custom lint-staged script on precommit.
Here is my package.json
//package.json
"lint-staged": {
"app/**/*.js": "node ./lint-staged-scripts/customScript"
}
In the customScript.js
, how will I be able to access the staged files ?
I tried running node --inspect-brk ./lint-staged-scripts/customScript
, could not get staged files in args.
But on running npx lint-staged -d
, i could see the files getting listed in the fileList.
How to access staged files and debug custom lint-staged scripts?
TIA and i'm new to writing lint-staged scripts !