diff --git a/.github/workflows/test-measure.yml b/.github/workflows/test-measure.yml index 6f5c9f10..e1e1e66c 100644 --- a/.github/workflows/test-measure.yml +++ b/.github/workflows/test-measure.yml @@ -23,6 +23,8 @@ jobs: wp-versions: '["6.5", "6.6", "6.7", "6.8", "6.9", "7.0"]' # WordPress added PHP 8.4 support in 6.7. test-php-exclude: '[{"php": "8.4", "wp": "6.5"}, {"php": "8.4", "wp": "6.6"}]' + lint-js-files-command: npm run lint:js:files + lint-css-files-command: npm run lint:css:files # Optional wp-ci inputs, upstream defaults — uncomment to change. # skip: '' # lint-css,lint-js,lint-php,test-js,test-php,build,build-artifact,a11y diff --git a/.lintstagedrc.js b/.lintstagedrc.js index d65828ff..a7525b05 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,6 +1,6 @@ module.exports = { '**/*.php': ['npm run lint:php'], - '**/*.js': ['npm run lint:js'], - '**/*.{css,scss}': ['npm run lint:css'], + '**/*.js': ['npm run lint:js:files'], + '**/*.{css,scss}': ['npm run lint:css:files'], 'package.json': ['npm run lint:package-json'], }; diff --git a/package.json b/package.json index 6954509d..bfd371c8 100644 --- a/package.json +++ b/package.json @@ -67,9 +67,11 @@ "release:changelog": "wp-tooling release:changelog", "sync-ai": "node bin/sync-ai.js", "lint:all": "npm-run-all --parallel lint:css lint:js lint:php lint:package-json", - "lint:css": "wp-scripts lint-style ./src", + "lint:css": "npm run lint:css:files -- ./src", + "lint:css:files": "wp-scripts lint-style --allow-empty-input=true", "lint:css:fix": "npm run lint:css -- --fix", - "lint:js": "wp-scripts lint-js .", + "lint:js": "npm run lint:js:files -- .", + "lint:js:files": "wp-scripts lint-js", "lint:js:fix": "npm run lint:js -- --fix", "lint:js:report": "npm run lint:js -- --output-file lint-js-report.json --format json .", "lint:package-json": "wp-scripts lint-pkg-json --ignorePath .gitignore",