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

Rule proposal: @typescript-eslint/no-implicit-any (Warning alternative for tsconfig.json option causes error.) #3979

Closed
infacto opened this issue Oct 7, 2021 · 3 comments
Labels
enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin wontfix This will not be worked on

Comments

@infacto
Copy link

infacto commented Oct 7, 2021

I would prefer using @typescript-eslint/no-implicit-any instead of noImplicitAny of tsconfig.json. Because in ESLint I have the control to show this issue as warning. Setting noImplicitAny in tsconfig is always an error.

// Param "value" has implicit any type. Show warning. (Not error)
public myMethod(value): void {
  console.log(value);
}
@infacto infacto added enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Oct 7, 2021
@StephanBijzitter
Copy link

This would be amazing, it would make transitioning from noImplicitAny: false to true a lot easier!

@bradzacher
Copy link
Member

We do not recommend turning off noImplicitAny - this compiler option forms the foundation of a safe codebase. Turning it off can allow any to leak into your codebase.

Additionally we intentionally do not duplicate checks made by the compiler.

For those reasons I am going to reject this proposal.


@StephanBijzitter You can use our typedef rule to help progressively onboard a codebase onto noImplicitAny.

Note that this lint rule is designed to be a temporary lint rule to help you onboard only, and should not be left turned on forever.

Additionally our suite of no-unsafe-* rules will use type information to help you progressively find and fix the anys in your codebase.

@bradzacher bradzacher added wontfix This will not be worked on enhancement: new plugin rule New rule request for eslint-plugin and removed triage Waiting for maintainers to take a look enhancement: new base rule extension New base rule extension required to handle a TS specific case labels Oct 7, 2021
@infacto
Copy link
Author

infacto commented Oct 8, 2021

@bradzacher Generally I agree with you. But sometimes you play with code in live reload. And guys can disrupt the flow when testing some solutions or prototype something. Ich bin nicht gegen typen. I like the strict mode, etc. But in this case it's slightly another case.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants