8000 Merge remote-tracking branch 'origin/master' into requires-type-info-… · NilSet/typescript-eslint@3e1db18 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e1db18

Browse files
author
Thomas Levy
committed
Merge remote-tracking branch 'origin/master' into requires-type-info-docs
2 parents cbafaeb + bea6b92 commit 3e1db18

26 files changed

+1397
-26
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"sourceType": "module",
2626
"ecmaFeatures": {
2727
"jsx": false
28-
}
28+
},
29+
"project": "./tsconfig.base.json"
2930
},
3031
"overrides": [
3132
{

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this B428 project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20)
7+
8+
### Bug Fixes
9+
10+
- **eslint-plugin:** [interface-name-prefix] correct error message in always mode ([#333](https://github.com/typescript-eslint/typescript-eslint/issues/333)) ([097262f](https://github.com/typescript-eslint/typescript-eslint/commit/097262f))
11+
- **eslint-plugin:** fix false positives for adjacent-overload-signatures regarding computed property names ([#340](https://github.com/typescript-eslint/typescript-eslint/issues/340)) ([f6e5118](https://github.com/typescript-eslint/typescript-eslint/commit/f6e5118))
12+
- **eslint-plugin:** fix incorrect rule name ([#357](https://github.com/typescript-eslint/typescript-eslint/issues/357)) ([0a5146b](https://github.com/typescript-eslint/typescript-eslint/commit/0a5146b))
13+
- **typescript-estree:** only call watch callback on new files ([#367](https://github.com/typescript-eslint/typescript-eslint/issues/367)) ([0ef07c4](https://github.com/typescript-eslint/typescript-eslint/commit/0ef07c4))
14+
15+
### Features
16+
17+
- **eslint-plugin:** Add unified-signature rule ([#178](https://github.com/typescript-eslint/typescript-eslint/issues/178)) ([6ffaa0b](https://github.com/typescript-eslint/typescript-eslint/commit/6ffaa0b))
18+
619
## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25)
720

821
### Bug Fixes

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.4.2",
2+
"version": "1.5.0",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
55
"stream": true

packages/eslint-plugin-tslint/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20)
7+
8+
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
9+
610
## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25)
711

812
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint

packages/eslint-plugin-tslint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@typescript-eslint/eslint-plugin-tslint",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"main": "dist/index.js",
55
"typings": "src/index.ts",
66
"description": "TSLint wrapper plugin for ESLint",
@@ -35,6 +35,6 @@
3535
"devDependencies": {
3636
"@types/eslint": "^4.16.3",
3737
"@types/lodash.memoize": "^4.1.4",
38-
"@typescript-eslint/parser": "1.4.2"
38+
"@typescript-eslint/parser": "1.5.0"
3939
}
4040
}

packages/eslint-plugin/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20)
7+
8+
### Bug Fixes
9+
10+
- **eslint-plugin:** [interface-name-prefix] correct error message in always mode ([#333](https://github.com/typescript-eslint/typescript-eslint/issues/333)) ([097262f](https://github.com/typescript-eslint/typescript-eslint/commit/097262f))
11+
- **eslint-plugin:** fix false positives for adjacent-overload-signatures regarding computed property names ([#340](https://github.com/typescript-eslint/typescript-eslint/issues/340)) ([f6e5118](https://github.com/typescript-eslint/typescript-eslint/commit/f6e5118))
12+
- **eslint-plugin:** fix incorrect rule name ([#357](https://github.com/typescript-eslint/typescript-eslint/issues/357)) ([0a5146b](https://github.com/typescript-eslint/typescript-eslint/commit/0a5146b))
13+
14+
### Features
15+
16+
- **eslint-plugin:** Add unified-signature rule ([#178](https://github.com/typescript-eslint/typescript-eslint/issues/178)) ([6ffaa0b](https://github.com/typescript-eslint/typescript-eslint/commit/6ffaa0b))
17+
618
## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25)
719

820
**Note:** Version bump only for package @typescript-eslint/eslint-plugin

packages/eslint-plugin/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,6 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e
152152
| [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async. (`promise-function-async` from TSLint) | | | :thought_balloon: |
153153
| [`@typescript-eslint/restrict-plus-operands`](./docs/rules/restrict-plus-operands.md) | When adding two variables, operands must both be of type number or of type string. (`restrict-plus-operands` from TSLint) | | | :thought_balloon: |
154154
| [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations (`typedef-whitespace` from TSLint) | :heavy_check_mark: | :wrench: | |
155+
| [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one. (`unified-signatures` from TSLint) | | | |
155156

156157
<!-- end rule list -->

packages/eslint-plugin/ROADMAP.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
| [`promise-function-async`] || [`@typescript-eslint/promise-function-async`] |
3535
| [`typedef`] | 🛑 | N/A |
3636
| [`typedef-whitespace`] || [`@typescript-eslint/type-annotation-spacing`] |
37-
| [`unified-signatures`] | 🛑 | N/A |
37+
| [`unified-signatures`] | | [`@typescript-eslint/unified-signatures`] |
3838

3939
### Functionality
4040

@@ -589,6 +589,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint-
589589
[`@typescript-eslint/no-unnecessary-type-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
590590
[`@typescript-eslint/no-var-requires`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md
591591
[`@typescript-eslint/type-annotation-spacing`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
592+
[`@typescript-eslint/unified-signatures`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md
592593
[`@typescript-eslint/no-misused-new`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md
593594
[`@typescript-eslint/no-object-literal-type-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-object-literal-type-assertion.md
594595
[`@typescript-eslint/no-this-alias`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-this-alias.md

packages/eslint-plugin/docs/rules/explicit-function-return-type.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,20 @@ node.addEventListener('click', function() {});
8484
const foo = arr.map(i => i * i);
8585
```
8686

87+
### allowTypedFunctionExpressions
88+
89+
Examples of additional **correct** code for this rule with `{ allowTypedFunctionExpressions: true }`:
90+
91+
```ts
92+
type FuncType = () => string;
93+
94+
let arrowFn: FuncType = () => 'test';
95+
96+
let funcExpr: FuncType = function() {
97+
return 'test';
98+
};
99+
```
100+
87101
## When Not To Use It
88102

89103
If you don't wish to prevent calling code from using function return values in unexpected ways, then
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter. (unified-signatures)
2+
3+
Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter.
4+
5+
## Rule Details
6+
7+
This rule aims to keep the source code as maintanable as posible by reducing the amount of overloads.
8+
9+
Examples of **incorrect** code for this rule:
10+
11+
```ts
12+
function f(x: number): void;
13+
function f(x: string): void;
14+
```
15+
16+
```ts
17+
f(): void;
18+
f(...x: number[]): void;
19+
```
20+
21+
Examples of **correct** code for this rule:
22+
23+
```ts
24+
function f(x: number | string): void;
25+
```
26+
27+
```ts
28+
function f(x?: ...number[]): void;
29+
```
30+
31+
## Related to
32+
33+
- TSLint: ['unified-signatures`](https://palantir.github.io/tslint/rules/unified-signatures/)

0 commit comments

Comments
 (0)
0