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

Extend from tslint:latest #19309

Merged
2 commits merged into from
Oct 31, 2017
Merged

Extend from tslint:latest #19309

2 commits merged into from
Oct 31, 2017

Conversation

ghost
Copy link

@ghost ghost commented Oct 18, 2017

We've been ignoring the majority of lint rules and it looks like they'll unearth a lot of bad code. I'm leaving them as TODOs for now but this would get us started down the path of following tslint's recommendations.

@ghost ghost requested a review from aozgaa October 18, 2017 21:43
@ghost ghost changed the title Extend from tslint:recommended Extend from tslint:latest Oct 18, 2017
@ghost ghost force-pushed the tslint_recommended branch 2 times, most recently from bf3b88b to f1771bb Compare October 19, 2017 15:17
@ghost ghost force-pushed the tslint_recommended branch from f1771bb to 525a528 Compare October 19, 2017 15:19
@ghost ghost requested review from sandersn, sheetalkamat and armanio123 October 30, 2017 18:39
tslint.json Outdated
"variable-name": false,

// https://github.com/Microsoft/TypeScript/issues/18340
"align": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these seem to be too pedantic and not much value..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed by a formatter instead of by a human.

tslint.json Outdated
// TODO
"arrow-parens": false, // [true, "ban-single-arg-parens"]
"arrow-return-shorthand": false,
"ban-types": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not think we will do that one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would prevent us from typing a function as Function, which is unsafe. It also seems to fail on every reference to Symbol since we shadow that, but could be configured to ignore that one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't too hard to fix. #19586

tslint.json Outdated
"arrow-parens": false, // [true, "ban-single-arg-parens"]
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have this rule at all?

tslint.json Outdated
"ban-types": false,
"callable-types": false,
"forin": false,
"interface-name": false, // [true, "never-prefix"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be hard in the LS, unless we are willing to break some APIs

tslint.json Outdated
"forin": false,
"interface-name": false, // [true, "never-prefix"],
"member-access": false, // [true, "no-public"]
"no-angle-bracket-type-assertion": false,
Copy link
Contributor

@mhegazy mhegazy Oct 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these... :(

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lint rule mandating that only that kind of type assertion may be used, should we use that instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; I'm of the opinion that we should only use as casts since they're the only style that works in all language variants ;)

Also angle brackets are sharp and pointy.

tslint.json Outdated
"no-unnecessary-initializer": false,
"no-var-requires": false,
"object-literal-key-quotes": false,
"one-variable-per-declaration": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems overly restrictive

@ghost ghost force-pushed the tslint_recommended branch from aeb3a81 to 73aa04f Compare October 30, 2017 21:17
@ghost ghost force-pushed the tslint_recommended branch from 73aa04f to 79b9156 Compare October 30, 2017 22:28
@ghost ghost merged commit 9b215f3 into master Oct 31, 2017
@ghost ghost deleted the tslint_recommended branch October 31, 2017 15:12
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants