Skip to content
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

Align @typescript-eslint/no-inferrable-types rule across angular and typescript #139

Open
rajsite opened this issue Apr 9, 2024 · 1 comment

Comments

@rajsite
Copy link
Member

rajsite commented Apr 9, 2024

Describe the issue

When adopting the Angular rules we had resolved to not adopt Angular's Recommended Extras configuration of @typescript-eslint/no-inferrable-types. See resolution comment.

However because we extended the angular recommended rules directly and did not override the configuration, we have effectively been using Angulars recommendation for the typescript configuration in Angular projects (because the typescript configuration was overwritten by angular) and the typescript configuration for only typescript only projects. See discussion about extending from recommended rules.

As part of #138 the Angular extras confiig was removed so rules are being inlined to result in an effective no change.

To avoid inconsistency, we should either:

  • Keep the accidental adoption of the rule and move it to the typescript configuration to make it intentional.
    Proposal: '@typescript-eslint/no-inferrable-types': ['error',{ ignoreParameters: true }] to the typescript config and remove it from angular rules
  • Adopt our initial resolution and rely on the exisiting configuration (i.e. the result of the TypeScript recommended ruleset)
    Proposal: Remove explicit configuration from Angular so it resolves to the current TypeScript configuration

Another option not being proposed but documenting is to keep the Vanilla TypeScript and Angular TypeScript rules inconsistent. I do not think we want to do that though.

@jattasNI
Copy link
Collaborator

Consensus is to explicitly enable the rule for TypeScript. We would set ignoreParameters: true.

@jattasNI jattasNI removed the triage label Jun 27, 2024
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

No branches or pull requests

2 participants