Skip to content

Extend from tslint:latest#19309

Merged
2 commits merged into
masterfrom
tslint_recommended
Oct 31, 2017
Merged

Extend from tslint:latest#19309
2 commits merged into
masterfrom
tslint_recommended

Conversation

@ghost
Copy link
Copy Markdown

@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 armanio123, sandersn and sheetalkamat October 30, 2017 18:39
Comment thread tslint.json
"variable-name": false,

// https://github.com/Microsoft/TypeScript/issues/18340
"align": false,
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread tslint.json
// TODO
"arrow-parens": false, // [true, "ban-single-arg-parens"]
"arrow-return-shorthand": false,
"ban-types": false,
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread tslint.json
"arrow-parens": false, // [true, "ban-single-arg-parens"]
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
Copy link
Copy Markdown
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?

Comment thread tslint.json Outdated
"ban-types": false,
"callable-types": false,
"forin": false,
"interface-name": false, // [true, "never-prefix"],
Copy link
Copy Markdown
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

Comment thread 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread tslint.json Outdated
"no-unnecessary-initializer": false,
"no-var-requires": false,
"object-literal-key-quotes": false,
"one-variable-per-declaration": false,
Copy link
Copy Markdown
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