Build/Test: Fix JavaScript linting scripts

`wp-prettier` was out of date and no longer compatible with wp-scripts. Additionally, many generated files and plugins were not being properly ignored which could cause linting to take so long that it was basically unusable.

Props ankitkumarshah, jorbin.
See #62935.



git-svn-id: https://develop.svn.wordpress.org/trunk@59848 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Aaron Jorbin 2025-02-20 20:00:20 +00:00
parent 26ed02b95d
commit 889d6e2efb
3 changed files with 32 additions and 27 deletions

View File

@ -1,15 +1,26 @@
# Files and folders related to build/test tools
# Files and folders related to build/test tools including generated files
/build
/node_modules
/tests
/vendor
/tools
/jsdoc
/artifacts
/coverage
.cache/*
/src/wp-includes/blocks/**/*.js
/src/wp-includes/blocks/**/*.js.map
/src/wp-admin/js
/src/wp-includes/js
# Excluded files and folders based on `jsdoc.conf.json` exclusions
/src/js/_enqueues/vendor
# Webpack built files
/src/wp-includes/js/media-*
# Themes
src/wp-content/themes/
src/wp-content/themes
# Files and folders that get created in wp-content
/src/wp-content/plugins
/src/wp-content/mu-plugins
/src/wp-content/upgrade
/src/wp-content/uploads

36
package-lock.json generated
View File

@ -141,7 +141,7 @@
"ink-docstrap": "1.3.2",
"install-changed": "1.1.0",
"postcss": "8.4.49",
"prettier": "npm:wp-prettier@2.6.2",
"prettier": "npm:wp-prettier@3.0.3",
"qunit": "~2.23.1",
"react-refresh": "0.14.0",
"sass": "1.83.4",
@ -9449,22 +9449,6 @@
"postcss": "^8.4.31"
}
},
"node_modules/@wordpress/scripts/node_modules/prettier": {
"name": "wp-prettier",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-3.0.3.tgz",
"integrity": "sha512-X4UlrxDTH8oom9qXlcjnydsjAOD2BmB6yFmvS4Z2zdTzqqpRWb+fbqrH412+l+OUXmbzJlSXjlMFYPgYG12IAA==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@wordpress/scripts/node_modules/read-pkg-up": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz",
@ -28789,10 +28773,20 @@
},
"node_modules/prettier": {
"name": "wp-prettier",
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-2.6.2.tgz",
"integrity": "sha512-AV33EzqiFJ3fj+mPlKABN59YFPReLkDxQnj067Z3uEOeRQf3g05WprL0RDuqM7UBhSRo9W1rMSC2KvZmjE5UOA==",
"dev": true
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-3.0.3.tgz",
"integrity": "sha512-X4UlrxDTH8oom9qXlcjnydsjAOD2BmB6yFmvS4Z2zdTzqqpRWb+fbqrH412+l+OUXmbzJlSXjlMFYPgYG12IAA==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/prettier-linter-helpers": {
"version": "1.0.0",

View File

@ -62,7 +62,7 @@
"ink-docstrap": "1.3.2",
"install-changed": "1.1.0",
"postcss": "8.4.49",
"prettier": "npm:wp-prettier@2.6.2",
"prettier": "npm:wp-prettier@3.0.3",
"qunit": "~2.23.1",
"react-refresh": "0.14.0",
"sass": "1.83.4",