Skip to content

Conversation

@sjinks
Copy link
Member

@sjinks sjinks commented Dec 3, 2025

Description

This pull request refactors the ESLint configuration to use the new flat config format, updates related dependencies, and cleans up various code and test files. The most significant changes include the migration from .eslintrc.js to eslint.config.js, updates to the ESLint plugin and Prettier dependencies, and removal of legacy ESLint ignore patterns. Additionally, minor code cleanups and improvements have been made throughout the codebase.

ESLint configuration migration and dependency updates:

  • Migrated from .eslintrc.js to the new flat config format in eslint.config.js, updating how rules and ignores are set up for the project. ([1], [2])
  • Updated @automattic/eslint-plugin-wpvip to point to the latest GitHub version and upgraded prettier to version 3.x in package.json. ([1], [2])
  • Removed legacy ESLint ignore patterns from .eslintignore in favor of the new config format. (1)

Code and test file improvements:

  • Removed or updated unnecessary ESLint disable comments and improved type annotations in test and source files for clarity and maintainability. ([1], [2], [3], [4], [5])
  • Replaced deprecated or less accurate ESLint directive comments with up-to-date ones (e.g., switching from @typescript-eslint/no-var-requires to @typescript-eslint/no-require-imports). ([1], [2])

Minor code cleanups:

  • Simplified constructor formatting and removed redundant type constituents and parameters in several files for better readability and stricter typing. ([1], [2], [3])
  • Removed unnecessary comments and improved error handling and messaging in various utility and command files. ([1], [2], [3], [4], [5], [6], [7])

These changes modernize the project's linting setup, improve code quality, and lay the groundwork for easier future maintenance.

⚠️ After Automattic/eslint-config-wpvip#216 gets merged and we release a new version of automattic/eslint-config-wpvip, update package.json and set the correct version for automattic/eslint-config-wpvip.

Changelog Description

Changed

  • Maintenance: update ESLint configuration and fix issues.

Pull request checklist

New release checklist

Steps to Test

There are no functional changes. CI must pass.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@automattic/eslint-plugin-wpvip github:automattic/eslint-config-wpvip#500ef87da9bc04b72469291c68525bf7a99df238 🟢 4.6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy⚠️ 0security policy file not detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities🟢 82 existing vulnerabilities detected
npm/prettier npm:[email protected] 🟢 7
Details
CheckScoreReason
Code-Review⚠️ 2Found 6/22 approved changesets -- score normalized to 2
Maintained🟢 1030 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
Security-Policy🟢 10security policy file detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
License🟢 10license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Signed-Releases⚠️ -1no releases found
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing⚠️ 0project is not fuzzed
SAST🟢 10SAST tool is run on all commits
Vulnerabilities🟢 100 existing vulnerabilities detected

Scanned Files

  • package.json

@sjinks sjinks self-assigned this Dec 3, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

@sjinks sjinks changed the title Update/eslint chore: update @automattic/eslint-plugin-wpvip and migrate to ESLint 9 Dec 3, 2025
@sjinks sjinks changed the title chore: update @automattic/eslint-plugin-wpvip and migrate to ESLint 9 chore: update @automattic/eslint-plugin-wpvip and migrate to ESLint 9 Dec 3, 2025
@sjinks
Copy link
Member Author

sjinks commented Dec 3, 2025

Related: #2617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants