forked from palantir/tslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noah Chen
committed
Dec 16, 2016
1 parent
dc0ceca
commit bf8084a
Showing
18 changed files
with
277 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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,22 @@ | ||
--- | ||
formatterName: codeFrame | ||
description: Framed formatter which creates a frame of error code. | ||
descriptionDetails: |- | ||
|
||
Prints syntax highlighted code in a frame with a pointer to where | ||
exactly lint error is happening. | ||
sample: |- | ||
|
||
src/components/Payment.tsx | ||
Parentheses are required around the parameters of an arrow function definition (arrow-parens) | ||
21 | public componentDidMount() { | ||
22 | this.input.focus(); | ||
> 23 | loadStripe().then(Stripe => Stripe.pay()); | ||
| ^ | ||
24 | } | ||
25 | | ||
26 | public render() { | ||
consumer: human | ||
layout: formatter | ||
title: 'Formatter: codeFrame' | ||
--- |
This file contains 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 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 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 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,32 @@ | ||
--- | ||
ruleName: import-blacklist | ||
description: |- | ||
|
||
Disallows importing the specified modules directly via `import` and `require`. | ||
Instead only sub modules may be imported from that module. | ||
rationale: |- | ||
|
||
Some libraries allow importing their submodules instead of the entire module. | ||
This is good practise as it avoids loading unused modules. | ||
optionsDescription: A list of blacklisted modules. | ||
options: | ||
type: array | ||
items: | ||
type: string | ||
minLength: 1 | ||
optionExamples: | ||
- 'true' | ||
- '[true, "rxjs", "lodash"]' | ||
type: functionality | ||
typescriptOnly: false | ||
layout: rule | ||
title: 'Rule: import-blacklist' | ||
optionsJSON: |- | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minLength": 1 | ||
} | ||
--- |
This file contains 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,14 @@ | ||
--- | ||
ruleName: no-inferred-empty-object-type | ||
description: 'Disallow type inference of {} (empty object type) at function and constructor call sites' | ||
optionsDescription: Not configurable. | ||
options: null | ||
optionExamples: | ||
- 'true' | ||
type: functionality | ||
typescriptOnly: true | ||
requiresTypeInfo: true | ||
layout: rule | ||
title: 'Rule: no-inferred-empty-object-type' | ||
optionsJSON: 'null' | ||
--- |
This file contains 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,32 @@ | ||
--- | ||
ruleName: no-magic-numbers | ||
description: |- | ||
|
||
Disallows the use constant number values outside of variable assignments. | ||
When no list of allowed values is specified, -1, 0 and 1 are allowed by default. | ||
rationale: |- | ||
|
||
Magic numbers should be avoided as they often lack documentation, forcing | ||
them to be stored in variables gives them implicit documentation. | ||
optionsDescription: A list of allowed numbers. | ||
options: | ||
type: array | ||
items: | ||
type: number | ||
minLength: 1 | ||
optionExamples: | ||
- 'true' | ||
- '[true, 1, 2, 3]' | ||
type: typescript | ||
typescriptOnly: false | ||
layout: rule | ||
title: 'Rule: no-magic-numbers' | ||
optionsJSON: |- | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "number" | ||
}, | ||
"minLength": 1 | ||
} | ||
--- |
This file contains 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
Oops, something went wrong.