Skip to content

[no-inferrable-types] Change defaults? + incorrect documentation #822

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

Closed
glen-84 opened this issue Aug 8, 2019 · 1 comment · Fixed by #729
Closed

[no-inferrable-types] Change defaults? + incorrect documentation #822

glen-84 opened this issue Aug 8, 2019 · 1 comment · Fixed by #729
Labels
breaking change This change will require a new major version to be released bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@glen-84
Copy link
Contributor

glen-84 commented Aug 8, 2019

Repro

{
  "rules": {
    "@typescript-eslint/no-inferrable-types": "error",
  }
}
class Foo {
  prop: number = 5;
}

function fn(a: number = 5, b: boolean = true) {}

Expected Result

Errors for inferrable types on properties and parameters.

Actual Result

No errors.

Additional Info

This is because ignoreParameters and ignoreProperties are true by default, which is inconsistent with TSLint* and seems like an odd choice.

* I know that you're not aiming for 1:1 with TSLint, but I see no reason to change the defaults in this case.

Also, the documentation says that the above code is invalid for the default options, but it's not.

Versions

package version
@typescript-eslint/eslint-plugin 1.13.0
@typescript-eslint/parser 1.13.0
TypeScript 3.4.5
ESLint 6.1.0
node 10.16.0
npm 6.9.0
@glen-84 glen-84 added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Aug 8, 2019
@bradzacher
Copy link
Member

hmmm - it looks like this is actually a bug introduced 8 months ago by me misinterpreting the base config

https://github.com/bradzacher/eslint-plugin-typescript/pull/261/files#diff-b3d257023fda2c7c79d1f23aab9ddf7c

@bradzacher bradzacher added bug Something isn't working good first issue Good for newcomers breaking change This change will require a new major version to be released has pr there is a PR raised to close this and removed triage Waiting for team members to take a look good first issue Good for newcomers labels Aug 8, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants