build: add JS formatting commands
This commit is contained in:
parent
2cff59f28c
commit
d7a372ae2b
3 changed files with 14 additions and 0 deletions
6
.prettierignore
Normal file
6
.prettierignore
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
dist/
|
||||||
|
docs/
|
||||||
|
vendor/
|
||||||
|
node_modules/
|
||||||
|
*.min.js
|
||||||
|
jquery.tools.js
|
|
@ -8,12 +8,16 @@
|
||||||
"build": "./_tools/build.sh",
|
"build": "./_tools/build.sh",
|
||||||
"lint": "composer run lint:php && npm run lint",
|
"lint": "composer run lint:php && npm run lint",
|
||||||
"lint:fix": "composer run lint:php:fix && npm run lint:fix",
|
"lint:fix": "composer run lint:php:fix && npm run lint:fix",
|
||||||
|
"format": "npm run format",
|
||||||
|
"format:fix": "npm run format:fix",
|
||||||
"lint:php": "./vendor/bin/phpcs --standard='WordPress' --colors --encoding=utf-8 -n -p --ignore=*/vendor/* ./*.php ./*/*.php ./*/*/*.php",
|
"lint:php": "./vendor/bin/phpcs --standard='WordPress' --colors --encoding=utf-8 -n -p --ignore=*/vendor/* ./*.php ./*/*.php ./*/*/*.php",
|
||||||
"lint:php:fix": "./vendor/bin/phpcbf --standard='WordPress' --encoding=utf-8 -p --ignore=*/vendor/* ./*.php ./*/*.php ./*/*/*.php",
|
"lint:php:fix": "./vendor/bin/phpcbf --standard='WordPress' --encoding=utf-8 -p --ignore=*/vendor/* ./*.php ./*/*.php ./*/*/*.php",
|
||||||
"lint:css": "npm run lint:css",
|
"lint:css": "npm run lint:css",
|
||||||
"lint:css:fix": "npm run lint:css:fix",
|
"lint:css:fix": "npm run lint:css:fix",
|
||||||
"lint:js": "npm run lint:js",
|
"lint:js": "npm run lint:js",
|
||||||
"lint:js:fix": "npm run lint:js:fix",
|
"lint:js:fix": "npm run lint:js:fix",
|
||||||
|
"format:js": "npm run format:js",
|
||||||
|
"format:js:fix": "npm run format:js:fix",
|
||||||
"docs": "./vendor/bin/phpdoc -d . -t ./docs --ignore vendor/",
|
"docs": "./vendor/bin/phpdoc -d . -t ./docs --ignore vendor/",
|
||||||
"commit": "./vendor/bin/php-commitizen commit -- ./.php-commitizen.php",
|
"commit": "./vendor/bin/php-commitizen commit -- ./.php-commitizen.php",
|
||||||
"post-install-cmd": "./_tools/setup.sh"
|
"post-install-cmd": "./_tools/setup.sh"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"format": "npm run format:js",
|
||||||
|
"format:fix": "npm run format:js:fix",
|
||||||
|
"format:js": "prettier --config .prettierrc './js/*.js'",
|
||||||
|
"format:js:fix": "npm run format:js -- --write",
|
||||||
"lint": "npm run lint:js && npm run lint:css",
|
"lint": "npm run lint:js && npm run lint:css",
|
||||||
"lint:fix": "npm run lint:js:fix && npm run lint:css:fix",
|
"lint:fix": "npm run lint:js:fix && npm run lint:css:fix",
|
||||||
"lint:js": "eslint \"./js/*.js\"",
|
"lint:js": "eslint \"./js/*.js\"",
|
||||||
|
|
Reference in a new issue