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
Showing
19 changed files
with
323 additions
and
108 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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
##### Peer dependencies ##### | ||
##### Peer dependencies | ||
|
||
The `typescript` module is a peer dependency of TSLint, which allows you to update the compiler independently from the | ||
linter. This also means that `tslint` will have to use the same version of `tsc` used to actually compile your sources. | ||
The `typescript` package is a peer dependency of TSLint. This allows you to update the compiler independently from the linter. | ||
This also means that `tslint` will have to use the same version of `tsc` which is used to actually compile your sources. | ||
|
||
Breaking changes in the latest dev release of `typescript@next` might break something in the linter if we haven't built against that release yet. If this happens to you, you can try: | ||
|
||
1. picking up `tslint@next`, which may have some bugfixes not released in `tslint@latest` | ||
(see [release notes here](https://github.com/palantir/tslint/releases)). | ||
2. rolling back `typescript` to a known working version. | ||
Although the peer dependency allows installing the latest nightly releases of `typescript@next`, be aware that these might include breaking changes that cause the linter to malfunction. |
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,16 @@ | ||
--- | ||
layout: page | ||
title: Formatters | ||
permalink: /formatters/ | ||
menu: main | ||
order: 2 | ||
--- | ||
|
||
_Formatters_ allow for transformation of lint results into various forms before outputting to stdout or a file. | ||
|
||
### Built-in formatters | ||
|
||
{% assign formatters = site.data.formatters | sort: "name" %} | ||
{% for formatter in formatters %} | ||
* [{{formatter.formatterName}}]({{formatter.formatterName}})</a> - {{formatter.description | markdownify | remove:"<p>" | remove: "</p>"}} | ||
{% endfor %} |
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,33 @@ | ||
--- | ||
layout: page | ||
title: Rules | ||
permalink: /rules/ | ||
menu: main | ||
order: 2 | ||
--- | ||
|
||
_Rules_ encode logic for syntactic & semantic checks of TypeScript source code. | ||
|
||
### TypeScript Specific | ||
|
||
_These rules find errors related to TypeScript features_: | ||
|
||
{% include rule_list.html ruleType="typescript" %} | ||
|
||
### Functionality | ||
|
||
_These rules catch common errors in JS programming or otherwise confusing constructs that are prone to producing bugs_: | ||
|
||
{% include rule_list.html ruleType="functionality" %} | ||
|
||
### Maintainability | ||
|
||
_These rules make code maintenance easier_: | ||
|
||
{% include rule_list.html ruleType="maintainability" %} | ||
|
||
### Style | ||
|
||
_These rules enforce consistent style across your codebase_: | ||
|
||
{% include rule_list.html ruleType="style" %} |
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,13 @@ | ||
--- | ||
ruleName: no-invalid-template-strings | ||
description: 'Warns on use of `${` in non-template strings.' | ||
optionsDescription: Not configurable. | ||
options: null | ||
optionExamples: | ||
- 'true' | ||
type: functionality | ||
typescriptOnly: false | ||
layout: rule | ||
title: 'Rule: no-invalid-template-strings' | ||
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,14 @@ | ||
--- | ||
ruleName: no-sparse-arrays | ||
description: Forbids array literals to contain missing elements. | ||
rationale: Missing elements are probably an accidentally duplicated comma. | ||
optionsDescription: Not configurable. | ||
options: null | ||
optionExamples: | ||
- 'true' | ||
type: functionality | ||
typescriptOnly: false | ||
layout: rule | ||
title: 'Rule: no-sparse-arrays' | ||
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
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 |
---|---|---|
@@ -1,12 +1,33 @@ | ||
--- | ||
ruleName: no-void-expression | ||
description: Requires expressions of type `void` to appear in statement position. | ||
optionsDescription: Not configurable. | ||
options: null | ||
optionsDescription: |- | ||
|
||
If `ignore-arrow-function-shorthand` is provided, `() => returnsVoid()` will be allowed. | ||
Otherwise, it must be written as `() => { returnsVoid(); }`. | ||
options: | ||
type: array | ||
items: | ||
type: string | ||
enum: | ||
- ignore-arrow-function-shorthand | ||
minLength: 0 | ||
maxLength: 1 | ||
requiresTypeInfo: true | ||
type: functionality | ||
typescriptOnly: false | ||
layout: rule | ||
title: 'Rule: no-void-expression' | ||
optionsJSON: 'null' | ||
optionsJSON: |- | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"ignore-arrow-function-shorthand" | ||
] | ||
}, | ||
"minLength": 0, | ||
"maxLength": 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.