Skip to content

Commit fff3c90

Browse files
committed
Update build and test env.
1 parent e177b67 commit fff3c90

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.wp-env.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"core": null,
3+
"plugins": [ "." ]
4+
}

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
}],
1212
"type": "wordpress-plugin",
1313
"require-dev": {
14-
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
1514
"phpcompatibility/php-compatibility": "^9.3",
1615
"phpunit/phpunit": "^8.5",
17-
"squizlabs/php_codesniffer": "^3.5",
18-
"wp-coding-standards/wpcs": "^2.2",
16+
"wp-coding-standards/wpcs": "^3.0.0",
1917
"wp-phpunit/wp-phpunit": "^5.8",
20-
"yoast/phpunit-polyfills": "^1.0"
18+
"yoast/phpunit-polyfills": "^1.0",
19+
"szepeviktor/phpstan-wordpress": "^1.1",
20+
"phpstan/extension-installer": "^1.1"
2121
},
2222
"require": {
2323
"composer/installers": "~1.0"
@@ -30,6 +30,7 @@
3030
"config": {
3131
"allow-plugins": {
3232
"composer/installers": true,
33+
"phpstan/extension-installer": true,
3334
"dealerdirect/phpcodesniffer-composer-installer": true
3435
}
3536
}

package.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,31 @@
2121
"npm": ">=6.9.0"
2222
},
2323
"devDependencies": {
24-
"@wordpress/env": "^4.1",
24+
"@wordpress/env": "^5.7",
2525
"jsdoc": "~3.6.3",
26-
"wp-hookdoc": "^0.2.0"
26+
"wp-hookdoc": "^0.2.0",
27+
"eslint": "^7.25.0",
28+
"eslint-config-prettier": "^8.3.0",
29+
"eslint-plugin-prettier": "^3.4.0",
30+
"husky": "^6.0.0",
31+
"lint-staged": "^10.5.4",
32+
"prettier": "^2.8.4",
33+
"esbuild": "^0.17.10"
2734
},
2835
"scripts": {
36+
"presetup": "find .scripts -type f -exec chmod +x {} \\;",
2937
"build:docs": "rm -rf docs/ && jsdoc -c hookdoc-conf.json",
3038
"format-php": "wp-env run composer run-script format",
3139
"prelint-php": "wp-env run composer 'install --no-interaction'",
3240
"lint-php": "wp-env run composer run-script lint",
3341
"pretest-php": "wp-env run composer 'install --no-interaction'",
3442
"test-php": "wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/ableplayer-wordpress/phpunit.xml.dist --verbose'",
43+
"lint-js": "eslint --fix './src/js'",
3544
"wp-env": "wp-env"
36-
}
45+
},
46+
"lint-staged": {
47+
"./src/js/!(*min).js": ["eslint --fix", "prettier --write"],
48+
"./src/css/*.css": "prettier --write"
49+
},
50+
"dependencies": {}
3751
}

0 commit comments

Comments
 (0)