From 76dbf8aee0a1969bc07eb9fcf95032bad4039e90 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 15 Jan 2019 17:01:24 -0500 Subject: [PATCH 1/8] test(plugin-typescript): add a snapshot-based rule testing system --- .../lib/rules/adjacent-overload-signatures.js | 794 ------------------ .../adjacent-overload-signatures.snap.ts | 448 ++++++++++ .../rules/adjacent-overload-signatures.src.ts | 402 +++++++++ .../eslint-plugin-typescript/tools/test.js | 101 +++ 4 files changed, 951 insertions(+), 794 deletions(-) delete mode 100644 packages/eslint-plugin-typescript/tests/lib/rules/adjacent-overload-signatures.js create mode 100644 packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.snap.ts create mode 100644 packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.src.ts create mode 100644 packages/eslint-plugin-typescript/tools/test.js diff --git a/packages/eslint-plugin-typescript/tests/lib/rules/adjacent-overload-signatures.js b/packages/eslint-plugin-typescript/tests/lib/rules/adjacent-overload-signatures.js deleted file mode 100644 index a482155f1fc2..000000000000 --- a/packages/eslint-plugin-typescript/tests/lib/rules/adjacent-overload-signatures.js +++ /dev/null @@ -1,794 +0,0 @@ -/** - * @fileoverview Enforces member overloads to be consecutive. - * @author Patricio Trevino - */ -'use strict'; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const rule = require('../../../lib/rules/adjacent-overload-signatures'), - RuleTester = require('eslint').RuleTester; - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -const ruleTester = new RuleTester({ - parser: 'typescript-eslint-parser' -}); - -ruleTester.run('adjacent-overload-signatures', rule, { - valid: [ - { - code: ` -function error(a: string); -function error(b: number); -function error(ab: string|number){ } -export { error }; - `, - parserOptions: { sourceType: 'module' } - }, - { - code: ` -import { connect } from 'react-redux'; -export interface ErrorMessageModel { message: string; } -function mapStateToProps() { } -function mapDispatchToProps() { } -export default connect(mapStateToProps, mapDispatchToProps)(ErrorMessage); - `, - parserOptions: { sourceType: 'module' } - }, - ` -export const foo = "a", bar = "b"; -export interface Foo {} -export class Foo {} - `, - ` -export interface Foo {} -export const foo = "a", bar = "b"; -export class Foo {} - `, - ` -const foo = "a", bar = "b"; -interface Foo {} -class Foo {} - `, - ` -interface Foo {} -const foo = "a", bar = "b"; -class Foo {} - `, - ` -export class Foo {} -export class Bar {} - -export type FooBar = Foo | Bar; - `, - ` -export interface Foo {} -export class Foo {} -export class Bar {} - -export type FooBar = Foo | Bar; - `, - ` -export function foo(s: string); -export function foo(n: number); -export function foo(sn: string | number) {} -export function bar(): void {} -export function baz(): void {} - `, - ` -function foo(s: string); -function foo(n: number); -function foo(sn: string | number) {} -function bar(): void {} -function baz(): void {} - `, - ` -declare function foo(s: string); -declare function foo(n: number); -declare function foo(sn: string | number); -declare function bar(): void; -declare function baz(): void; - `, - ` -declare module "Foo" { - export function foo(s: string): void; - export function foo(n: number): void; - export function foo(sn: string | number): void; - export function bar(): void; - export function baz(): void; -} - `, - ` -declare namespace Foo { - export function foo(s: string): void; - export function foo(n: number): void; - export function foo(sn: string | number): void; - export function bar(): void; - export function baz(): void; -} - `, - ` -type Foo = { - foo(s: string): void; - foo(n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - ` -type Foo = { - foo(s: string): void; - ["foo"](n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - ` -interface Foo { - (s: string): void; - (n: number): void; - (sn: string | number): void; - foo(n: number): void; - bar(): void; - baz(): void; -} - `, - ` -interface Foo { - foo(s: string): void; - foo(n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - ` -interface Foo { - foo(s: string): void; - ["foo"](n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - ` -interface Foo { - foo(): void; - bar: { - baz(s: string): void; - baz(n: number): void; - baz(sn: string | number): void; - } -} - `, - ` -interface Foo { - new(s: string); - new(n: number); - new(sn: string | number); - foo(): void; -} - `, - ` -class Foo { - constructor(s: string); - constructor(n: number); - constructor(sn: string | number) {} - bar(): void {} - baz(): void {} -} - `, - ` -class Foo { - foo(s: string): void; - foo(n: number): void; - foo(sn: string | number): void {} - bar(): void {} - baz(): void {} -} - `, - ` -class Foo { - foo(s: string): void; - ["foo"](n: number): void; - foo(sn: string | number): void {} - bar(): void {} - baz(): void {} -} - `, - ` -class Foo { - name: string; - foo(s: string): void; - foo(n: number): void; - foo(sn: string | number): void {} - bar(): void {} - baz(): void {} -} - `, - // examples from https://github.com/nzakas/eslint-plugin-typescript/issues/138 - 'export default function(foo : T) {}', - 'export default function named(foo : T) {}' - ], - invalid: [ - { - code: ` -export function foo(s: string); -export function foo(n: number); -export function bar(): void {} -export function baz(): void {} -export function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -export function foo(s: string); -export function foo(n: number); -export type bar = number; -export type baz = number | string; -export function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -function foo(s: string); -function foo(n: number); -function bar(): void {} -function baz(): void {} -function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -function foo(s: string); -function foo(n: number); -type bar = number; -type baz = number | string; -function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -function foo(s: string) {} -function foo(n: number) {} -const a = ""; -const b = ""; -function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -function foo(s: string) {} -function foo(n: number) {} -class Bar {} -function foo(sn: string | number) {} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 5, - column: 1 - } - ] - }, - { - code: ` -function foo(s: string) {} -function foo(n: number) {} -function foo(sn: string | number) {} -class Bar { - foo(s: string); - foo(n: number); - name: string; - foo(sn: string | number) { } -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 9, - column: 5 - } - ] - }, - { - code: ` -declare function foo(s: string); -declare function foo(n: number); -declare function bar(): void; -declare function baz(): void; -declare function foo(sn: string | number); - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -declare function foo(s: string); -declare function foo(n: number); -const a = ""; -const b = ""; -declare function foo(sn: string | number); - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 6, - column: 1 - } - ] - }, - { - code: ` -declare module "Foo" { - export function foo(s: string): void; - export function foo(n: number): void; - export function bar(): void; - export function baz(): void; - export function foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -declare module "Foo" { - export function foo(s: string): void; - export function foo(n: number): void; - export function foo(sn: string | number): void; - function baz(s: string): void; - export function bar(): void; - function baz(n: number): void; - function baz(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'baz' }, - line: 8, - column: 5 - } - ] - }, - { - code: ` -declare namespace Foo { - export function foo(s: string): void; - export function foo(n: number): void; - export function bar(): void; - export function baz(): void; - export function foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -declare namespace Foo { - export function foo(s: string): void; - export function foo(n: number): void; - export function foo(sn: string | number): void; - function baz(s: string): void; - export function bar(): void; - function baz(n: number): void; - function baz(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'baz' }, - line: 8, - column: 5 - } - ] - }, - { - code: ` -type Foo = { - foo(s: string): void; - foo(n: number): void; - bar(): void; - baz(): void; - foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -type Foo = { - foo(s: string): void; - ["foo"](n: number): void; - bar(): void; - baz(): void; - foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -type Foo = { - foo(s: string): void; - name: string; - foo(n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 5, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - (s: string): void; - foo(n: number): void; - (n: number): void; - (sn: string | number): void; - bar(): void; - baz(): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'call' }, - line: 5, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - foo(s: string): void; - foo(n: number): void; - bar(): void; - baz(): void; - foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - foo(s: string): void; - ["foo"](n: number): void; - bar(): void; - baz(): void; - foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - foo(s: string): void; - "foo"(n: number): void; - bar(): void; - baz(): void; - foo(sn: string | number): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - foo(s: string): void; - name: string; - foo(n: number): void; - foo(sn: string | number): void; - bar(): void; - baz(): void; -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 5, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - foo(): void; - bar: { - baz(s: string): void; - baz(n: number): void; - foo(): void; - baz(sn: string | number): void; - } -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'baz' }, - line: 8, - column: 9 - } - ] - }, - { - code: ` -interface Foo { - new(s: string); - new(n: number); - foo(): void; - bar(): void; - new(sn: string | number); -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'new' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -interface Foo { - new(s: string); - foo(): void; - new(n: number); - bar(): void; - new(sn: string | number); -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'new' }, - line: 5, - column: 5 - }, - { - messageId: 'adjacentSignature', - data: { name: 'new' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -class Foo { - constructor(s: string); - constructor(n: number); - bar(): void {} - baz(): void {} - constructor(sn: string | number) {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'constructor' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -class Foo { - foo(s: string): void; - foo(n: number): void; - bar(): void {} - baz(): void {} - foo(sn: string | number): void {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -class Foo { - foo(s: string): void; - ["foo"](n: number): void; - bar(): void {} - baz(): void {} - foo(sn: string | number): void {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -class Foo { - foo(s: string): void; - "foo"(n: number): void; - bar(): void {} - baz(): void {} - foo(sn: string | number): void {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 7, - column: 5 - } - ] - }, - { - code: ` -class Foo { - constructor(s: string); - name: string; - constructor(n: number); - constructor(sn: string | number) {} - bar(): void {} - baz(): void {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'constructor' }, - line: 5, - column: 5 - } - ] - }, - { - code: ` -class Foo { - foo(s: string): void; - name: string; - foo(n: number): void; - foo(sn: string | number): void {} - bar(): void {} - baz(): void {} -} - `, - errors: [ - { - messageId: 'adjacentSignature', - data: { name: 'foo' }, - line: 5, - column: 5 - } - ] - } - ] -}); diff --git a/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.snap.ts b/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.snap.ts new file mode 100644 index 000000000000..93d12fa657ee --- /dev/null +++ b/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.snap.ts @@ -0,0 +1,448 @@ +// [43:1] All 'foo' signatures should be adjacent + export function baz(): void { } + +>function foo(s: string); + ^ + function foo(n: number); + function foo(sn: string | number) { } + function bar(): void { } + + +// [46:1] All 'bar' signatures should be adjacent + function foo(n: number); + function foo(sn: string | number) { } +>function bar(): void { } + ^ + function baz(): void { } + + declare function foo(s: string); + + +// [47:1] All 'baz' signatures should be adjacent + function foo(sn: string | number) { } + function bar(): void { } +>function baz(): void { } + ^ + + declare function foo(s: string); + declare function foo(n: number); + + +// [49:1] All 'foo' signatures should be adjacent + function baz(): void { } + +>declare function foo(s: string); + ^ + declare function foo(n: number); + declare function foo(sn: string | number); + declare function bar(): void; + + +// [52:1] All 'bar' signatures should be adjacent + declare function foo(n: number); + declare function foo(sn: string | number); +>declare function bar(): void; + ^ + declare function baz(): void; + + declare module "Foo" { + + +// [53:1] All 'baz' signatures should be adjacent + declare function foo(sn: string | number); + declare function bar(): void; +>declare function baz(): void; + ^ + + declare module "Foo" { + export function foo(s: string): void; + + +// [165:1] All 'foo' signatures should be adjacent + export default function named(foo: T) { } + +>export function foo(s: string); + ^ + export function foo(n: number); + export function bar(): void { } + export function baz(): void { } + + +// [167:1] All 'bar' signatures should be adjacent + export function foo(s: string); + export function foo(n: number); +>export function bar(): void { } + ^ + export function baz(): void { } + export function foo(sn: string | number) { } + + + +// [168:1] All 'baz' signatures should be adjacent + export function foo(n: number); + export function bar(): void { } +>export function baz(): void { } + ^ + export function foo(sn: string | number) { } + + + + +// [169:1] All 'foo' signatures should be adjacent + export function bar(): void { } + export function baz(): void { } +>export function foo(sn: string | number) { } + ^ + + + export function foo(s: string); + + +// [176:1] All 'foo' signatures should be adjacent + export type bar = number; + export type baz = number | string; +>export function foo(sn: string | number) { } + ^ + + + function foo(s: string); + + +// [181:1] All 'bar' signatures should be adjacent + function foo(s: string); + function foo(n: number); +>function bar(): void { } + ^ + function baz(): void { } + function foo(sn: string | number) { } + + + +// [182:1] All 'baz' signatures should be adjacent + function foo(n: number); + function bar(): void { } +>function baz(): void { } + ^ + function foo(sn: string | number) { } + + + + +// [183:1] All 'foo' signatures should be adjacent + function bar(): void { } + function baz(): void { } +>function foo(sn: string | number) { } + ^ + + + function foo(s: string); + + +// [190:1] All 'foo' signatures should be adjacent + type bar = number; + type baz = number | string; +>function foo(sn: string | number) { } + ^ + + function foo(s: string) { } + function foo(n: number) { } + + +// [196:1] All 'foo' signatures should be adjacent + const a = ""; + const b = ""; +>function foo(sn: string | number) { } + ^ + + function foo(s: string) { } + function foo(n: number) { } + + +// [201:1] All 'foo' signatures should be adjacent + function foo(n: number) { } + class Bar { } +>function foo(sn: string | number) { } + ^ + + function foo(s: string) { } + function foo(n: number) { } + + +// [210:5] All 'foo' signatures should be adjacent + foo(n: number); + name: string; +> foo(sn: string | number) { } + ^ + } + + declare function foo(s: string); + + +// [213:1] All 'foo' signatures should be adjacent + } + +>declare function foo(s: string); + ^ + declare function foo(n: number); + declare function bar(): void; + declare function baz(): void; + + +// [215:1] All 'bar' signatures should be adjacent + declare function foo(s: string); + declare function foo(n: number); +>declare function bar(): void; + ^ + declare function baz(): void; + declare function foo(sn: string | number); + + + +// [216:1] All 'baz' signatures should be adjacent + declare function foo(n: number); + declare function bar(): void; +>declare function baz(): void; + ^ + declare function foo(sn: string | number); + + declare function foo(s: string); + + +// [217:1] All 'foo' signatures should be adjacent + declare function bar(): void; + declare function baz(): void; +>declare function foo(sn: string | number); + ^ + + declare function foo(s: string); + declare function foo(n: number); + + +// [223:1] All 'foo' signatures should be adjacent + const a = ""; + const b = ""; +>declare function foo(sn: string | number); + ^ + + declare module "Foo" { + export function foo(s: string): void; + + +// [230:5] All 'foo' signatures should be adjacent + export function bar(): void; + export function baz(): void; +> export function foo(sn: string | number): void; + ^ + } + + declare module "Foo" { + + +// [239:5] All 'baz' signatures should be adjacent + function baz(s: string): void; + export function bar(): void; +> function baz(n: number): void; + ^ + function baz(sn: string | number): void; + } + + + +// [248:5] All 'foo' signatures should be adjacent + export function bar(): void; + export function baz(): void; +> export function foo(sn: string | number): void; + ^ + } + + declare namespace Foo { + + +// [257:5] All 'baz' signatures should be adjacent + function baz(s: string): void; + export function bar(): void; +> function baz(n: number): void; + ^ + function baz(sn: string | number): void; + } + + + +// [266:5] All 'foo' signatures should be adjacent + bar(): void; + baz(): void; +> foo(sn: string | number): void; + ^ + } + + type Foo = { + + +// [274:5] All 'foo' signatures should be adjacent + bar(): void; + baz(): void; +> foo(sn: string | number): void; + ^ + } + + type Foo = { + + +// [280:5] All 'foo' signatures should be adjacent + foo(s: string): void; + name: string; +> foo(n: number): void; + ^ + foo(sn: string | number): void; + bar(): void; + baz(): void; + + +// [289:5] All 'call' signatures should be adjacent + (s: string): void; + foo(n: number): void; +> (n: number): void; + ^ + (sn: string | number): void; + bar(): void; + baz(): void; + + +// [300:5] All 'foo' signatures should be adjacent + bar(): void; + baz(): void; +> foo(sn: string | number): void; + ^ + } + + interface Foo { + + +// [308:5] All 'foo' signatures should be adjacent + bar(): void; + baz(): void; +> foo(sn: string | number): void; + ^ + } + + interface Foo { + + +// [316:5] All 'foo' signatures should be adjacent + bar(): void; + baz(): void; +> foo(sn: string | number): void; + ^ + } + + interface Foo { + + +// [322:5] All 'foo' signatures should be adjacent + foo(s: string): void; + name: string; +> foo(n: number): void; + ^ + foo(sn: string | number): void; + bar(): void; + baz(): void; + + +// [334:9] All 'baz' signatures should be adjacent + baz(n: number): void; + foo(): void; +> baz(sn: string | number): void; + ^ + } + } + + + +// [343:5] All 'new' signatures should be adjacent + foo(): void; + bar(): void; +> new(sn: string | number); + ^ + } + + interface Foo { + + +// [349:5] All 'new' signatures should be adjacent + new(s: string); + foo(): void; +> new(n: number); + ^ + bar(): void; + new(sn: string | number); + } + + +// [351:5] All 'new' signatures should be adjacent + new(n: number); + bar(): void; +> new(sn: string | number); + ^ + } + + class Foo { + + +// [359:5] All 'constructor' signatures should be adjacent + bar(): void { } + baz(): void { } +> constructor(sn: string | number) { } + ^ + } + + class Foo { + + +// [367:5] All 'foo' signatures should be adjacent + bar(): void { } + baz(): void { } +> foo(sn: string | number): void { } + ^ + } + + class Foo { + + +// [375:5] All 'foo' signatures should be adjacent + bar(): void { } + baz(): void { } +> foo(sn: string | number): void { } + ^ + } + + class Foo { + + +// [383:5] All 'foo' signatures should be adjacent + bar(): void { } + baz(): void { } +> foo(sn: string | number): void { } + ^ + } + + class Foo { + + +// [389:5] All 'constructor' signatures should be adjacent + constructor(s: string); + name: string; +> constructor(n: number); + ^ + constructor(sn: string | number) { } + bar(): void { } + baz(): void { } + + +// [398:5] All 'foo' signatures should be adjacent + foo(s: string): void; + name: string; +> foo(n: number): void; + ^ + foo(sn: string | number): void { } + bar(): void { } + baz(): void { } diff --git a/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.src.ts b/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.src.ts new file mode 100644 index 000000000000..f3175db13dc9 --- /dev/null +++ b/packages/eslint-plugin-typescript/tests/rules/adjacent-overload-signatures.src.ts @@ -0,0 +1,402 @@ +function error(a: string); +function error(b: number); +function error(ab: string | number) { } +export { error }; + +import { connect } from 'react-redux'; +export interface ErrorMessageModel { message: string; } +function mapStateToProps() { } +function mapDispatchToProps() { } +export default connect(mapStateToProps, mapDispatchToProps)(ErrorMessage); + +export const foo = "a", bar = "b"; +export interface Foo { } +export class Foo { } + +export interface Foo { } +export const foo = "a", bar = "b"; +export class Foo { } + +const foo = "a", bar = "b"; +interface Foo { } +class Foo { } + +interface Foo { } +const foo = "a", bar = "b"; +class Foo { } + +export class Foo { } +export class Bar { } +export type FooBar = Foo | Bar; + +export interface Foo { } +export class Foo { } +export class Bar { } +export type FooBar = Foo | Bar; + +export function foo(s: string); +export function foo(n: number); +export function foo(sn: string | number) { } +export function bar(): void { } +export function baz(): void { } + +function foo(s: string); +function foo(n: number); +function foo(sn: string | number) { } +function bar(): void { } +function baz(): void { } + +declare function foo(s: string); +declare function foo(n: number); +declare function foo(sn: string | number); +declare function bar(): void; +declare function baz(): void; + +declare module "Foo" { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + export function bar(): void; + export function baz(): void; +} + +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + export function bar(): void; + export function baz(): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +type Foo = { + foo(s: string): void; + ["foo"](n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + (s: string): void; + (n: number): void; + (sn: string | number): void; + foo(n: number): void; + bar(): void; + baz(): void; +} + +interface Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + foo(s: string): void; + ["foo"](n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + foo(): void; + bar: { + baz(s: string): void; + baz(n: number): void; + baz(sn: string | number): void; + } +} + +interface Foo { + new(s: string); + new(n: number); + new(sn: string | number); + foo(): void; +} + +class Foo { + constructor(s: string); + constructor(n: number); + constructor(sn: string | number) { } + bar(): void { } + baz(): void { } +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void { } + bar(): void { } + baz(): void { } +} + +class Foo { + foo(s: string): void; + ["foo"](n: number): void; + foo(sn: string | number): void { } + bar(): void { } + baz(): void { } +} + +class Foo { + name: string; + foo(s: string): void; + foo(n: number): void; + foo(sn: string | number): void { } + bar(): void { } + baz(): void { } +} + +// examples from https://github.com/nzakas/eslint-plugin-typescript/issues/138 +export default function (foo: T) { } +export default function named(foo: T) { } + +export function foo(s: string); +export function foo(n: number); +export function bar(): void { } +export function baz(): void { } +export function foo(sn: string | number) { } + + +export function foo(s: string); +export function foo(n: number); +export type bar = number; +export type baz = number | string; +export function foo(sn: string | number) { } + + +function foo(s: string); +function foo(n: number); +function bar(): void { } +function baz(): void { } +function foo(sn: string | number) { } + + +function foo(s: string); +function foo(n: number); +type bar = number; +type baz = number | string; +function foo(sn: string | number) { } + +function foo(s: string) { } +function foo(n: number) { } +const a = ""; +const b = ""; +function foo(sn: string | number) { } + +function foo(s: string) { } +function foo(n: number) { } +class Bar { } +function foo(sn: string | number) { } + +function foo(s: string) { } +function foo(n: number) { } +function foo(sn: string | number) { } +class Bar { + foo(s: string); + foo(n: number); + name: string; + foo(sn: string | number) { } +} + +declare function foo(s: string); +declare function foo(n: number); +declare function bar(): void; +declare function baz(): void; +declare function foo(sn: string | number); + +declare function foo(s: string); +declare function foo(n: number); +const a = ""; +const b = ""; +declare function foo(sn: string | number); + +declare module "Foo" { + export function foo(s: string): void; + export function foo(n: number): void; + export function bar(): void; + export function baz(): void; + export function foo(sn: string | number): void; +} + +declare module "Foo" { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + function baz(s: string): void; + export function bar(): void; + function baz(n: number): void; + function baz(sn: string | number): void; +} + +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function bar(): void; + export function baz(): void; + export function foo(sn: string | number): void; +} + +declare namespace Foo { + export function foo(s: string): void; + export function foo(n: number): void; + export function foo(sn: string | number): void; + function baz(s: string): void; + export function bar(): void; + function baz(n: number): void; + function baz(sn: string | number): void; +} + +type Foo = { + foo(s: string): void; + foo(n: number): void; + bar(): void; + baz(): void; + foo(sn: string | number): void; +} + +type Foo = { + foo(s: string): void; + ["foo"](n: number): void; + bar(): void; + baz(): void; + foo(sn: string | number): void; +} + +type Foo = { + foo(s: string): void; + name: string; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + (s: string): void; + foo(n: number): void; + (n: number): void; + (sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void; + baz(): void; + foo(sn: string | number): void; +} + +interface Foo { + foo(s: string): void; + ["foo"](n: number): void; + bar(): void; + baz(): void; + foo(sn: string | number): void; +} + +interface Foo { + foo(s: string): void; + "foo"(n: number): void; + bar(): void; + baz(): void; + foo(sn: string | number): void; +} + +interface Foo { + foo(s: string): void; + name: string; + foo(n: number): void; + foo(sn: string | number): void; + bar(): void; + baz(): void; +} + +interface Foo { + foo(): void; + bar: { + baz(s: string): void; + baz(n: number): void; + foo(): void; + baz(sn: string | number): void; + } +} + +interface Foo { + new(s: string); + new(n: number); + foo(): void; + bar(): void; + new(sn: string | number); +} + +interface Foo { + new(s: string); + foo(): void; + new(n: number); + bar(): void; + new(sn: string | number); +} + +class Foo { + constructor(s: string); + constructor(n: number); + bar(): void { } + baz(): void { } + constructor(sn: string | number) { } +} + +class Foo { + foo(s: string): void; + foo(n: number): void; + bar(): void { } + baz(): void { } + foo(sn: string | number): void { } +} + +class Foo { + foo(s: string): void; + ["foo"](n: number): void; + bar(): void { } + baz(): void { } + foo(sn: string | number): void { } +} + +class Foo { + foo(s: string): void; + "foo"(n: number): void; + bar(): void { } + baz(): void { } + foo(sn: string | number): void { } +} + +class Foo { + constructor(s: string); + name: string; + constructor(n: number); + constructor(sn: string | number) { } + bar(): void { } + baz(): void { } +} + +class Foo { + foo(s: string): void; + name: string; + foo(n: number): void; + foo(sn: string | number): void { } + bar(): void { } + baz(): void { } +} diff --git a/packages/eslint-plugin-typescript/tools/test.js b/packages/eslint-plugin-typescript/tools/test.js new file mode 100644 index 000000000000..a897f26b1e40 --- /dev/null +++ b/packages/eslint-plugin-typescript/tools/test.js @@ -0,0 +1,101 @@ +"use strict"; + +const path = require("path"); +const fs = require("fs"); +const diff = require("cli-diff").default; + +const { Linter, CLIEngine } = require("eslint"); +const { rules } = require("../lib"); + +const project = path.dirname(__dirname); +const tests = path.join(project, "tests", "rules"); + +const format = new CLIEngine().getFormatter("codeframe"); +const fakeName = "source.ts"; + +const linter = new Linter(); + +linter.defineRules(rules); + +const testedRules = fs + .readdirSync(tests) + .filter(name => !name.endsWith(".snap.ts")) + .map(name => name.replace(".src.ts", "")); + +for (const rule of testedRules) { + console.log(`testing ${rule}...`); + + const snapPath = path.join(tests, `${rule}.snap.ts`); + + const source = fs.readFileSync(path.join(tests, `${rule}.src.ts`), "utf8"); + const messages = linter.verify( + source, + { + parser: path.join(project, "parser.js"), + plugins: [require("../lib/index")], + useEslintrc: false, + rules: { [rule]: "error" }, + }, + fakeName + ); + + try { + // eslint-disable-next-line node/no-extraneous-require + require("chalk").enabled = false; + } catch (e) { + /* */ + } + + const received = format([ + { + filePath: fakeName, + messages, + errorCount: messages.length, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0, + source, + }, + ]) + .replace( + new RegExp( + String.raw`^error: (.+?) \(${rule}\) at ${fakeName.replace( + ".", + "\\." + )}:(\d+:\d+):$`, + "gm" + ), + "// [$2] $1" + ) + .replace(/^([ >]) (?:\d+|\s+) \| /gm, "$1") + .replace(/\n\n\n\d+ errors found\./, "\n"); + + try { + // eslint-disable-next-line node/no-extraneous-require + require("chalk").enabled = true; + } catch (e) { + /* */ + } + + if (fs.existsSync(snapPath)) { + const expected = fs.readFileSync(snapPath, "utf8"); + + const changes = diff(expected, received); + + if (changes) { + console.error(`${rule}: snapshots differ:`); + console.log(changes); + process.exit(1); + } else { + console.log(`${rule}: valid \u{2713}`); + } + } else { + if (process.env.CI) { + console.error(`${rule}: missing snapshot, not creating one in CI`); + process.exit(1); + } else { + fs.writeFileSync(snapPath, received); + console.log(`${rule}: created new snapshot \u{2713}`); + } + } +} From f56bee28cf4179972a592c4f0ffdefe641cc9045 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 08:03:50 -0500 Subject: [PATCH 2/8] build: ignore the snapshot tests --- .prettierignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 21ee8e970ee5..1ddeb1fbb2b8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,9 @@ **/tests/fixtures/**/* +**/tests/rules/* **/dist **/coverage **/typescript-eslint-shared-fixtures **/tests/integration/fixtures/**/* **/lib/configs/recommended.json **/.vscode -**/.nyc_output \ No newline at end of file +**/.nyc_output From 9246448cf9cc0c83f0e4d8e35f58d5d22a9df5cc Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 08:54:03 -0500 Subject: [PATCH 3/8] style: run Prettier --- .../eslint-plugin-typescript/tools/test.js | 166 +++++++++--------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/packages/eslint-plugin-typescript/tools/test.js b/packages/eslint-plugin-typescript/tools/test.js index a897f26b1e40..4bf3a3837007 100644 --- a/packages/eslint-plugin-typescript/tools/test.js +++ b/packages/eslint-plugin-typescript/tools/test.js @@ -1,101 +1,101 @@ -"use strict"; +'use strict'; -const path = require("path"); -const fs = require("fs"); -const diff = require("cli-diff").default; +const path = require('path'); +const fs = require('fs'); +const diff = require('cli-diff').default; -const { Linter, CLIEngine } = require("eslint"); -const { rules } = require("../lib"); +const { Linter, CLIEngine } = require('eslint'); +const { rules } = require('../lib'); const project = path.dirname(__dirname); -const tests = path.join(project, "tests", "rules"); +const tests = path.join(project, 'tests', 'rules'); -const format = new CLIEngine().getFormatter("codeframe"); -const fakeName = "source.ts"; +const format = new CLIEngine().getFormatter('codeframe'); +const fakeName = 'source.ts'; const linter = new Linter(); linter.defineRules(rules); const testedRules = fs - .readdirSync(tests) - .filter(name => !name.endsWith(".snap.ts")) - .map(name => name.replace(".src.ts", "")); + .readdirSync(tests) + .filter(name => !name.endsWith('.snap.ts')) + .map(name => name.replace('.src.ts', '')); for (const rule of testedRules) { - console.log(`testing ${rule}...`); - - const snapPath = path.join(tests, `${rule}.snap.ts`); - - const source = fs.readFileSync(path.join(tests, `${rule}.src.ts`), "utf8"); - const messages = linter.verify( - source, - { - parser: path.join(project, "parser.js"), - plugins: [require("../lib/index")], - useEslintrc: false, - rules: { [rule]: "error" }, - }, - fakeName - ); - - try { - // eslint-disable-next-line node/no-extraneous-require - require("chalk").enabled = false; - } catch (e) { - /* */ + console.log(`testing ${rule}...`); + + const snapPath = path.join(tests, `${rule}.snap.ts`); + + const source = fs.readFileSync(path.join(tests, `${rule}.src.ts`), 'utf8'); + const messages = linter.verify( + source, + { + parser: path.join(project, 'parser.js'), + plugins: [require('../lib/index')], + useEslintrc: false, + rules: { [rule]: 'error' } + }, + fakeName + ); + + try { + // eslint-disable-next-line node/no-extraneous-require + require('chalk').enabled = false; + } catch (e) { + /* */ + } + + const received = format([ + { + filePath: fakeName, + messages, + errorCount: messages.length, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0, + source } - - const received = format([ - { - filePath: fakeName, - messages, - errorCount: messages.length, - warningCount: 0, - fixableErrorCount: 0, - fixableWarningCount: 0, - source, - }, - ]) - .replace( - new RegExp( - String.raw`^error: (.+?) \(${rule}\) at ${fakeName.replace( - ".", - "\\." - )}:(\d+:\d+):$`, - "gm" - ), - "// [$2] $1" - ) - .replace(/^([ >]) (?:\d+|\s+) \| /gm, "$1") - .replace(/\n\n\n\d+ errors found\./, "\n"); - - try { - // eslint-disable-next-line node/no-extraneous-require - require("chalk").enabled = true; - } catch (e) { - /* */ + ]) + .replace( + new RegExp( + String.raw`^error: (.+?) \(${rule}\) at ${fakeName.replace( + '.', + '\\.' + )}:(\d+:\d+):$`, + 'gm' + ), + '// [$2] $1' + ) + .replace(/^([ >]) (?:\d+|\s+) \| /gm, '$1') + .replace(/\n\n\n\d+ errors found\./, '\n'); + + try { + // eslint-disable-next-line node/no-extraneous-require + require('chalk').enabled = true; + } catch (e) { + /* */ + } + + if (fs.existsSync(snapPath)) { + const expected = fs.readFileSync(snapPath, 'utf8'); + + const changes = diff(expected, received); + + if (changes) { + console.error(`${rule}: snapshots differ:`); + console.log(changes); + process.exit(1); + } else { + console.log(`${rule}: valid \u{2713}`); } - - if (fs.existsSync(snapPath)) { - const expected = fs.readFileSync(snapPath, "utf8"); - - const changes = diff(expected, received); - - if (changes) { - console.error(`${rule}: snapshots differ:`); - console.log(changes); - process.exit(1); - } else { - console.log(`${rule}: valid \u{2713}`); - } + } else { + if (process.env.CI) { + console.error(`${rule}: missing snapshot, not creating one in CI`); + process.exit(1); } else { - if (process.env.CI) { - console.error(`${rule}: missing snapshot, not creating one in CI`); - process.exit(1); - } else { - fs.writeFileSync(snapPath, received); - console.log(`${rule}: created new snapshot \u{2713}`); - } + fs.writeFileSync(snapPath, received); + console.log(`${rule}: created new snapshot \u{2713}`); } + } } From d7ed7d40b96d560496d078732ffd517fd59b7baa Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 09:07:08 -0500 Subject: [PATCH 4/8] build(plugin-typescript): upgrade eslint-docs --- .../eslint-plugin-typescript/package.json | 16 +++++++++++--- yarn.lock | 21 +++++++++++++------ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/eslint-plugin-typescript/package.json b/packages/eslint-plugin-typescript/package.json index ac55100bc692..7b8bb350e4f7 100644 --- a/packages/eslint-plugin-typescript/package.json +++ b/packages/eslint-plugin-typescript/package.json @@ -11,7 +11,10 @@ "engines": { "node": ">=6" }, - "repository": "typescript-eslint/typescript-eslint", + "repository": { + "type": "git", + "url": "git+https://github.com/typescript-eslint/typescript-eslint.git" + }, "bugs": { "url": "https://github.com/typescript-eslint/typescript-eslint/issues" }, @@ -29,10 +32,17 @@ }, "devDependencies": { "eslint": "^5.9.0", - "eslint-docs": "^0.2.6" + "eslint-docs": "^0.3.0" }, "peerDependencies": { "eslint": ">=4.13.1 < 6", "typescript": "~3.2.1" - } + }, + "homepage": "https://github.com/typescript-eslint/typescript-eslint#readme", + "directories": { + "doc": "docs", + "lib": "lib", + "test": "tests" + }, + "author": "" } diff --git a/yarn.lock b/yarn.lock index 1597cb6dbb27..9178889f59ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1672,6 +1672,14 @@ cli-cursor@^2.0.0, cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-diff@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-diff/-/cli-diff-1.0.0.tgz#c56f1fa17849a629bf07154a2bd199aefe742964" + integrity sha512-XOVrll4VMhxBv26WqV6OH9cWqRxBXthh3uZ3dtg+CLqB8m0R6QJiSoDIXQNXDAeo/FAkQ+kF9Ph8NhQskU3LpQ== + dependencies: + chalk "^2.4.1" + diff "^3.5.0" + cli-spinners@^1.1.0: version "1.3.1" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" @@ -2353,14 +2361,15 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-docs@^0.2.6: - version "0.2.7" - resolved "https://registry.yarnpkg.com/eslint-docs/-/eslint-docs-0.2.7.tgz#f208c3420fa2613f215a8daf5b9d75e9e7aa29ea" - integrity sha512-ylCFv96SW3aaWBrMFA7gai5tYntFXjy25CWNZWlAvamKCl7OYCTUfdUI40eAkO+3taxhGhTwCnIMHnwWwBxeYw== +eslint-docs@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-docs/-/eslint-docs-0.3.0.tgz#ac807ba84845235baa8683ef16f64c228d6eb352" + integrity sha512-IPMvDqhO//u14GGpwoZ63SBUT4iIaB5O5BS304gHAjNCpv26Dalv0s8PiNxJKz8qPWG5GD1vVJHt9Yq9wXSwJw== dependencies: chalk "^2.4.1" + cli-diff "^1.0.0" detect-newline "^2.1.0" - diff "^3.5.0" + indent-string "^3.2.0" mz "^2.7.0" ora "^3.0.0" read-pkg-up "^4.0.0" @@ -3398,7 +3407,7 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" -indent-string@^3.0.0: +indent-string@^3.0.0, indent-string@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= From 016ebfcccc6c2f41b084decaa3c4cf585e9e3db3 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 10:24:07 -0500 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20pass=20in=20the=20file=E2=80=99s=20?= =?UTF-8?q?real=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/eslint-plugin-typescript/tools/test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin-typescript/tools/test.js b/packages/eslint-plugin-typescript/tools/test.js index 4bf3a3837007..32938b1ecbb5 100644 --- a/packages/eslint-plugin-typescript/tools/test.js +++ b/packages/eslint-plugin-typescript/tools/test.js @@ -11,7 +11,6 @@ const project = path.dirname(__dirname); const tests = path.join(project, 'tests', 'rules'); const format = new CLIEngine().getFormatter('codeframe'); -const fakeName = 'source.ts'; const linter = new Linter(); @@ -27,7 +26,8 @@ for (const rule of testedRules) { const snapPath = path.join(tests, `${rule}.snap.ts`); - const source = fs.readFileSync(path.join(tests, `${rule}.src.ts`), 'utf8'); + const sourceName = `${rule}.src.ts`; + const source = fs.readFileSync(path.join(tests, sourceName), 'utf8'); const messages = linter.verify( source, { @@ -36,7 +36,7 @@ for (const rule of testedRules) { useEslintrc: false, rules: { [rule]: 'error' } }, - fakeName + sourceName ); try { @@ -48,7 +48,7 @@ for (const rule of testedRules) { const received = format([ { - filePath: fakeName, + filePath: sourceName, messages, errorCount: messages.length, warningCount: 0, @@ -59,7 +59,7 @@ for (const rule of testedRules) { ]) .replace( new RegExp( - String.raw`^error: (.+?) \(${rule}\) at ${fakeName.replace( + String.raw`^error: (.+?) \(${rule}\) at ${sourceName.replace( '.', '\\.' )}:(\d+:\d+):$`, From b4eb9dbb52f8181c62f8fe801a0f758618eaaab6 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 10:24:38 -0500 Subject: [PATCH 6/8] fix: pass `sourceType: module` --- packages/eslint-plugin-typescript/tools/test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin-typescript/tools/test.js b/packages/eslint-plugin-typescript/tools/test.js index 32938b1ecbb5..3f51139675ed 100644 --- a/packages/eslint-plugin-typescript/tools/test.js +++ b/packages/eslint-plugin-typescript/tools/test.js @@ -34,7 +34,10 @@ for (const rule of testedRules) { parser: path.join(project, 'parser.js'), plugins: [require('../lib/index')], useEslintrc: false, - rules: { [rule]: 'error' } + rules: { [rule]: 'error' }, + parserOptions: { + sourceType: 'module' + } }, sourceName ); From da5813def83db41020f3d1868be5ffe1af5c5180 Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 10:25:26 -0500 Subject: [PATCH 7/8] fix: install cli-diff --- packages/eslint-plugin-typescript/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-plugin-typescript/package.json b/packages/eslint-plugin-typescript/package.json index 7b8bb350e4f7..907bde360929 100644 --- a/packages/eslint-plugin-typescript/package.json +++ b/packages/eslint-plugin-typescript/package.json @@ -31,6 +31,7 @@ "typescript-eslint-parser": "21.0.2" }, "devDependencies": { + "cli-diff": "^1.0.0", "eslint": "^5.9.0", "eslint-docs": "^0.3.0" }, From 432681a8b017a2aa5582e5ec7d61e5378affd0bf Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Sat, 19 Jan 2019 10:36:10 -0500 Subject: [PATCH 8/8] build: upgrade eslint-docs (this reduces output in CI by about half) --- packages/eslint-plugin-typescript/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin-typescript/package.json b/packages/eslint-plugin-typescript/package.json index 907bde360929..9e58eb69f086 100644 --- a/packages/eslint-plugin-typescript/package.json +++ b/packages/eslint-plugin-typescript/package.json @@ -33,7 +33,7 @@ "devDependencies": { "cli-diff": "^1.0.0", "eslint": "^5.9.0", - "eslint-docs": "^0.3.0" + "eslint-docs": "^0.3.1" }, "peerDependencies": { "eslint": ">=4.13.1 < 6", diff --git a/yarn.lock b/yarn.lock index 9178889f59ec..62b449f8a30e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2361,10 +2361,10 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-docs@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-docs/-/eslint-docs-0.3.0.tgz#ac807ba84845235baa8683ef16f64c228d6eb352" - integrity sha512-IPMvDqhO//u14GGpwoZ63SBUT4iIaB5O5BS304gHAjNCpv26Dalv0s8PiNxJKz8qPWG5GD1vVJHt9Yq9wXSwJw== +eslint-docs@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/eslint-docs/-/eslint-docs-0.3.1.tgz#72660f9829084956b13db3dcad48d1bb5101b5f0" + integrity sha512-PexZtKnkSTl5H2qwVrp1KZzhRUvqGP5Jxm2E7I9jpz0RwkGQ19MLJcZbpKb3Xa/z6PM0vIhUeaftwjKegnKBwg== dependencies: chalk "^2.4.1" cli-diff "^1.0.0"