Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Enable no-use-before-declare in source code #603

Closed
reduckted opened this issue Oct 29, 2018 · 3 comments
Closed

Enable no-use-before-declare in source code #603

reduckted opened this issue Oct 29, 2018 · 3 comments
Labels
Resolution: Won't Fix Issues we can't or won't fix by design.
Milestone

Comments

@reduckted
Copy link
Contributor

The no-use-before-declare was temporarily disabled as part of #567. It needs to be re-enabled.

@reduckted
Copy link
Contributor Author

Most of the lint errors caused by this rule would be fixed once #586 is fixed, because the majority are caused by the RuleWalker class being declared after the Rule class.

@JoshuaKGoldberg
Copy link

Hey, sorry to shut this down, but I think we can skip having the rule enabled. Per the docs:

This rule is primarily useful when using the var keyword since the compiler will automatically detect if a block-scoped let and const variable is used before declaration. Since most modern TypeScript doesn’t use var, this rule is generally discouraged and is kept around for legacy purposes. It is slow to compute, is not enabled in the built-in configuration presets, and should not be used to inform TSLint design decisions.

Thoughts?

@reduckted
Copy link
Contributor Author

Thoughts?

Sounds good to me. All of the errors seemed to be around classes being "used" before they were defined (which wasn't technically the case), and by the sounds of it, the rule is targeted more at variables than classes.

@JoshuaKGoldberg JoshuaKGoldberg added Resolution: Won't Fix Issues we can't or won't fix by design. and removed Status: Awaiting More Feedback labels Oct 29, 2018
@JoshuaKGoldberg JoshuaKGoldberg added this to the None milestone Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Won't Fix Issues we can't or won't fix by design.
Projects
None yet
Development

No branches or pull requests

2 participants