diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4fbc898 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +dist/ +docs/ +vendor/ +node_modules/ +*.min.js +jquery.tools.js diff --git a/composer.json b/composer.json index ebe8fbc..b8374a9 100644 --- a/composer.json +++ b/composer.json @@ -8,12 +8,16 @@ "build": "./_tools/build.sh", "lint": "composer run lint:php && npm run lint", "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:fix": "./vendor/bin/phpcbf --standard='WordPress' --encoding=utf-8 -p --ignore=*/vendor/* ./*.php ./*/*.php ./*/*/*.php", "lint:css": "npm run lint:css", "lint:css:fix": "npm run lint:css:fix", "lint:js": "npm run lint:js", "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/", "commit": "./vendor/bin/php-commitizen commit -- ./.php-commitizen.php", "post-install-cmd": "./_tools/setup.sh" diff --git a/package.json b/package.json index 3c79856..d3582a6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,9 @@ { "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:fix": "npm run lint:js:fix && npm run lint:css:fix", "lint:js": "eslint \"./js/*.js\"",