-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Enable @typescript-eslint/no-explicit-any
as an error rule
#23531
Conversation
…mment - There are 385 instances of `any` as of this commit.
This comment was marked as resolved.
This comment was marked as resolved.
14d32a6
to
24ec73e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #23531 +/- ##
========================================
Coverage 69.13% 69.13%
========================================
Files 1160 1160
Lines 44260 44260
Branches 11839 11839
========================================
Hits 30596 30596
Misses 13664 13664 ☔ View full report in Codecov by Sentry. |
This comment was marked as duplicate.
This comment was marked as duplicate.
@Gudahtt / @mcmire / @davidmurdoch is this how you would suggest handling enabling this rule to prevent future breaks? My concern is the TODO's will get lost. Though the only alternative I know is to ignore rules by file. |
@brad-decker Sure, good question. The motivation for enabling this rule is to prevent further uses of This approach has worked for us, but if there is another approach that you think would work for you, we can certainly follow it. |
@typescript-eslint/no-explicit-any
as an error rule@typescript-eslint/no-explicit-any
as an error rule
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment has been minimized.
This comment has been minimized.
This comment was marked as duplicate.
This comment was marked as duplicate.
c277ce3
This comment was marked as duplicate.
This comment was marked as duplicate.
Builds ready [2976bca]
Page Load Metrics (952 ± 504 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
The ongoing TypeScript conversion effort will be most effective if
any
usage can be minimized in incoming code. A helpful step in achieving this is to enable@typescript-eslint/no-explicit-any
as an error rule.To minimize disruption to existing code, all 385 existing violations have been annotated with an
eslint-disable-next-line
directive and TODO comment. Errors for this rule will only be triggered by new instances ofany
.This approach has previously been successfully applied to the core monorepo.
Disclaimer
This is a major change, so please feel free to voice any concerns. Code review and updates to documentation may be sufficient to encourage best practices for the time being.
That said, if minimizing
any
usage through these other means sounds like a good idea, that might be a strong sign that enabling this linter rule aligns with the coding standards that we already have in place.Related issues
@typescript-eslint/no-explicit-any
as an error rule #23530Manual testing steps
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist