-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
feat(lint): Implement noImplicitAnyLet
#715
Conversation
WIll fix conflicts. |
b14ba5f
to
829e4a8
Compare
8a8892b
to
3ec0556
Compare
declare_rule! { | ||
/// Disallow use of implicit `any` type on variable declarations. | ||
/// | ||
/// Typescript variable declaration without any `type` or `initialization` can cause issue later in the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This @Conaclos 's suggestion is good to add.
ref: #395 (comment)
/// Typescript variable declaration without any `type` or `initialization` can cause issue later in the code. | |
/// TypeScript variable declaration without any type annotation and initialization have the `any` type. | |
/// The any type in TypeScript is a dangerous “escape hatch” from the type system. | |
/// Using any disables many type checking rules and is generally best used only as a last resort or when prototyping code. | |
/// TypeScript’s `--noImplicitAny` compiler option doesn't report this case. |
After fixing this, you need to run just codegen
again 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed it!
@TaKO8Ki Thanks for completing it! We can merge this after updating above suggestion. |
Summary
closes #389
closes #395
This implements a new rule to restrict the usage of variables without any type or initialisation in TS.
ref: https://www.typescriptlang.org/tsconfig#noImplicitAny
I have taken over #395. Thank you for the work @b4s36t4.
Test Plan
All existing tests should pass. #395 has added some test cases for valid and invalid situation and I've improved them.
In addition, I have corrected all the issues pointed out in #395 for now.