Fix build-js pre-commit hook
Only run when main_inventory is run & discard parameters passed by pre-commit which breaks babel command
This commit is contained in:
parent
7335c04f8e
commit
df73cd5657
|
@ -19,5 +19,9 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: build-js
|
- id: build-js
|
||||||
name: build-js
|
name: build-js
|
||||||
|
# pre-commit pass as parameters files included on the commit
|
||||||
|
# so babel command should be wrapped to ignore these files on
|
||||||
|
# package.json script
|
||||||
entry: npm run babel
|
entry: npm run babel
|
||||||
language: node
|
language: node
|
||||||
|
files: ^ereuse_devicehub/static/js/main_inventory.js
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint:report": "eslint ereuse_devicehub --ext .js --output-file eslint_report.json --format json",
|
"lint:report": "eslint ereuse_devicehub --ext .js --output-file eslint_report.json --format json",
|
||||||
"lint:fix": "eslint ereuse_devicehub --ext .js --fix",
|
"lint:fix": "eslint ereuse_devicehub --ext .js --fix",
|
||||||
"babel": "babel ereuse_devicehub/static/js/main_inventory.js --out-file ereuse_devicehub/static/js/main_inventory.build.js"
|
"babel": "babel ereuse_devicehub/static/js/main_inventory.js --out-file ereuse_devicehub/static/js/main_inventory.build.js && echo 'Ignoring parameters: '"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
Reference in New Issue