VectorGOLEM/package.json
Stephen Niedzielski cf17aee48b [build] Make the pre-commit hook optional
Add a new NPM script, `pre-commit`, which _conditionally_ invokes
`npm test`. Previously, the pre-commit hook was configured by default to
invoke `npm test`. Now it is configured explicitly to invoke the new
`pre-commit` script.

The rationale for this change is that some folks may prefer workflows
that defer all validation until CI. Supporting these workflows is a
small change, most of it documentation.

This change isn't necessary for T257647 but supports and seems like an
overall improvement to the repo regardless of whether code is built or
not.

Bug: T257647
Change-Id: I19a78e0e677026cd6887245d96e63a414397a3db
2020-08-03 18:23:42 +00:00

43 lines
1.5 KiB
JSON

{
"private": true,
"scripts": {
"start": "dev-scripts/setup-storybook.sh && start-storybook --quiet -p 6006 -s docs/ui",
"build": "npm -s test && npm -s run doc",
"test": "npm -s run lint && tsc",
"test:size": "node ./tests/resource-loader-bundlesize.js",
"lint": "npm -s run lint:js && npm -s run lint:styles && npm -s run lint:i18n",
"lint:fix:js": "npm -s run lint:js -- --fix",
"lint:fix:styles": "npm -s run lint:styles -- --fix",
"lint:js": "eslint --cache --max-warnings 0 .",
"lint:styles": "stylelint \"**/*.{less,css}\"",
"lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
"selenium-test": "npm -s run test:size",
"doc": "jsdoc -c jsdoc.json && npm run build-storybook",
"build-storybook": "dev-scripts/setup-storybook.sh && build-storybook --quiet --loglevel warn -o docs/ui",
"svgmin": "svgo --config=.svgo.yml -q -r -f resources/",
"pre-commit": "[ \"${PRE_COMMIT:-1}\" -eq 0 ] || npm -s t"
},
"pre-commit": "pre-commit",
"devDependencies": {
"@babel/core": "7.7.7",
"@storybook/html": "5.2.8",
"@types/jquery": "3.3.33",
"@types/mustache": "4.0.1",
"@types/node-fetch": "2.5.7",
"babel-loader": "8.0.6",
"bundlesize": "0.18.0",
"eslint-config-wikimedia": "0.16.2",
"grunt-banana-checker": "0.9.0",
"jsdoc": "3.6.3",
"jsdoc-wmf-theme": "0.0.3",
"less": "3.8.1",
"less-loader": "4.1.0",
"mustache": "3.0.1",
"node-fetch": "2.6.0",
"pre-commit": "1.2.2",
"stylelint-config-wikimedia": "0.10.1",
"svgo": "1.3.2",
"typescript": "3.8.3"
}
}