Closed Herm71 closed 1 year ago
@Herm71, a few notes on package.json
:
npx husky-init
(a .husky
folder with a pre-commit
hook script file in it) will already be in the codebase after this PR is merged. So it is redundant and unnecessary to run it again as a postinstall
npm script. It also requires user confirmation to proceed (it asks to install husky-init).The script you have in prepare
, (husky install
) is required for anyone downloading this repo to do development work.
So it seems like you can remove the prepare
script and make the postinstall
script husky install
. Then you aren't running any scripts that aren't required. This is important for when we add CI/automated testing.
lint-php
should be lint:php
since that is the common syntax for NPM scoped scripts.prettier
just dumped the contents of the scss/css files it evaluated into my terminal window. Is that script supposed to do something different?homepage
object as well.@knice, in response to your comments in the list above, and based on our earlier discussion:
"postinstall": "npx husky install"
. Please note the necessary addition of npx in the command.lint-staged.config.js
and any php-linting scripts have been removed from package.json
. PHPCodeSniffer can still be run individual files via the composer scripts."scripts"
object of the package.json
file; however, as discussed, it remains as a development dependency and the "prettier": "@wordpress/prettier-config",
object remains in the package.json
file. This means, like PHPCodeSniffer, Prettier can still be run on individual files using npx and it will adhere to WordPress standards. This can be used in conjunction with the @wp-scripts' "lint:style": "wp-scripts lint-style"
script to lint CSS and SCSS files."lint:style": "wp-scripts lint-style"
via lint-staged.config.js
package.json
have been ordered alphabeticallyhomepage
object has been updated with the correct URL.@knice, based on our recent conversation,
npx
has been removed from the "postinstall"
and "test"
scripts. This has been tested and works"release"
script has been alphabetized appropriately"bugs"
object in the package.json
file has been corrected.I've re-cloned and rebuilt with these changes and all works properly.
Add
Husky
,lint-staged
,prettier
and@wordpress/prettier-config
topackage.json
. Fixes #23