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

chore(eslint): upgrade eslint to v9 #2716

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

chore(eslint): upgrade eslint to v9 #2716

wants to merge 31 commits into from

Conversation

liady
Copy link
Contributor

@liady liady commented Jan 20, 2025

WHY are these changes introduced?

Fixes #191

WHAT is this pull request doing?

This PR:

  • upgrades eslint to v9 and its corresponding plugins, packages and configs
  • removes individual eslint from all of our packages, except templates/skeleton
  • unifies our basic lint configuation to be in the root of the monorepo (it was empty until now)
  • fixes our lint-staged script to run on the changed files
  • removes deprecated dependencies of remix-run lint plugin and hydrogen lint plugin (not maintained)

The relevant files in the PR are:

  • eslint.config.js - this is the base eslint config for linting our codebase
  • templates/skeleton/eslint.config.js - this is the skeleton-specific configuration, and it can be removed by the skeleton users if they want.
  • the rest are (stylistic only) lint fixes

I tried to find the best subset of rules so that we will be able to have even minimal linting over our codebase, but at the same time not to flood many warnings over packages that weren't linted until now. If in the future we will want to add/enable a new rule, we can do it and fix its errors.

HOW to test your changes?

  1. npm i && npm run lint from the root folder
  2. npm i && npm run lint from the templates/skeleton folder

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

Copy link
Contributor

shopify bot commented Jan 20, 2025

Oxygen deployed a preview of your chore/eslint-upgrade branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment February 3, 2025 6:33 PM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment February 3, 2025 6:33 PM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment February 3, 2025 6:33 PM
classic-remix ✅ Successful (Logs) Preview deployment Inspect deployment February 3, 2025 6:33 PM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment February 3, 2025 6:33 PM

Learn more about Hydrogen's GitHub integration.

@liady liady marked this pull request as ready for review January 28, 2025 15:11
@liady liady changed the title [WIP] chore(eslint): upgrade eslint to v9 chore(eslint): upgrade eslint to v9 Jan 28, 2025
Copy link
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run npm run changeset add to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.

Comment on lines -1 to -3
/* eslint-disable eslint-comments/disable-enable-pair */
/* eslint-disable eslint-comments/no-unlimited-disable */
/* eslint-disable */
Copy link
Contributor

Choose a reason for hiding this comment

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

This is generated automatically. Deleting it here doesn't do anything since a npm run dev would bring this back. We should ignore eslint on this file.

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.

2 participants