Upgrade eslint and stylelint#315
Conversation
Replaces legacy ESLint config with ESLint v9 Flat Config, adds Prettier configuration and ignore files, updates fixtures and test scripts to use modern ESLint APIs, and updates package requirements to latest ESLint, Prettier, and related plugins. This modernizes the coding standards package for compatibility with current tooling.
Exclude scripts and style files in PHPCS rulesets Remove non-PHP exclude patterns and update ESLintSniff Update sniff property configuration in tests
2acd3cd to
acd9435
Compare
| "eslint-plugin-react-hooks": "^4.0.2", | ||
| "eslint-plugin-sort-destructure-keys": "^1.3.3" | ||
| "@babel/eslint-parser": "^7.25.0", | ||
| "@wordpress/eslint-plugin": "^20", |
There was a problem hiding this comment.
This is a very wide constraint, do we want it to be ^20.0?
| Human Made coding standards for JavaScript. | ||
| Human Made coding standards for JavaScript, for ESLint v9+ using flat config format. | ||
|
|
||
| ## Usage |
There was a problem hiding this comment.
Do you have to create this, or is this just if you want to do overrides?
There was a problem hiding this comment.
@joehoyle With ESLint 9's flat config, we must create an eslint.config.js file, there's no other way to use it
| ## Requirements | ||
|
|
||
| - ESLint v9.0.0 or higher | ||
| - Node.js 20.18.0 or higher |
There was a problem hiding this comment.
We have "node": ">=22.0.0" in the engines section of package.json I htink?
| - vendor/bin/phpunit | ||
| - language: php | ||
| php: 7.4 | ||
| php: 8.1 |
There was a problem hiding this comment.
I would like to switch to Github Acitons one day... doesn't need to be today though :D
| - vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php | ||
|
|
||
| - language: node_js | ||
| node_js: 20 |
There was a problem hiding this comment.
Seems some confusion if we're needing node 20 or 22 I think?
There was a problem hiding this comment.
+1, nvm file asks for Node 22, though I see further down the file these same steps happen again under Node 22
There was a problem hiding this comment.
remove 20 runs and added 24
| "npm" : ">=7.0.0", | ||
| "node" : ">=16.0.0" | ||
| "npm" : ">=10.8.2", | ||
| "node" : ">=22.0.0" |
There was a problem hiding this comment.
Should this be >=20.0.0 if we're running tests on both 20 and 22?
Node.js & Packages:
ESLint:
Stylelint:
Security & Dependencies
CS