I recently updated the dependencies on my React Native project, and we have husky pre-coomit hooks set up. I tried committing now and I get the following error:
myname@MacSelf014 my-project % git commit --amend file:///<path-to-project>/node_modules/listr2/dist/index.js:206 this.options.fields ??= {}; ^^^ SyntaxError: Unexpected token '??=' at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18) husky - pre-commit hook exited with code 1 (error) The pre-commit set up looks like this in my package.json:
"lint-staged": { "*.{js,ts,tsx}": [ "eslint --fix", "prettier --write", ] I've tried adding node_modules to .husky/_/.gitignore like so:
* node_modules/* And the problem persists. Any idea what the issue might be?
.gitignore-ingnode_modules/in the.huskydirectory (where it isn't anyway) help? If you run the linting without Husky does it excludenode_modules/?node_modulesspecified in the.gitignorein the root directory of my project, but that doesn't seem to be helping in this case. Yes, the linter ignoresnode_moduleswithout Husky.