-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): Add unified-signature rule #178
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
Merged
JamesHenry
merged 24 commits into
typescript-eslint:master
from
armanio123:AddTypeScriptUnifiedSignatureRule
Mar 20, 2019
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f44e75f
Added tslint unified-signatures rule
armanio123 ce97e17
Added unified-signatures documentation
armanio123 04a4d8f
Merge branch 'master' into AddTypeScriptUnifiedSignatureRule
armanio123 ccabfcf
Merge branch 'master' into AddTypeScriptUnifiedSignatureRule
armanio123 a4d6425
Fixes to unified-signatures rule
armanio123 c89abbd
Merge branch 'AddTypeScriptUnifiedSignatureRule' of https://github.co…
armanio123 97c33d9
Fixed formatting on unified-signatures rule
armanio123 be3cbc5
Merge branch 'master' into AddTypeScriptUnifiedSignatureRule
armano2 1f4c7fe
docs(eslint-plugin): fix merge conflict
armano2 2c85da6
Merge remote-tracking branch 'upstream/master' into AddTypeScriptUnif…
armanio123 f36a9c3
Merge remote-tracking branch 'upstream/master' into AddTypeScriptUnif…
armanio123 aa24eda
feat(unified-signature): migrated to ts, used messageId
armanio123 5361fa1
Merge remote-tracking branch 'upstream/master' into AddTypeScriptUnif…
armanio123 8ddc74f
Merge branch 'AddTypeScriptUnifiedSignatureRule' of https://github.co…
armanio123 312a182
fix(eslint-plugin): fixed case block lint issue
armanio123 2fd63d1
fix(unified-signatures): improved types
armanio123 f2a0d9d
fix(unified-signatures): improved tests
armanio123 13a26e5
fix(unified-signatures): fixed link in roadmap
armanio123 c73f278
fix(unified-signatures): fixed lint break
armanio123 e634646
Merge branch 'master' into AddTypeScriptUnifiedSignatureRule
armanio123 95f88f8
fix(unified-signatures): more tests improvements
armanio123 d66539c
Merge branch 'AddTypeScriptUnifiedSignatureRule' of https://github.co…
armanio123 e755f3b
fix(unified-signatures): even more tests improvements
armanio123 6bc8f5a
Merge branch 'master' into AddTypeScriptUnifiedSignatureRule
JamesHenry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter. (unified-signatures) | ||
|
||
Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter. | ||
|
||
## Rule Details | ||
|
||
This rule aims to keep the source code as maintanable as posible by reducing the amount of overloads. | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```ts | ||
function f(x: number): void; | ||
function f(x: string): void; | ||
``` | ||
|
||
```ts | ||
f(): void; | ||
f(...x: number[]): void; | ||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```ts | ||
function f(x: number | string): void; | ||
``` | ||
|
||
```ts | ||
function f(x?: ...number[]): void; | ||
``` | ||
|
||
## Related to | ||
|
||
- TSLint: ['unified-signatures`](https://palantir.github.io/tslint/rules/unified-signatures/) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add the link at the bottom of the file or else this won't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.