Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to eslint 9 #40555

Merged
merged 9 commits into from
Dec 11, 2024
Merged

Update to eslint 9 #40555

merged 9 commits into from
Dec 11, 2024

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Dec 10, 2024

Proposed changes:

Eslint 9 brings a new config format, which means this PR also rewrites all the eslint configs. I took the opportunity to clean them up (although a good bit of that wound up in earlier PRs), and added code to fetch the textdomain from composer.json and whether the project uses React from package.json so we don't need to have so many boilerplate configs that just set a textdomain or enable React rules.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Draft announcement: pdWQjU-14g-p2

Does this pull request change what data or activity we track or use?

None

Testing instructions:

  • CI happy?
  • Changes make sense?
  • Double check that the built artifacts don't suddenly start including unneeded files like eslint.config.mjs.
  • If you really want to dig into things, verify that all the same files are being linted as were before, and check that React rules are being enabled for all the React files, and so on. 😀

@anomiex anomiex added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Type] Janitorial [Pri] Normal labels Dec 10, 2024
@anomiex anomiex requested a review from a team December 10, 2024 21:33
@anomiex anomiex self-assigned this Dec 10, 2024
Copy link
Contributor

github-actions bot commented Dec 10, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the update/eslint-9 branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/eslint-9
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/eslint-9
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Action] Repo Gardening Github Action: manage PR and issues in your Open Source project [Action] Required Review [Action] Test Results to Slack [Block] Contact Form Form block (also see Contact Form label) [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. [Feature] Contact Form [Feature] Extra Sidebar Widgets [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] Publicize Now Jetpack Social, auto-sharing [Feature] Theme Tools [Feature] VideoPress A feature to help you upload and insert videos on your site. [Feature] Widget Visibility [Focus] Compatibility Ensuring our products play well with third-parties [JS Package] AI Client [JS Package] API labels Dec 10, 2024
@github-actions github-actions bot added [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] Super Cache A fast caching plugin for WordPress. [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Tests] Includes Tests [Tools] Development CLI The tools/cli to assist during JP development. Actions GitHub actions used to automate some of the work around releases and repository management Admin Page React-powered dashboard under the Jetpack menu Docs E2E Tests RNA labels Dec 10, 2024
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Beta plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for January 7, 2025 (scheduled code freeze on undefined).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Debug Helper plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Super Cache plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Inspect plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Automattic For agencies client plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Classic Theme helper plugin plugin:

  • Next scheduled release: none scheduled.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@anomiex
Copy link
Contributor Author

anomiex commented Dec 10, 2024

About the only thing left here that might be split out into a separate PR is part of b2e80ec, but that'd leave us with inconsistent docs and it's not that much in there.

I did try to divide things up into logical chunks for the initial set of commits, in case that helps.

@tbradsha
Copy link
Contributor

we don't need to have so many boilerplate configs that just set a textdomain or enable React rules.
I did try to divide things up into logical chunks for the initial set of commits, in case that helps.

Much appreciated!

package.json Show resolved Hide resolved
@manzoorwanijk
Copy link
Member

While we are here, can we please not require redundant JSDoc types in TypeScript files like Gutenberg does?

@anomiex
Copy link
Contributor Author

anomiex commented Dec 11, 2024

While we are here, can we please not require redundant JSDoc types in TypeScript files like Gutenberg does?

Seems like something for a followup PR to me. Most of the config changes in this PR are about bringing things closer together, like using most of our base config in projects/plugins/jetpack/modules/ instead of a very minimal one. The one big exception is that I decided to not have so many "env"s enabled by default.

P.S. If you do that, you may want to additionally disable jsdoc/no-undefined-types and jsdoc/require-property-type for TS. Those are the other two that we have enabled which jsdoc has off in their "recommended-typescript" preset.

@manzoorwanijk
Copy link
Member

Seems like something for a followup PR to me.

Alright, I'll try to create a follow up PR once this one is shipped.

@anomiex anomiex merged commit 9e3ae2f into trunk Dec 11, 2024
74 of 75 checks passed
@anomiex anomiex deleted the update/eslint-9 branch December 11, 2024 15:51
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Action] Repo Gardening Github Action: manage PR and issues in your Open Source project [Action] Required Review [Action] Test Results to Slack Actions GitHub actions used to automate some of the work around releases and repository management Admin Page React-powered dashboard under the Jetpack menu [Block] Contact Form Form block (also see Contact Form label) Docs E2E Tests [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. [Feature] Contact Form [Feature] Extra Sidebar Widgets [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Feature] Publicize Now Jetpack Social, auto-sharing [Feature] Theme Tools [Feature] VideoPress A feature to help you upload and insert videos on your site. [Feature] Widget Visibility [Focus] Compatibility Ensuring our products play well with third-parties [JS Package] AI Client [JS Package] API [JS Package] Babel Plugin Replace Textdomain [JS Package] Base Styles [JS Package] Boost Score Api [JS Package] Charts [JS Package] Components [JS Package] Connection [JS Package] Critical Css Gen [JS Package] Eslint Changed [JS Package] Eslint Config Target Es [JS Package] I18n Check Webpack Plugin [JS Package] I18n Loader Webpack Plugin [JS Package] IDC [JS Package] Image Guide [JS Package] Licensing [JS Package] Partner Coupon [JS Package] Publicize Components [JS Package] React Data Sync Client [JS Package] Remove Asset Webpack Plugin [JS Package] Scan [JS Package] Script Data [JS Package] Shared Extension Utils [JS Package] Social Logos [JS Package] Storybook [JS Package] Svelte Data Sync Client [JS Package] Videopress Core [JS Package] Webpack Config [Package] Ad aka WordAds [Package] Assets [Package] Backup [Package] Blaze [Package] Classic Theme Helper [Package] Connection [Package] Forms [Package] Jetpack mu wpcom WordPress.com Features [Package] Jitm [Package] Masterbar [Package] My Jetpack [Package] Post List [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Package] Yoast Promo [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Beta For serving live branches and the beta versions. https://github.com/automattic/jetpack-beta [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Classic Theme Helper Plugin [Plugin] CRM Issues about the Jetpack CRM plugin [Plugin] Debug Helper Debug Tools plugin [Plugin] Inspect [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] Super Cache A fast caching plugin for WordPress. [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Plugin] Wpcomsh [Pri] Normal RNA [Tests] Includes Tests [Tools] Development CLI The tools/cli to assist during JP development. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants