Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

New option for variable-name rule to disallow identifiers which are also valid types in the scope #723

Closed
adidahiya opened this issue Oct 9, 2015 · 4 comments

Comments

@adidahiya
Copy link
Contributor

Suggested by @alexeagle here: microsoft/TypeScript#5187

Currently blocked on #680; we need the whole program's type information to be able to do this check.

@adidahiya adidahiya changed the title New rule option for variable-name rule to disallow identifiers which are also valid types in the scope New option for variable-name rule to disallow identifiers which are also valid types in the scope Oct 9, 2015
@alexeagle
Copy link
Contributor

Can I have an intermediate fix? For angular it would work to disallow untyped parameters in function types altogether.
I tried adding "typedef": [true, "parameter"], to our tslint config
https://github.com/angular/angular/blob/6abed8d996168f695e638c0c2d0fde1ad7ae273c/gulpfile.js#L294
but I get pages of errors, because it covers function declarations as well as function type expressions.

We like to move towards noImplicitAny in very slow steps, making each change manageable in size. So far I've written custom checks for this:
https://github.com/angular/angular/tree/6abed8d996168f695e638c0c2d0fde1ad7ae273c/tools/tslint

What do you think about more fine-grained configuration?

@JoshuaKGoldberg
Copy link
Contributor

Note: per #4534, this issue will be closed in less than a month if no PR is sent to add the rule. If you really need the rule, custom rules are always an option and can be maintained outside this repo!

@JoshuaKGoldberg
Copy link
Contributor

💀 It's time! 💀

TSLint is being deprecated and no longer accepting pull requests for new rules. See #4534. 😱

If you'd like to see this rule implemented, you have two choices:

👋 It was a pleasure open sourcing with you!

If you believe this message was posted here in error, please comment so we can re-open the issue!

@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants