Skip to content

Conversation

JasonWeinzierl
Copy link
Owner

@JasonWeinzierl JasonWeinzierl commented Nov 22, 2024

BREAKING CHANGE: allowExplicitAny now defaults to true instead of false.

This change was made for several reasons:

  1. To align with other rules in this codebase dealing with explicit any (namely throw-error, which allows any by default).
  2. To align with the rule's name: to a casual reader, this rule seems to only ban implicit any, not explicit too.
  3. Lax codebases often change allowExplicitAny to true, or they disable this rule entirely.
    • By relaxing the default options, developers will be encouraged to at least add an explicit annotation, and stricter codebases can re-opt-in to banning any.
    • Strict codebases likely already have typescript-eslint's no-explicit-any turned on, so this shouldn't reduce practical coverage.
  4. The upcoming strict config will set this option back to false. See Introduce a strict config #36 and feat(strict): add strict configuration #41 .

BREAKING CHANGE: allowExplicitAny now defaults to `true` instead of `false.

This change was made to align with other rules in this codebase dealing with explicit `any` (namely `throw-error`).  Additionally, lax codebases commonly turn on this setting, or else turn off this rule entirely.  By relaxing the default options, developers will be encouraged to use this rule, and stricter codebases can re-opt-in to banning `any`.  The upcoming `strict` config will set this option back to `false` accordingly.
Copy link

LCOV of commit d32e3e4 during .github/workflows/ci.yml #115

Summary coverage rate:
  lines......: 96.2% (3628 of 3770 lines)
  functions..: 95.6% (237 of 248 functions)
  branches...: 91.3% (731 of 801 branches)

Files changed coverage rate:
                                         |Lines       |Functions  |Branches    
  Filename                               |Rate     Num|Rate    Num|Rate     Num
  =============================================================================
  src/rules/no-implicit-any-catch.ts     |98.7%    159| 100%     6|96.4%     28

@JasonWeinzierl JasonWeinzierl added the enhancement New feature or request label Nov 22, 2024
@JasonWeinzierl JasonWeinzierl merged commit 93ef8e8 into main Nov 24, 2024
2 checks passed
@JasonWeinzierl JasonWeinzierl deleted the change-implicit-any-default branch November 24, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant