Improve the pre-commit hook setup for wc-admin (https://github.com/woocommerce/woocommerce-admin/pull/5233)
This commit is contained in:
parent
a75d1a5254
commit
0d6d0dd36f
|
@ -0,0 +1,9 @@
|
|||
module.exports = {
|
||||
'*.scss': [ 'npm run lint:css-fix' ],
|
||||
'(client|packages)/**/*.js': [
|
||||
'wp-scripts format-js',
|
||||
'wp-scripts lint-js',
|
||||
'npm run test-staged',
|
||||
],
|
||||
'*.php': [ 'php -d display_errors=1 -l', 'composer run-script phpcs' ],
|
||||
};
|
File diff suppressed because it is too large
Load Diff
|
@ -60,6 +60,7 @@
|
|||
"test:e2e": "npm explore @woocommerce/e2e-environment -- npm run test:e2e",
|
||||
"test:e2e-dev": "npm explore @woocommerce/e2e-environment -- npm run test:e2e-dev",
|
||||
"test": "./node_modules/jest-24.9.0/bin/jest.js --config tests/js/jest.config.json",
|
||||
"test-staged": "./node_modules/jest-24.9.0/bin/jest.js --bail --config tests/js/jest.config.json --findRelatedTests",
|
||||
"test:help": "wp-scripts test-unit-js --help",
|
||||
"test:update-snapshots": "jest --updateSnapshot --config tests/js/jest.config.json",
|
||||
"test:watch": "npm run test -- --watch",
|
||||
|
@ -81,22 +82,9 @@
|
|||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"pre-push": "npm run test && npm run -s install-if-no-packages && node bin/pre-push-hook.js"
|
||||
"pre-push": "node bin/pre-push-hook.js"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.scss": [
|
||||
"npm run lint:css"
|
||||
],
|
||||
"*.js": [
|
||||
"wp-scripts format-js",
|
||||
"npm run lint:js"
|
||||
],
|
||||
"*.php": [
|
||||
"php -d display_errors=1 -l",
|
||||
"composer run-script phpcs"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/e2e-environment": "0.1.5",
|
||||
"@wordpress/api-fetch": "2.2.8",
|
||||
|
|
Loading…
Reference in New Issue