Skip to content

chore: remove next lint command#2679

Merged
chanceaclark merged 1 commit intocanaryfrom
chore/remove-next-lint
Nov 12, 2025
Merged

chore: remove next lint command#2679
chanceaclark merged 1 commit intocanaryfrom
chore/remove-next-lint

Conversation

@chanceaclark
Copy link
Copy Markdown
Contributor

@chanceaclark chanceaclark commented Nov 10, 2025

What/Why?

This PR updates the lint command in the core package to use the eslint CLI directly instead of next lint. With Next.js 16 deprecating next lint, this change proactively migrates away from the deprecated command to minimize future migration impact.

Key changes:

  • Updated lint script in core/package.json to run eslint . --ext .js,.jsx,.ts,.tsx instead of next lint
  • Added prelint script that runs next typegen to ensure TypeScript definitions are generated before linting
  • Created new .eslintignore file to explicitly define ignored paths (dependencies, build outputs, generated files, test outputs, cache)
  • Removed ignorePatterns from .eslintrc.cjs since ignore patterns are now managed in .eslintignore

This change maintains the same linting behavior while using the more direct ESLint CLI approach, which is the recommended pattern going forward.

Testing

  1. Run npm run lint from the core directory to verify linting works correctly
  2. Run pnpm lint from the root directory to ensure the monorepo-level lint command still functions
  3. Verify that the same files are linted as before (check that ignore patterns work correctly)
  4. Confirm that TypeScript definitions are generated before linting via the prelint hook
  5. Intentionally introduce a linting error to verify ESLint catches and reports it properly

Migration

For developers working on feature branches:

No action required. The lint command works the same way - you can continue using npm run lint or pnpm lint as before. The implementation has changed but the interface remains identical.

If you've customized ignore patterns:

If you have custom ignore patterns in your local .eslintrc.cjs, you may need to move them to the new .eslintignore file instead, as we've consolidated ignore patterns there for better clarity and maintainability.


This pull request description was generated with the assistance of AI. Portions of the code and/or implementation ideas in this PR may also have been created or influenced by AI tools.

@chanceaclark chanceaclark requested a review from a team November 10, 2025 22:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 2d67b9d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Ready Preview Comment Nov 11, 2025 4:16pm
catalyst-canary Ready Ready Preview Comment Nov 11, 2025 4:16pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
catalyst Ignored Ignored Nov 11, 2025 4:16pm

Comment thread core/package.json
"build:analyze": "ANALYZE=true npm run build",
"start": "next start",
"lint": "next lint",
"prelint": "next typegen",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The next lint command essentially ran this before linting, so I opted to have this be a pre* hook to the lint task.

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.

This runs automatically because it has the pre prefix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread core/package.json
"build:analyze": "ANALYZE=true npm run build",
"start": "next start",
"lint": "next lint",
"prelint": "next typegen",
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.

This runs automatically because it has the pre prefix?

@chanceaclark chanceaclark added this pull request to the merge queue Nov 12, 2025
Merged via the queue into canary with commit 323483a Nov 12, 2025
11 checks passed
@chanceaclark chanceaclark deleted the chore/remove-next-lint branch November 12, 2025 18:22
jamesqquick pushed a commit that referenced this pull request Feb 11, 2026
chanceaclark added a commit that referenced this pull request Apr 27, 2026
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