Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Commit adc48ee

Browse files
author
Manuel Lopez
committed
Merge branch 'master' into benchmark
# Conflicts: # package.json
2 parents 3f5c3cd + fdf0230 commit adc48ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1569
-2998
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [v4.0.0] - April 4, 2017
4+
### Upgraded to [TSLint 5.0](https://github.com/palantir/tslint/releases/tag/5.0.0)
5+
6+
37
## [v3.5.1] - 2017/03/17 23:00 GMT-0600
48
#### Fixes
59
- sort-imports bug in simple type imports ([3d57149])
@@ -274,6 +278,7 @@ Note that the npm release `v3.2.1` only contains this hotfix [cb01358].
274278
- Added and made lots of improvements in README.md
275279

276280

281+
[v4.0.0]: https://github.com/buzinas/tslint-eslint-rules/compare/v3.5.1...v4.0.0
277282
[v3.5.1]: https://github.com/buzinas/tslint-eslint-rules/compare/v3.5.0...v3.5.1
278283
[v3.5.0]: https://github.com/buzinas/tslint-eslint-rules/compare/v3.4.0...v3.5.0
279284
[v3.4.0]: https://github.com/buzinas/tslint-eslint-rules/compare/v3.3.0...v3.4.0

CONTRIBUTING.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ the issue easier and quicker.
1818

1919
* tslint and typescript version.
2020

21-
```sh
22-
$ tslint --version
23-
4.0.0
24-
$ tsc --version
25-
Version 2.0.10
26-
```
21+
$ tslint --version
22+
4.5.1
23+
$ tsc --version
24+
Version 2.2.1
2725

2826
* `tslint.json` configuration.
2927
* typescript code being linted.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ The following rules point out areas where you might have made mistakes.
8484
|:no_entry_sign:|[no-func-assign](http://eslint.org/docs/rules/no-func-assign)|Not applicable|disallow overwriting functions written as function declarations (recommended)|
8585
|:white_check_mark:|[no-inner-declarations](http://eslint.org/docs/rules/no-inner-declarations)|[no-inner-declarations](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noInnerDeclarationsRule.md)|disallow function or variable declarations in nested blocks (recommended)|
8686
|:white_check_mark:|[no-invalid-regexp](http://eslint.org/docs/rules/no-invalid-regexp)|[no-invalid-regexp](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noInvalidRegexpRule.md)|disallow invalid regular expression strings in the `RegExp` constructor (recommended)|
87-
|:white_check_mark:|[no-irregular-whitespace](http://eslint.org/docs/rules/no-irregular-whitespace)|[no-irregular-whitespace](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noIrregularWhitespaceRule.md)|disallow irregular whitespace outside of strings and comments (recommended)|
87+
|:white_check_mark:|[no-irregular-whitespace](http://eslint.org/docs/rules/no-irregular-whitespace)|[ter-no-irregular-whitespace](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/terNoIrregularWhitespaceRule.md)|disallow irregular whitespace (recommended)|
8888
|:no_entry_sign:|[no-negated-in-lhs](http://eslint.org/docs/rules/no-negated-in-lhs)|Not applicable|disallow negation of the left operand of an `in` expression (recommended)|
8989
|:no_entry_sign:|[no-obj-calls](http://eslint.org/docs/rules/no-obj-calls)|Not applicable|disallow the use of object properties of the global object (`Math` and `JSON`) as functions (recommended)|
9090
|:white_check_mark:|[no-regex-spaces](http://eslint.org/docs/rules/no-regex-spaces)|[no-regex-spaces](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noRegexSpacesRule.md)|disallow multiple spaces in a regular expression literal (recommended)|
91-
|:white_check_mark:|[no-sparse-arrays](http://eslint.org/docs/rules/no-sparse-arrays)|[no-sparse-arrays](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noSparseArraysRule.md)|disallow sparse arrays (recommended)|
91+
|:white_check_mark:|[no-sparse-arrays](http://eslint.org/docs/rules/no-sparse-arrays)|[ter-no-sparse-arrays](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/terNoSparseArraysRule.md)|disallow sparse arrays (recommended)|
9292
|:white_check_mark:|[no-unexpected-multiline](http://eslint.org/docs/rules/no-unexpected-multiline)|[no-unexpected-multiline](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/noUnexpectedMultilineRule.md)|Avoid code that looks like two expressions but is actually one|
9393
|:no_entry_sign:|[no-unreachable](http://eslint.org/docs/rules/no-unreachable)|Not applicable|disallow unreachable statements after a return, throw, continue, or break statement (recommended)|
9494
|:ballot_box_with_check:|[no-unsafe-finally](http://eslint.org/docs/rules/no-unsafe-finally)|[no-unsafe-finally](https://palantir.github.io/tslint/rules/no-unsafe-finally)|disallow control flow statements in finally blocks (recommended)|
@@ -191,7 +191,7 @@ These rules have to do with variable declarations.
191191
|:no_entry_sign:|[no-undef](http://eslint.org/docs/rules/no-undef)|Not applicable|disallow use of undeclared variables unless mentioned in a `/*global */` block (recommended)|
192192
|:x:|[no-undef-init](http://eslint.org/docs/rules/no-undef-init)|no-undef-init|disallow use of undefined when initializing variables|
193193
|:x:|[no-undefined](http://eslint.org/docs/rules/no-undefined)|no-undefined|disallow use of `undefined` variable|
194-
|:no_entry_sign:|[no-unused-vars](http://eslint.org/docs/rules/no-unused-vars)|Not applicable|[**DEPRECATED**: [no-unused-variable](https://github.com/palantir/tslint/issues/1481)] disallow declaration of variables that are not used in the code (recommended).|
194+
|:ballot_box_with_check:|[no-unused-vars](http://eslint.org/docs/rules/no-unused-vars)|[no-unused-variable](https://palantir.github.io/tslint/rules/no-unused-variable/)|disallow unused variables (recommended).|
195195
|:ballot_box_with_check:|[no-use-before-define](http://eslint.org/docs/rules/no-use-before-define)|[no-use-before-declare](http://palantir.github.io/tslint/rules/no-use-before-declare)|disallow use of variables before they are defined|
196196

197197
### Node.js and CommonJS
@@ -226,6 +226,7 @@ These rules are purely matters of style and are quite subjective.
226226
|:x:|[computed-property-spacing](http://eslint.org/docs/rules/computed-property-spacing)|computed-property-spacing|require or disallow padding inside computed properties|
227227
|:x:|[consistent-this](http://eslint.org/docs/rules/consistent-this)|consistent-this|enforce consistent naming when capturing the current execution context|
228228
|:ballot_box_with_check:|[eol-last](http://eslint.org/docs/rules/eol-last)|[eofline](https://palantir.github.io/tslint/rules/eofline)|enforce newline at the end of file, with no multiple empty lines|
229+
|:white_check_mark:|[func-call-spacing](http://eslint.org/docs/rules/func-call-spacing)|[ter-func-call-spacing](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/docs/rules/terFuncCallSpacingRule.md)|require or disallow spacing between function identifiers and their invocations|
229230
|:x:|[func-names](http://eslint.org/docs/rules/func-names)|func-names|require function expressions to have a name|
230231
|:x:|[func-style](http://eslint.org/docs/rules/func-style)|func-style|enforce use of function declarations or expressions|
231232
|:x:|[id-blacklist](http://eslint.org/docs/rules/id-blacklist)|id-blacklist|disallow certain identifiers to prevent them being used|

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ gulp.task('lint', function lint() {
5252
return gulp
5353
.src(SRC_FOLDER)
5454
.pipe(tslint({
55-
formatter: 'verbose',
55+
formatter: 'stylish',
5656
}))
5757
.pipe(tslint.report());
5858
});

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// unopinionated extensable tslint configuration
22
// loads rules for extending packages, but does not enable any
33
module.exports = {
4-
rulesDirectory: "dist/rules",
4+
rulesDirectory: "./dist/rules",
55
};

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tslint-eslint-rules",
3-
"version": "3.5.1",
3+
"version": "4.0.0",
44
"description": "Improve your TSLint with the missing ESLint Rules",
55
"main": "index.js",
66
"scripts": {
@@ -25,22 +25,25 @@
2525
"license": "MIT",
2626
"devDependencies": {
2727
"@types/benchmark": "^1.0.30",
28+
"@types/node": "^7.0.12",
2829
"benchmark": "^2.1.3",
2930
"chai": "^3.5.0",
3031
"es6-promise": "^4.0.4",
3132
"gulp": "^3.9.1",
3233
"gulp-sourcemaps": "^1.6.0",
3334
"gulp-spawn-mocha": "^2.2.2",
34-
"gulp-tslint": "^7.0.0",
35-
"gulp-typescript": "^3.0.1",
36-
"tslint": "^4.0.0",
37-
"typescript": "^2.0.3",
35+
"gulp-tslint": "^8.0.0",
36+
"gulp-typescript": "^3.1.6",
37+
"tslint": "^5.0.0",
38+
"typescript": "^2.2.0",
3839
"yargs": "^5.0.0"
3940
},
4041
"peerDependencies": {
41-
"tslint": "^4.5.0"
42+
"tslint": "^5.0.0"
4243
},
4344
"dependencies": {
44-
"doctrine": "^0.7.2"
45+
"doctrine": "^0.7.2",
46+
"tslib": "^1.0.0",
47+
"tsutils": "^1.4.0"
4548
}
4649
}

src/docs/rules/noIrregularWhitespaceRule.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/docs/rules/noSparseArraysRule.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!-- Start:AutoDoc:: Modify `src/readme/rules.ts` and run `gulp readme` to update block -->
2+
## ter-func-call-spacing (ESLint: [func-call-spacing](http://eslint.org/docs/rules/func-call-spacing))
3+
[![rule_source](https://img.shields.io/badge/%F0%9F%93%8F%20rule-source-green.svg)](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/rules/terFuncCallSpacingRule.ts)
4+
[![test_source](https://img.shields.io/badge/%F0%9F%93%98%20test-source-blue.svg)](https://github.com/buzinas/tslint-eslint-rules/blob/master/src/test/rules/terFuncCallSpacingRuleTests.ts)
5+
6+
require or disallow spacing between function identifiers and their invocations
7+
8+
#### Rationale
9+
10+
This rule will enforce consistency of spacing in function calls,
11+
by disallowing or requiring one or more spaces before the open paren.
12+
13+
### Config
14+
15+
This rule has a string option:
16+
17+
* `"never"` (default) disallows space between the function name and the opening parenthesis.
18+
* `"always"` requires space between the function name and the opening parenthesis.
19+
20+
Further, in `"always"` mode, a second object option is available that contains a single boolean `allowNewlines` property.
21+
22+
#### Examples
23+
24+
```json
25+
"ter-func-call-spacing": [true]
26+
```
27+
28+
```json
29+
"ter-func-call-spacing": [true, "always"]
30+
```
31+
32+
```json
33+
"ter-func-call-spacing": [true, "always", { allowNewlines: true }]
34+
```
35+
#### Schema
36+
37+
```json
38+
{
39+
"type": "array",
40+
"items": [
41+
{
42+
"enum": [
43+
"always",
44+
"never"
45+
]
46+
},
47+
{
48+
"type": "object",
49+
"properties": {
50+
"allowNewlines": {
51+
"type": "boolean"
52+
}
53+
},
54+
"additionalProperties": false
55+
}
56+
],
57+
"minItems": 0,
58+
"maxItems": 2
59+
}
60+
```
61+
<!-- End:AutoDoc -->

src/docs/rules/terIndentRule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cleaner diffs in version control, and easier programmatic manipulation.
1515
The string 'tab' or an integer indicating the number of spaces to use per tab.
1616

1717
An object may be provided to fine tune the indentation rules:
18-
18+
1919
* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in
2020
`switch` statements
2121
* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators;
@@ -62,7 +62,7 @@ An object may be provided to fine tune the indentation rules:
6262
"body": 1
6363
}
6464
}
65-
]
65+
]
6666
```
6767
#### Schema
6868

0 commit comments

Comments
 (0)