Skip to content

[prefer-optional-chain] Breaking change in v5.16.0 - requires type information #4755

@avaly

Description

@avaly
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/prefer-optional-chain": ["error"]
  }
}
// your repro code case

Expected Result

This rule used to work without type information before v5.16.0

Actual Result

Upgrading to v5.16.0, it now requires type information.

Error: Error while loading rule '@typescript-eslint/prefer-optional-chain': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.

Additional Info

This is a breaking change and should be included in a major version bump.

Also, the documentation table on the rules do not mention this rule requires type information: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin

Regression introduced in #4430

Versions

package version
@typescript-eslint/eslint-plugin 5.16.0
@typescript-eslint/parser 5.16.0
TypeScript 4.6.2
ESLint 8.11.0
node 14.19.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy