-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Remove no-use-before-declare and no-duplicate-variable from tslint.json because it is covered by no-var-keyword #5755
Comments
I fail to see why |
@dave11mj the no-var-keyword rule forces you to use only |
Hey @Martin-Wegner after reading your explanation, and playing around with the tslint rules, both of these only trigger when using the keyword |
Hey @Martin-Wegner and @hansl ! I did some additional testing to validate or invalidate this issue, and it seems the Note: For both tests temporarily set For
|
@dave11mj my point was that the TypeScript compiler complains about the code above. The task of a linter is not to find compilation errors. |
@Martin-Wegner The code for So unless you are advocating for declaring variables at the bottom of the file, |
You declared the variables outside of the class which means a kind of global variables. This seems to be OK for the TypeScript compiler... Thanks for clarifying this. |
No problem ! It was a bit tough to test at first since I was trying it out similarly to your screenshot. xD End of the day |
@dave11mj so much time for such a small change :) |
I'd call it a step on the right direction towards |
Since tslint 5:
|
I'm not sure I understand why In my case, I'm trying to use the forwardRef() function from Maybe there's a way to do this without breaking the |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.0.0
node: 7.8.0
os: linux x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1
Repro steps.
The log given by the failure.
Desired functionality.
Mention any other details that might be useful.
The rule describtion (https://palantir.github.io/tslint/rules/no-use-before-declare/) for the no-use-before-declare rule says:
The rule describtion (https://palantir.github.io/tslint/rules/no-duplicate-variable/) for the no-duplicate-variable rule says:
The Angular CLI created tslint.json contains the no-use-before-declare rule, the no-duplicate-variable and the no-var-keyword rule.
When using the no-var-keyword rule the no-use-before-declare rule and no-duplicate-variable rules can be dropped.
The text was updated successfully, but these errors were encountered: