Skip to content

Upgrade eslint and stylelint#315

Merged
abhishek-kaushik merged 16 commits into
masterfrom
upgrade-eslint
Sep 9, 2025
Merged

Upgrade eslint and stylelint#315
abhishek-kaushik merged 16 commits into
masterfrom
upgrade-eslint

Conversation

@rmccue
Copy link
Copy Markdown
Member

@rmccue rmccue commented Sep 24, 2024

Node.js & Packages:

  1. Updated all packages to require Node.js >=22.0.0
  2. Updated npm requirements to >=10.8.2
  3. Added .nvmrc to pin Node.js 22
  4. Added packageManager field

ESLint:

  1. Updated to ESLint 9 with flat config

Stylelint:

  1. Updated to Stylelint 16.24.0
  2. kept all formatting rules via WordPress @Stylistic plugin
  3. Extended both @wordpress/stylelint-config/scss and scss-stylistic

Security & Dependencies

  1. Updated Lerna from 5.x to 8.2.3
  2. Added @babel/runtime override to >=7.26.10

CS

  1. Fix PHPCS related issues
  2. remove unsupported PHP versions
  3. Skipped 8.4 for now

rmccue and others added 4 commits September 24, 2024 18:40
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.
@abhishek-kaushik abhishek-kaushik changed the title Upgrade eslint to v8 Upgrade eslint to v9 Sep 8, 2025
Exclude scripts and style files in PHPCS rulesets

Remove non-PHP exclude patterns and update ESLintSniff

Update sniff property configuration in tests
@abhishek-kaushik abhishek-kaushik marked this pull request as ready for review September 9, 2025 08:47
@abhishek-kaushik abhishek-kaushik changed the title Upgrade eslint to v9 Upgrade eslint and stylelint Sep 9, 2025
@abhishek-kaushik abhishek-kaushik self-assigned this Sep 9, 2025
"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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to create this, or is this just if you want to do overrides?

Copy link
Copy Markdown
Member

@abhishek-kaushik abhishek-kaushik Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have "node": ">=22.0.0" in the engines section of package.json I htink?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Comment thread .travis.yml
- vendor/bin/phpunit
- language: php
php: 7.4
php: 8.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to switch to Github Acitons one day... doesn't need to be today though :D

Comment thread .travis.yml
- vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php

- language: node_js
node_js: 20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems some confusion if we're needing node 20 or 22 I think?

Copy link
Copy Markdown
Contributor

@tomjn tomjn Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, nvm file asks for Node 22, though I see further down the file these same steps happen again under Node 22

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove 20 runs and added 24

Comment thread package.json
"npm" : ">=7.0.0",
"node" : ">=16.0.0"
"npm" : ">=10.8.2",
"node" : ">=22.0.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be >=20.0.0 if we're running tests on both 20 and 22?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomjn Updated the test to use >22

Comment thread packages/stylelint-config/fixtures/test-lint-config.js
@abhishek-kaushik abhishek-kaushik merged commit 01ccad3 into master Sep 9, 2025
2 checks passed
@abhishek-kaushik abhishek-kaushik deleted the upgrade-eslint branch September 9, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants