Skip to content

Conversation

@Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Nov 6, 2025

Explanation

Update the ESLint config for typescript-eslint to use the newer projectService setting rather than project. This seems to fix the problem we've been seeing recently with inconsistent lint results between machines, and it's recommended by the maintainers of this plugin, and it's the default in our shared ESLint config.

We had originally disabled this setting because we were running into OOM errors, but these no longer occur after updating to TypeScript 5.3.

References

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Switch ESLint TypeScript config to rely on projectService, update repo-wide ESLint warning thresholds, and include the scripts directory in the root tsconfig.

  • ESLint config
    • For **/*.ts rules, remove parserOptions.project and disabled projectService to rely on projectService defaults.
  • Lint thresholds
    • Refresh eslint-warning-thresholds.json with updated warning counts across many packages (e.g., @typescript-eslint/no-misused-promises, @typescript-eslint/no-unsafe-enum-comparison, etc.).
  • TypeScript config
    • Add "./scripts" to root tsconfig.json include array.

Written by Cursor Bugbot for commit 837ce13. This will update automatically on new commits. Configure here.

@Gudahtt Gudahtt force-pushed the update-typescript branch 4 times, most recently from 46eeeb9 to c40a10a Compare November 6, 2025 18:13
@Gudahtt Gudahtt mentioned this pull request Nov 7, 2025
4 tasks
Gudahtt added a commit that referenced this pull request Nov 7, 2025
## Explanation

This file is a duplicate of another in the `src` directory of this
package, and is never referenced. The TSConfig file assumes there is no
TypeScript outside of the `src` directory, so this fixes an error
encountered on a different branch when adjusting the ESlint config.

## References

Fixed error on PR #7078

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Remove unused duplicate
`packages/eip1193-permission-middleware/types.ts` containing enum type
definitions.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3f9f909. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@Gudahtt Gudahtt changed the title Update TypeScript to v5.3 and enable @typescript-eslint option projectService ci: Fix inconsistent lint errors Nov 7, 2025
@Gudahtt Gudahtt force-pushed the update-typescript branch 2 times, most recently from d40fb73 to 280ceaf Compare November 7, 2025 16:12
Gudahtt added a commit that referenced this pull request Nov 7, 2025
The `tsconfig.json` file for `claims-controller` was extending from the wrong
file, and was referencing the wrong configurations in other packages. This
caused lint errors locally in my editor, and in the PR #7078 where we are
updating how type information is read by the linter.

The issue was that the `tsconfig.build.json` files were being referenced,
which exclude test code and test files.
Gudahtt added a commit that referenced this pull request Nov 7, 2025
## Explanation

The `tsconfig.json` file for `claims-controller` was extending from the
wrong file, and was referencing the wrong configurations in other
packages. This caused lint errors locally in my editor, and in the PR
#7078 where we are updating how type information is read by the linter.

The issue was that the `tsconfig.build.json` files were being
referenced, which exclude test code and test files.

## References

The error was introduced in #7072

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Switches `claims-controller` to the correct `tsconfig` base, updates
package references to non-build configs, and includes tests in type
checking.
> 
> - **TypeScript config (`packages/claims-controller/tsconfig.json`)**:
> - Extend from `../../tsconfig.packages.json` instead of
`../../tsconfig.packages.build.json`.
> - Update project references to
`../{base-controller,messenger,profile-sync-controller}/tsconfig.json`
(replacing `tsconfig.build.json`).
> - Expand `include` to add `./tests` alongside `../../types` and
`./src`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
26ad4a9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Update the ESLint config for `typescript-eslint` to use the newer
`projectService` setting rather than `project`. This seems to fix the problem
we've been seeing recently with inconsistent lint results between machines, and
it's recommended by the maintainers of this plugin, and it's the default in our
shared ESLint config.

We had originally disabled this setting because we were running into OOM
errors, but these no longer occur after updating to TypeScript 5.3.
@Gudahtt Gudahtt marked this pull request as ready for review November 7, 2025 17:54
],
"files": [],
"include": ["./types"]
"include": ["./types", "./scripts"]
Copy link
Member Author

Choose a reason for hiding this comment

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

There was just one gap in tsconfig.json coverage, the top-level scripts.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

LGTM!

@Gudahtt Gudahtt merged commit 9e70d5e into main Nov 7, 2025
271 checks passed
@Gudahtt Gudahtt deleted the update-typescript branch November 7, 2025 18:04
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.

3 participants