From 34a7cf69c6278b229ed28dfd4b804f8fa945bceb Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 21 Jul 2019 10:24:34 -0700 Subject: [PATCH 01/38] feat: explicitly support eslint v6 (#645) BREAKING CHANGE: Node 6 is no longer supported --- azure-pipelines.yml | 2 - package.json | 2 +- packages/eslint-plugin-tslint/package.json | 2 +- .../eslint-plugin-tslint/tests/index.spec.ts | 5 +- packages/eslint-plugin/package.json | 2 +- .../eslint-plugin/src/rules/array-type.ts | 3 +- .../src/rules/indent-new-do-not-use/index.ts | 5 +- packages/eslint-plugin/tests/RuleTester.ts | 43 ++++- .../tests/eslint-rules/no-redeclare.test.ts | 154 +++++++++++++----- .../tests/rules/array-type.test.ts | 20 ++- .../tests/rules/ban-ts-ignore.test.ts | 1 - .../rules/no-triple-slash-reference.test.ts | 1 - .../tests/rules/no-use-before-define.test.ts | 3 +- .../rules/type-annotation-spacing.test.ts | 2 - .../typings/eslint-ast-util.d.ts | 3 - .../eslint-plugin/typings/eslint-rules.d.ts | 2 +- .../src/ts-eslint/RuleTester.ts | 8 +- packages/parser/package.json | 2 +- .../tests/ast-alignment/utils.ts | 2 +- yarn.lock | 28 ++-- 20 files changed, 198 insertions(+), 92 deletions(-) delete mode 100644 packages/eslint-plugin/typings/eslint-ast-util.d.ts diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 68b6badba15a..960eb86b11d5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -62,8 +62,6 @@ jobs: node_version: 10.x node_8_x: node_version: 8.x - node_6_x: - node_version: 6.x steps: - task: NodeTool@0 inputs: diff --git a/package.json b/package.json index 1ec463befed2..66015996551d 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "all-contributors-cli": "^6.0.0", "babel-code-frame": "^6.26.0", "cz-conventional-changelog": "2.1.0", - "eslint": "^5.12.1", + "eslint": "^6.0.0", "eslint-plugin-eslint-plugin": "^2.0.1", "eslint-plugin-jest": "^22.2.2", "glob": "7.1.2", diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 788f41c147e6..b5075e0a351e 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -35,7 +35,7 @@ "lodash.memoize": "^4.1.2" }, "peerDependencies": { - "eslint": "^5.0.0", + "eslint": "^5.0.0 || ^6.0.0", "tslint": "^5.0.0" }, "devDependencies": { diff --git a/packages/eslint-plugin-tslint/tests/index.spec.ts b/packages/eslint-plugin-tslint/tests/index.spec.ts index 516f5a741b44..88a3a648b076 100644 --- a/packages/eslint-plugin-tslint/tests/index.spec.ts +++ b/packages/eslint-plugin-tslint/tests/index.spec.ts @@ -1,4 +1,5 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; +import * as parser from '@typescript-eslint/parser'; import { readFileSync } from 'fs'; import rule, { Options } from '../src/rules/config'; @@ -13,7 +14,7 @@ const ruleTester = new TSESLint.RuleTester({ */ project: './tests/tsconfig.json', }, - parser: '@typescript-eslint/parser', + parser: require.resolve('@typescript-eslint/parser'), }); /** @@ -146,6 +147,7 @@ describe('tslint/error', () => { function testOutput(code: string, config: TSESLint.Linter.Config): void { const linter = new TSESLint.Linter(); linter.defineRule('tslint/config', rule); + linter.defineParser('@typescript-eslint/parser', parser); expect(() => linter.verify(code, config)).toThrow( `You must provide a value for the "parserOptions.project" property for @typescript-eslint/parser`, @@ -176,6 +178,7 @@ describe('tslint/error', () => { const linter = new TSESLint.Linter(); jest.spyOn(console, 'warn').mockImplementation(); linter.defineRule('tslint/config', rule); + linter.defineParser('@typescript-eslint/parser', parser); expect(() => linter.verify('foo;', { parserOptions: { diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 19b61dc0d5f8..50a0337f4540 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -54,6 +54,6 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^1.9.0", - "eslint": "^5.0.0" + "eslint": "^5.0.0 || ^6.0.0" } } diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 12b425fdd549..02559789b5e8 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -72,7 +72,8 @@ function typeNeedsParentheses(node: TSESTree.Node): boolean { } } -type Options = ['array' | 'generic' | 'array-simple']; +export type OptionString = 'array' | 'generic' | 'array-simple'; +type Options = [OptionString]; type MessageIds = | 'errorStringGeneric' | 'errorStringGenericSimple' diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 70cf1c37919a..9ff5e31bbb5a 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -8,7 +8,6 @@ import { AST_TOKEN_TYPES, TSESLint, } from '@typescript-eslint/experimental-utils'; -import { createGlobalLinebreakMatcher } from 'eslint/lib/util/ast-utils'; import { isOpeningParenToken, isClosingParenToken, @@ -26,6 +25,10 @@ import { OffsetStorage } from './OffsetStorage'; import { TokenInfo } from './TokenInfo'; import { createRule, ExcludeKeys, RequireKeys } from '../../util'; +function createGlobalLinebreakMatcher() { + return /\r\n|[\r\n\u2028\u2029]/gu; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 34e99972bf7c..769d7bc1aae1 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -1,8 +1,47 @@ import { TSESLint, ESLintUtils } from '@typescript-eslint/experimental-utils'; import * as path from 'path'; -// re-export the RuleTester from here to make it easier to do the tests -const RuleTester = TSESLint.RuleTester; +const parser = '@typescript-eslint/parser'; + +type RuleTesterConfig = Omit & { + parser: typeof parser; +}; +class RuleTester extends TSESLint.RuleTester { + // as of eslint 6 you have to provide an absolute path to the parser + // but that's not as clean to type, this saves us trying to manually enforce + // that contributors require.resolve everything + constructor(options: RuleTesterConfig) { + super({ + ...options, + parser: require.resolve(options.parser), + }); + } + + // as of eslint 6 you have to provide an absolute path to the parser + // If you don't do that at the test level, the test will fail somewhat cryptically... + // This is a lot more explicit + run>( + name: string, + rule: TSESLint.RuleModule, + tests: TSESLint.RunTests, + ): void { + const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`; + tests.valid.forEach(test => { + if (typeof test !== 'string') { + if (test.parser === parser) { + throw new Error(errorMessage); + } + } + }); + tests.invalid.forEach(test => { + if (test.parser === parser) { + throw new Error(errorMessage); + } + }); + + super.run(name, rule, tests); + } +} function getFixturesRootDir() { return path.join(process.cwd(), 'tests/fixtures/'); diff --git a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts index 1a1fb94a462d..45ca71b4a79f 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-redeclare.test.ts @@ -1,5 +1,8 @@ import rule from 'eslint/lib/rules/no-redeclare'; -import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import { + AST_NODE_TYPES, + AST_TOKEN_TYPES, +} from '@typescript-eslint/experimental-utils'; import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ @@ -19,7 +22,6 @@ ruleTester.run('no-redeclare', rule, { ecmaVersion: 6, }, }, - 'var Object = 0;', { code: 'var Object = 0;', options: [{ builtinGlobals: false }] }, { code: 'var Object = 0;', @@ -31,7 +33,11 @@ ruleTester.run('no-redeclare', rule, { options: [{ builtinGlobals: true }], parserOptions: { ecmaFeatures: { globalReturn: true } }, }, - { code: 'var top = 0;', env: { browser: true } }, + { + code: 'var top = 0;', + env: { browser: true }, + options: [{ builtinGlobals: false }], + }, { code: 'var top = 0;', options: [{ builtinGlobals: true }] }, { code: 'var top = 0;', @@ -84,85 +90,115 @@ class D {} parserOptions: { ecmaVersion: 6 }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'switch(foo) { case a: var b = 3;\ncase b: var b = 4}', errors: [ { - message: "'b' is already defined.", + messageId: 'redeclared', + data: { + id: 'b', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a = 3; var a = 10;', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a = {}; var a = [];', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a; function a() {}', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'function a() {} function a() {}', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a = function() { }; var a = function() { }', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a = function() { }; var a = new Date();', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { code: 'var a = 3; var a = 10; var a = 15;', errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -170,9 +206,12 @@ class D {} parserOptions: { sourceType: 'module' }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -180,9 +219,12 @@ class D {} parserOptions: { sourceType: 'module' }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -190,9 +232,12 @@ class D {} options: [{ builtinGlobals: true }], errors: [ { - message: "'Object' is already defined.", + messageId: 'redeclaredAsBuiltin', + data: { + id: 'Object', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -200,9 +245,12 @@ class D {} options: [{ builtinGlobals: true }], errors: [ { - message: "'top' is already defined.", + messageId: 'redeclaredAsBuiltin', + data: { + id: 'top', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], env: { browser: true }, }, @@ -212,13 +260,19 @@ class D {} parserOptions: { ecmaVersion: 6 }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, { - message: "'Object' is already defined.", + messageId: 'redeclaredAsBuiltin', + data: { + id: 'Object', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -227,9 +281,12 @@ class D {} parserOptions: { ecmaVersion: 6, sourceType: 'module' }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -238,9 +295,12 @@ class D {} parserOptions: { ecmaVersion: 6, ecmaFeatures: { globalReturn: true } }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, { @@ -249,9 +309,12 @@ class D {} parserOptions: { ecmaVersion: 6 }, errors: [ { - message: "'a' is already defined.", + messageId: 'redeclared', + data: { + id: 'a', + }, type: AST_NODE_TYPES.Identifier, - } as any, + }, ], }, @@ -261,9 +324,12 @@ class D {} options: [{ builtinGlobals: true }], errors: [ { - message: "'b' is already defined.", - type: AST_NODE_TYPES.Identifier, - } as any, + messageId: 'redeclaredBySyntax', + data: { + id: 'b', + }, + type: AST_TOKEN_TYPES.Block, + }, ], }, ], diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index 70343f688fcf..5e90bf07301d 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1,5 +1,6 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; -import rule from '../../src/rules/array-type'; +import * as parser from '@typescript-eslint/parser'; +import rule, { OptionString } from '../../src/rules/array-type'; import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ @@ -886,17 +887,22 @@ let yyyy: Arr>>> = [[[["2"]]]];`, // eslint rule tester is not working with multi-pass // https://github.com/eslint/eslint/issues/11187 describe('array-type (nested)', () => { + const linter = new TSESLint.Linter(); + linter.defineRule('array-type', rule); + linter.defineParser('@typescript-eslint/parser', parser); + describe('should deeply fix correctly', () => { - function testOutput(option: string, code: string, output: string): void { + function testOutput( + option: OptionString, + code: string, + output: string, + ): void { it(code, () => { - const linter = new TSESLint.Linter(); - - linter.defineRule('array-type', Object.assign({}, rule) as any); const result = linter.verifyAndFix( code, { rules: { - 'array-type': [2, option], + 'array-type': ['error', option], }, parser: '@typescript-eslint/parser', }, @@ -905,6 +911,8 @@ describe('array-type (nested)', () => { }, ); + expect(result.messages).toHaveLength(0); + expect(result.fixed).toBeTruthy(); expect(result.output).toBe(output); }); } diff --git a/packages/eslint-plugin/tests/rules/ban-ts-ignore.test.ts b/packages/eslint-plugin/tests/rules/ban-ts-ignore.test.ts index 28009ce6d324..d9132df2b0d4 100644 --- a/packages/eslint-plugin/tests/rules/ban-ts-ignore.test.ts +++ b/packages/eslint-plugin/tests/rules/ban-ts-ignore.test.ts @@ -52,7 +52,6 @@ if (false) { console.log("hello"); } `, - parser: '@typescript-eslint/parser', errors: [ { messageId: 'tsIgnoreComment', diff --git a/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts b/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts index f120d5262432..5bffd663249c 100644 --- a/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts +++ b/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts @@ -33,7 +33,6 @@ let a /// let a `, - parser: '@typescript-eslint/parser', errors: [ { messageId: 'noTripleSlashReference', diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index 7a0324308b2c..a96364d23660 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -213,7 +213,6 @@ export namespace Third { } `, parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - parser: '@typescript-eslint/parser', }, // https://github.com/eslint/typescript-eslint-parser/issues/550 ` @@ -398,7 +397,7 @@ a(); function a() {} } `, - parser: 'espree', + parser: require.resolve('espree'), errors: [ { messageId: 'noUseBeforeDefine', diff --git a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts index 6559c9b71408..04abdc81a472 100644 --- a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts @@ -1032,7 +1032,6 @@ type Bar = Record }, }, ], - parser: '@typescript-eslint/parser', }, 'let resolver: (() => PromiseLike) | PromiseLike;', ], @@ -4432,7 +4431,6 @@ type Bar = Record }, }, ], - parser: '@typescript-eslint/parser', }, ], invalid: [ diff --git a/packages/eslint-plugin/typings/eslint-ast-util.d.ts b/packages/eslint-plugin/typings/eslint-ast-util.d.ts deleted file mode 100644 index 6a144813a494..000000000000 --- a/packages/eslint-plugin/typings/eslint-ast-util.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module 'eslint/lib/util/ast-utils' { - export function createGlobalLinebreakMatcher(): RegExp; -} diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 85c05b0dfe24..a8fe7c283f46 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -212,7 +212,7 @@ declare module 'eslint/lib/rules/no-redeclare' { import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; const rule: TSESLint.RuleModule< - never, + 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax', [ { builtinGlobals?: boolean; diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/experimental-utils/src/ts-eslint/RuleTester.ts index ed67ce505000..6cccf66ed4f3 100644 --- a/packages/experimental-utils/src/ts-eslint/RuleTester.ts +++ b/packages/experimental-utils/src/ts-eslint/RuleTester.ts @@ -46,12 +46,8 @@ interface RunTests< invalid: InvalidTestCase[]; } interface RuleTesterConfig { - parser?: - | '@typescript-eslint/parser' - | 'espree' - | 'babel-eslint' - | 'esprima' - | string; + // should be require.resolve(parserPackageName) + parser: string; parserOptions?: ParserOptions; } declare interface RuleTester { diff --git a/packages/parser/package.json b/packages/parser/package.json index e0bab93702cb..0d00cd9f9e24 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -38,7 +38,7 @@ "typecheck": "tsc --noEmit" }, "peerDependencies": { - "eslint": "^5.0.0" + "eslint": "^5.0.0 || ^6.0.0" }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 58a7926ca9ad..678f3301e80f 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -40,7 +40,7 @@ export function omitDeep( } for (const prop in node) { - if (node.hasOwnProperty(prop)) { + if (Object.prototype.hasOwnProperty.call(node, prop)) { if (shouldOmit(prop, node[prop])) { delete node[prop]; continue; diff --git a/yarn.lock b/yarn.lock index 445e9a7955df..3141d7b2a4fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1344,7 +1344,7 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -ajv@^6.5.5, ajv@^6.9.1: +ajv@^6.10.0, ajv@^6.5.5, ajv@^6.9.1: version "6.10.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== @@ -2678,13 +2678,13 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.12.1: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.0.tgz#9223f19223de73b4ed730e11bff44a376b65844d" + integrity sha512-SrrIfcd4tOgsspOKTSwamuTOAMZOUigHQhVMrzNjz4/B9Za6SHQDIocMIyIDfwDgx6MhS15nS6HC8kumCV2qBQ== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" @@ -2692,18 +2692,19 @@ eslint@^5.12.1: eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + espree "^6.0.0" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^3.1.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.2.2" - js-yaml "^3.13.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" lodash "^4.17.11" @@ -2711,7 +2712,6 @@ eslint@^5.12.1: mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" semver "^5.5.1" @@ -2720,10 +2720,10 @@ eslint@^5.12.1: table "^5.2.3" text-table "^0.2.0" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" + integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== dependencies: acorn "^6.0.7" acorn-jsx "^5.0.0" From 4933adeec7a86ebe0da8863d989cc0ed7f1a617d Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Mon, 22 Jul 2019 03:48:40 +0900 Subject: [PATCH 02/38] fix(eslint-plugin)!: remove "isTypescriptFile". (#594) BREAKING CHANGE --- .../rules/explicit-function-return-type.ts | 10 +- .../rules/explicit-member-accessibility.ts | 109 ++++++++---------- packages/eslint-plugin/src/util/misc.ts | 7 -- .../explicit-function-return-type.test.ts | 8 -- .../explicit-member-accessibility.test.ts | 19 +-- packages/eslint-plugin/tests/util.test.ts | 36 ------ 6 files changed, 57 insertions(+), 132 deletions(-) diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index d5176a43af5c..6d0625cd5cd5 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -226,12 +226,10 @@ export default util.createRule({ return; } - if (util.isTypeScriptFile(context.getFilename())) { - context.report({ - node, - messageId: 'missingReturnType', - }); - } + context.report({ + node, + messageId: 'missingReturnType', + }); } /** diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 4fea64e99ebc..8d2b590ffad8 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -119,30 +119,27 @@ export default util.createRule({ return; } - if (util.isTypeScriptFile(context.getFilename())) { - // const methodName = util.getNameFromPropertyName(methodDefinition.key); - const methodName = util.getNameFromClassMember( + const methodName = util.getNameFromClassMember( + methodDefinition, + sourceCode, + ); + if ( + check === 'no-public' && + methodDefinition.accessibility === 'public' + ) { + reportIssue( + 'unwantedPublicAccessibility', + nodeType, methodDefinition, - sourceCode, + methodName, + ); + } else if (check === 'explicit' && !methodDefinition.accessibility) { + reportIssue( + 'missingAccessibility', + nodeType, + methodDefinition, + methodName, ); - if ( - check === 'no-public' && - methodDefinition.accessibility === 'public' - ) { - reportIssue( - 'unwantedPublicAccessibility', - nodeType, - methodDefinition, - methodName, - ); - } else if (check === 'explicit' && !methodDefinition.accessibility) { - reportIssue( - 'missingAccessibility', - nodeType, - methodDefinition, - methodName, - ); - } } } @@ -155,26 +152,24 @@ export default util.createRule({ ): void { const nodeType = 'class property'; - if (util.isTypeScriptFile(context.getFilename())) { - const propertyName = util.getNameFromPropertyName(classProperty.key); - if ( - propCheck === 'no-public' && - classProperty.accessibility === 'public' - ) { - reportIssue( - 'unwantedPublicAccessibility', - nodeType, - classProperty, - propertyName, - ); - } else if (propCheck === 'explicit' && !classProperty.accessibility) { - reportIssue( - 'missingAccessibility', - nodeType, - classProperty, - propertyName, - ); - } + const propertyName = util.getNameFromPropertyName(classProperty.key); + if ( + propCheck === 'no-public' && + classProperty.accessibility === 'public' + ) { + reportIssue( + 'unwantedPublicAccessibility', + nodeType, + classProperty, + propertyName, + ); + } else if (propCheck === 'explicit' && !classProperty.accessibility) { + reportIssue( + 'missingAccessibility', + nodeType, + classProperty, + propertyName, + ); } } @@ -186,24 +181,22 @@ export default util.createRule({ node: TSESTree.TSParameterProperty, ) { const nodeType = 'parameter property'; - if (util.isTypeScriptFile(context.getFilename())) { - // HAS to be an identifier or assignment or TSC will throw - if ( - node.parameter.type !== AST_NODE_TYPES.Identifier && - node.parameter.type !== AST_NODE_TYPES.AssignmentPattern - ) { - return; - } + // HAS to be an identifier or assignment or TSC will throw + if ( + node.parameter.type !== AST_NODE_TYPES.Identifier && + node.parameter.type !== AST_NODE_TYPES.AssignmentPattern + ) { + return; + } - const nodeName = - node.parameter.type === AST_NODE_TYPES.Identifier - ? node.parameter.name - : // has to be an Identifier or TSC will throw an error - (node.parameter.left as TSESTree.Identifier).name; + const nodeName = + node.parameter.type === AST_NODE_TYPES.Identifier + ? node.parameter.name + : // has to be an Identifier or TSC will throw an error + (node.parameter.left as TSESTree.Identifier).name; - if (paramPropCheck === 'no-public' && node.accessibility === 'public') { - reportIssue('unwantedPublicAccessibility', nodeType, node, nodeName); - } + if (paramPropCheck === 'no-public' && node.accessibility === 'public') { + reportIssue('unwantedPublicAccessibility', nodeType, node, nodeName); } } diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 2a9ba2a1c934..3c88d766fe99 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -8,13 +8,6 @@ import { TSESTree, } from '@typescript-eslint/experimental-utils'; -/** - * Check if the context file name is *.ts or *.tsx - */ -export function isTypeScriptFile(fileName: string) { - return /\.tsx?$/i.test(fileName || ''); -} - /** * Check if the context file name is *.d.ts or *.d.tsx */ diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index eb67f620be1e..ddcf99e127a7 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -42,14 +42,6 @@ class Test { return; } arrow = (): string => 'arrow'; -} - `, - }, - { - filename: 'test.js', - code: ` -function test() { - return; } `, }, diff --git a/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts b/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts index 51a94a19de20..abf6ca2b25ec 100644 --- a/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts @@ -30,12 +30,10 @@ class Test { `, }, { - filename: 'test.js', + filename: 'test.ts', code: ` class Test { - getX () { - return 1; - } + public constructor({x, y}: {x: number; y: number;}) {} } `, }, @@ -149,19 +147,6 @@ class Test { }, ], }, - { - filename: 'test.js', - code: ` -class Test { - constructor(public x: number){} -} - `, - options: [ - { - accessibility: 'no-public', - }, - ], - }, ], invalid: [ { diff --git a/packages/eslint-plugin/tests/util.test.ts b/packages/eslint-plugin/tests/util.test.ts index 59c820d28b9c..449cfc9b1adb 100644 --- a/packages/eslint-plugin/tests/util.test.ts +++ b/packages/eslint-plugin/tests/util.test.ts @@ -2,42 +2,6 @@ import assert from 'assert'; import * as util from '../src/util'; -describe('isTypescript', () => { - it('returns false for non-typescript files', () => { - const invalid = [ - 'test.js', - 'test.jsx', - 'README.md', - 'test.d.js', - 'test.ts.js', - 'test.ts.map', - 'test.ts-js', - 'ts', - ]; - - invalid.forEach(f => { - assert.strictEqual(util.isTypeScriptFile(f), false); - }); - }); - - it('returns true for typescript files', () => { - const valid = [ - 'test.ts', - 'test.tsx', - 'test.TS', - 'test.TSX', - 'test.d.ts', - 'test.d.tsx', - 'test.D.TS', - 'test.D.TSX', - ]; - - valid.forEach(f => { - assert.strictEqual(util.isTypeScriptFile(f), true); - }); - }); -}); - describe('isDefinitionFile', () => { it('returns false for non-definition files', () => { const invalid = [ From 590ca50051b821aba6439125ee54c0c54c807ca9 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 21 Jul 2019 15:51:36 -0700 Subject: [PATCH 03/38] feat(eslint-plugin): [promise-function-async] make allowAny default true (#733) BREAKING CHANGE: changing default rule config --- .../eslint-plugin/docs/rules/promise-function-async.md | 3 +-- .../eslint-plugin/src/rules/promise-function-async.ts | 2 +- .../tests/rules/promise-function-async.test.ts | 10 ++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index e28de05742ff..5ccddf45ed47 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -36,7 +36,7 @@ async function functionDeturnsPromise() { Options may be provided as an object with: -- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`false` by default). +- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`true` by default). - `allowedPromiseNames` to indicate any extra names of classes or interfaces to be considered Promises when returned. In addition, each of the following properties may be provided, and default to `true`: @@ -51,7 +51,6 @@ In addition, each of the following properties may be provided, and default to `t "@typescript-eslint/promise-function-async": [ "error", { - "allowAny": true, "allowedPromiseNames": ["Thenable"], "checkArrowFunctions": true, "checkFunctionDeclarations": true, diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 4d5c96d76b45..529f41ee72bb 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -58,7 +58,7 @@ export default util.createRule({ }, defaultOptions: [ { - allowAny: false, + allowAny: true, allowedPromiseNames: [], checkArrowFunctions: true, checkFunctionDeclarations: true, diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 1b14ae5d131d..829bb9a091c6 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -102,6 +102,11 @@ function returnsAny(): any { return 0; } `, + options: [ + { + allowAny: false, + }, + ], errors: [ { messageId, @@ -114,6 +119,11 @@ function returnsUnknown(): unknown { return 0; } `, + options: [ + { + allowAny: false, + }, + ], errors: [ { messageId, From ef99f71bc70adccf66858d2ae147bc4a29cc88b4 Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 21 Jul 2019 19:25:34 -0400 Subject: [PATCH 04/38] chore: disable automated canary during 2.x prerelease (#737) --- azure-pipelines.yml | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 960eb86b11d5..e3bdabad3471 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,28 +77,28 @@ jobs: yarn test displayName: 'Run unit tests' - - job: publish_canary_version - displayName: Publish the latest code as a canary version - dependsOn: - - primary_code_validation_and_tests - - unit_tests_on_other_node_versions - condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest')) - pool: - vmImage: 'Ubuntu-16.04' - steps: - - task: NodeTool@0 - inputs: - versionSpec: 11 - displayName: 'Install Node.js 11' - - - script: | - # This also runs a build as part of the postinstall - # bootstrap - yarn --ignore-engines --frozen-lockfile - - - script: | - npm config set //registry.npmjs.org/:_authToken=$(NPM_TOKEN) - - - script: | - npx lerna publish --canary --exact --force-publish --yes - displayName: 'Publish all packages to npm' + # - job: publish_canary_version + # displayName: Publish the latest code as a canary version + # dependsOn: + # - primary_code_validation_and_tests + # - unit_tests_on_other_node_versions + # condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.Reason'], 'PullRequest')) + # pool: + # vmImage: 'Ubuntu-16.04' + # steps: + # - task: NodeTool@0 + # inputs: + # versionSpec: 11 + # displayName: 'Install Node.js 11' + + # - script: | + # # This also runs a build as part of the postinstall + # # bootstrap + # yarn --ignore-engines --frozen-lockfile + + # - script: | + # npm config set //registry.npmjs.org/:_authToken=$(NPM_TOKEN) + + # - script: | + # npx lerna publish --canary --exact --force-publish --yes + # displayName: 'Publish all packages to npm' From 1389393d5d2823a8978bf6a0c245c3858b3599dc Mon Sep 17 00:00:00 2001 From: Alexander T Date: Mon, 22 Jul 2019 06:16:32 +0300 Subject: [PATCH 05/38] feat(eslint-plugin)!: [array-type] rework options (#654) BREAKING CHANGE: changes config structure ```ts type ArrayOption = 'array' | 'generic' | 'array-simple'; type Options = [ { // default case for all arrays default: ArrayOption, // optional override for readonly arrays readonly?: ArrayOption, }, ]; ``` Fixes #635 --- .../eslint-plugin/docs/rules/array-type.md | 23 +- .../eslint-plugin/src/rules/array-type.ts | 87 ++++-- .../tests/rules/array-type.test.ts | 266 ++++++++++++------ 3 files changed, 262 insertions(+), 114 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 8906f0c9a4c2..275b4fbd6172 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -8,13 +8,26 @@ This rule aims to standardise usage of array types within your codebase. ## Options -This rule accepts one option - a single string +```ts +type ArrayOption = 'array' | 'generic' | 'array-simple'; +type Options = { + default: ArrayOption; + readonly?: ArrayOption; +}; + +const defaultOptions: Options = { + default: 'array', +}; +``` + +The rule accepts an options object with the following properties: + +- `default` - sets the array type expected for mutable cases. +- `readonly` - sets the array type expected for readonly arrays. If this is omitted, then the value for `default` will be used. -- `"array"` enforces use of `T[]` for all types `T`. -- `"generic"` enforces use of `Array` for all types `T`. -- `"array-simple"` enforces use of `T[]` if `T` is a simple type. +Each property can be set to one of three strings: `'array' | 'generic' | 'array-simple'`. -Without providing an option, by default the rule will enforce `"array"`. +The default config will enforce that all mutable and readonly arrays use the `'array'` syntax. ### `"array"` diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 02559789b5e8..ee0b35fdde85 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -73,13 +73,20 @@ function typeNeedsParentheses(node: TSESTree.Node): boolean { } export type OptionString = 'array' | 'generic' | 'array-simple'; -type Options = [OptionString]; +type Options = [ + { + default: OptionString; + readonly?: OptionString; + } +]; type MessageIds = | 'errorStringGeneric' | 'errorStringGenericSimple' | 'errorStringArray' | 'errorStringArraySimple'; +const arrayOption = { enum: ['array', 'generic', 'array-simple'] }; + export default util.createRule({ name: 'array-type', meta: { @@ -102,14 +109,32 @@ export default util.createRule({ }, schema: [ { - enum: ['array', 'generic', 'array-simple'], + type: 'object', + properties: { + default: arrayOption, + readonly: arrayOption, + }, }, ], }, - defaultOptions: ['array'], - create(context, [option]) { + defaultOptions: [ + { + default: 'array', + }, + ], + create(context, [options]) { const sourceCode = context.getSourceCode(); + const defaultOption = options.default; + const readonlyOption = options.readonly || defaultOption; + + const isArraySimpleOption = + defaultOption === 'array-simple' && readonlyOption === 'array-simple'; + const isArrayOption = + defaultOption === 'array' && readonlyOption === 'array'; + const isGenericOption = + defaultOption === 'generic' && readonlyOption === 'generic'; + /** * Check if whitespace is needed before this node * @param node the node to be evaluated. @@ -143,22 +168,36 @@ export default util.createRule({ } return { - TSArrayType(node) { + TSArrayType(node: TSESTree.TSArrayType) { if ( - option === 'array' || - (option === 'array-simple' && isSimpleType(node.elementType)) + isArrayOption || + (isArraySimpleOption && isSimpleType(node.elementType)) ) { return; } - const messageId = - option === 'generic' - ? 'errorStringGeneric' - : 'errorStringGenericSimple'; const isReadonly = node.parent && node.parent.type === AST_NODE_TYPES.TSTypeOperator && node.parent.operator === 'readonly'; + + const isReadonlyGeneric = + readonlyOption === 'generic' && defaultOption !== 'generic'; + + const isReadonlyArray = + readonlyOption !== 'generic' && defaultOption === 'generic'; + + if ( + (isReadonlyGeneric && !isReadonly) || + (isReadonlyArray && isReadonly) + ) { + return; + } + + const messageId = + defaultOption === 'generic' + ? 'errorStringGeneric' + : 'errorStringGenericSimple'; const typeOpNode = isReadonly ? node.parent! : null; context.report({ @@ -201,23 +240,32 @@ export default util.createRule({ }, }); }, + TSTypeReference(node: TSESTree.TSTypeReference) { if ( - option === 'generic' || + isGenericOption || node.typeName.type !== AST_NODE_TYPES.Identifier ) { return; } - if (!['Array', 'ReadonlyArray'].includes(node.typeName.name)) { + + const isReadonlyArrayType = node.typeName.name === 'ReadonlyArray'; + const isArrayType = node.typeName.name === 'Array'; + + if ( + !(isArrayType || isReadonlyArrayType) || + (readonlyOption === 'generic' && isReadonlyArrayType) || + (defaultOption === 'generic' && !isReadonlyArrayType) + ) { return; } - const messageId = - option === 'array' ? 'errorStringArray' : 'errorStringArraySimple'; - const isReadonly = node.typeName.name === 'ReadonlyArray'; - const readonlyPrefix = isReadonly ? 'readonly ' : ''; - + const readonlyPrefix = isReadonlyArrayType ? 'readonly ' : ''; const typeParams = node.typeParameters && node.typeParameters.params; + const messageId = + defaultOption === 'array' + ? 'errorStringArray' + : 'errorStringArraySimple'; if (!typeParams || typeParams.length === 0) { // Create an 'any' array @@ -231,12 +279,13 @@ export default util.createRule({ return fixer.replaceText(node, `${readonlyPrefix}any[]`); }, }); + return; } if ( typeParams.length !== 1 || - (option === 'array-simple' && !isSimpleType(typeParams[0])) + (defaultOption === 'array-simple' && !isSimpleType(typeParams[0])) ) { return; } diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index 5e90bf07301d..32de7e32c892 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -11,175 +11,201 @@ ruleTester.run('array-type', rule, { valid: [ { code: 'let a: readonly any[] = []', - options: ['array'], + options: [{ default: 'array' }], }, { code: 'let a = new Array()', - options: ['array'], + options: [{ default: 'array' }], }, { code: 'let a: string[] = []', - options: ['array'], + options: [{ default: 'array' }], }, { code: 'let a: (string | number)[] = []', - options: ['array'], + options: [{ default: 'array' }], }, { code: 'let a: ({ foo: Bar[] })[] = []', - options: ['array'], + options: [{ default: 'array' }], }, { code: 'let a: Array = []', - options: ['generic'], + options: [{ default: 'generic' }], }, { - code: 'let a: Array = []', - options: ['generic'], + code: 'let a: Array = []', + options: [{ default: 'generic' }], }, { code: 'let a: Array<{ foo: Array }> = []', - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `let fooVar: Array;`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `function foo (a: Array): Array {}`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `let yy: number[][] = [[4, 5], [6]];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `function fooFunction(foo: Array>) { return foo.map(e => e.foo); }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `function bazFunction(baz: Arr>) { return baz.map(e => e.baz); }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `let fooVar: Array<(c: number) => number>;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { - code: `type fooUnion = Array;`, - options: ['array-simple'], + code: `type fooUnion = Array;`, + options: [{ default: 'array-simple' }], }, { code: `type fooIntersection = Array;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `namespace fooName { type BarType = { bar: string }; type BazType = Arr; }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `interface FooInterface { '.bar': {baz: string[];}; }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], }, { code: `let yy: number[][] = [[4, 5], [6]];`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `let ya = [[1, "2"]] as[number, string][];`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `function barFunction(bar: ArrayClass[]) { return bar.map(e => e.bar); }`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `function bazFunction(baz: Arr>) { return baz.map(e => e.baz); }`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `let barVar: ((c: number) => number)[];`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `type barUnion = (string|number|boolean)[];`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `type barIntersection = (string & number)[];`, - options: ['array'], + options: [{ default: 'array' }], }, { code: `interface FooInterface { '.bar': {baz: string[];}; }`, - options: ['array'], + options: [{ default: 'array' }], }, { // https://github.com/typescript-eslint/typescript-eslint/issues/172 code: 'type Unwrap = T extends (infer E)[] ? E : T', - options: ['array'], + options: [{ default: 'array' }], }, { code: `let z: Array = [3, "4"];`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `let xx: Array> = [[1, 2], [3]];`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `type Arr = Array;`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `function fooFunction(foo: Array>) { return foo.map(e => e.foo); }`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `function bazFunction(baz: Arr>) { return baz.map(e => e.baz); }`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `let fooVar: Array<(c: number) => number>;`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `type fooUnion = Array;`, - options: ['generic'], + options: [{ default: 'generic' }], }, { code: `type fooIntersection = Array;`, - options: ['generic'], + options: [{ default: 'generic' }], }, { // https://github.com/typescript-eslint/typescript-eslint/issues/172 code: 'type Unwrap = T extends Array ? E : T', - options: ['generic'], + options: [{ default: 'generic' }], + }, + + // readonly + { + code: 'let a: string[] = []', + options: [{ default: 'array', readonly: 'generic' }], + }, + { + code: 'let a: ReadonlyArray = []', + options: [{ default: 'array', readonly: 'generic' }], + }, + { + code: 'let a: ReadonlyArray = [[]]', + options: [{ default: 'array', readonly: 'generic' }], + }, + { + code: `let a: Array = []`, + options: [{ default: 'generic', readonly: 'array' }], + }, + { + code: `let a: readonly number[] = []`, + options: [{ default: 'generic', readonly: 'array' }], + }, + { + code: `let a: readonly Array[] = [[]]`, + options: [{ default: 'generic', readonly: 'array' }], }, ], invalid: [ { code: 'let a: Array = []', output: 'let a: string[] = []', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -192,7 +218,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: Array = []', output: 'let a: (string | number)[] = []', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -205,7 +231,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: ({ foo: Array })[] = []', output: 'let a: ({ foo: Bar[] })[] = []', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -218,7 +244,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: string[] = []', output: 'let a: Array = []', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -231,7 +257,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: (string | number)[] = []', output: 'let a: Array = []', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -244,7 +270,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: Array<{ foo: Bar[] }> = []', output: 'let a: Array<{ foo: Array }> = []', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -257,7 +283,7 @@ ruleTester.run('array-type', rule, { { code: 'let a: Array<{ foo: Foo | Bar[] }> = []', output: 'let a: Array<{ foo: Foo | Array }> = []', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -270,6 +296,7 @@ ruleTester.run('array-type', rule, { { code: 'function foo (a: Array): Array {}', output: 'function foo (a: Bar[]): Bar[] {}', + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -288,7 +315,7 @@ ruleTester.run('array-type', rule, { { code: `let x: Array = [undefined] as undefined[];`, output: `let x: undefined[] = [undefined] as undefined[];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -301,7 +328,7 @@ ruleTester.run('array-type', rule, { { code: `let xx: Array = [];`, output: `let xx: object[] = [];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -314,7 +341,7 @@ ruleTester.run('array-type', rule, { { code: `let y: string[] = >["2"];`, output: `let y: string[] = ["2"];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -327,7 +354,7 @@ ruleTester.run('array-type', rule, { { code: `let z: Array = [3, "4"];`, output: `let z: any[] = [3, "4"];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -340,7 +367,7 @@ ruleTester.run('array-type', rule, { { code: `let ya = [[1, "2"]] as[number, string][];`, output: `let ya = [[1, "2"]] as Array<[number, string]>;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -353,7 +380,7 @@ ruleTester.run('array-type', rule, { { code: `type Arr = Array;`, output: `type Arr = T[];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -368,7 +395,7 @@ ruleTester.run('array-type', rule, { let yyyy: Arr>[]> = [[[["2"]]]];`, output: `// Ignore user defined aliases let yyyy: Arr>>> = [[[["2"]]]];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -391,7 +418,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, baz: Arr; xyz: this[]; }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -408,7 +435,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, output: `function barFunction(bar: Array>) { return bar.map(e => e.bar); }`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -421,7 +448,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let barVar: ((c: number) => number)[];`, output: `let barVar: Array<(c: number) => number>;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -434,7 +461,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `type barUnion = (string|number|boolean)[];`, output: `type barUnion = Array;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -447,7 +474,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `type barIntersection = (string & number)[];`, output: `type barIntersection = Array;`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -460,7 +487,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let v: Array = [{ bar: "bar" }];`, output: `let v: fooName.BarType[] = [{ bar: "bar" }];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -473,7 +500,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let w: fooName.BazType[] = [["baz"]];`, output: `let w: Array> = [["baz"]];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringGenericSimple', @@ -486,7 +513,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let x: Array = [undefined] as undefined[];`, output: `let x: undefined[] = [undefined] as undefined[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -499,7 +526,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let y: string[] = >["2"];`, output: `let y: string[] = ["2"];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -512,7 +539,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let z: Array = [3, "4"];`, output: `let z: any[] = [3, "4"];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -525,7 +552,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `type Arr = Array;`, output: `type Arr = T[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -540,7 +567,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, let yyyy: Arr>[]> = [[[["2"]]]];`, output: `// Ignore user defined aliases let yyyy: Arr[][]> = [[[["2"]]]];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -561,7 +588,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, bar: T[]; baz: Arr; }`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -578,7 +605,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, output: `function fooFunction(foo: ArrayClass[]) { return foo.map(e => e.foo); }`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -591,7 +618,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `let fooVar: Array<(c: number) => number>;`, output: `let fooVar: ((c: number) => number)[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -604,7 +631,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `type fooUnion = Array;`, output: `type fooUnion = (string|number|boolean)[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -617,7 +644,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `type fooIntersection = Array;`, output: `type fooIntersection = (string & number)[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -629,7 +656,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, }, { code: `let fooVar: Array[];`, - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -641,7 +668,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, }, { code: `let fooVar: Array[];`, - options: ['array-simple'], + options: [{ default: 'array-simple' }], errors: [ { messageId: 'errorStringArraySimple', @@ -654,7 +681,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `let x: Array = [1] as number[];`, output: `let x: Array = [1] as Array;`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -667,7 +694,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `let y: string[] = >["2"];`, output: `let y: Array = >["2"];`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -680,7 +707,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, { code: `let ya = [[1, "2"]] as[number, string][];`, output: `let ya = [[1, "2"]] as Array<[number, string]>;`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -695,7 +722,7 @@ let yyyy: Arr[][]> = [[[["2"]]]];`, let yyyy: Arr>[]> = [[[["2"]]]];`, output: `// Ignore user defined aliases let yyyy: Arr>>> = [[[["2"]]]];`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -716,7 +743,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, bar: Array; baz: Arr; }`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -733,7 +760,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, output: `function barFunction(bar: Array>) { return bar.map(e => e.bar); }`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -746,7 +773,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `let barVar: ((c: number) => number)[];`, output: `let barVar: Array<(c: number) => number>;`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -759,7 +786,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `type barUnion = (string|number|boolean)[];`, output: `type barUnion = Array;`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -772,7 +799,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: `type barIntersection = (string & number)[];`, output: `type barIntersection = Array;`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -789,7 +816,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, output: `interface FooInterface { '.bar': {baz: Array;}; }`, - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -803,7 +830,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, // https://github.com/typescript-eslint/typescript-eslint/issues/172 code: 'type Unwrap = T extends Array ? E : T', output: 'type Unwrap = T extends (infer E)[] ? E : T', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -817,7 +844,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, // https://github.com/typescript-eslint/typescript-eslint/issues/172 code: 'type Unwrap = T extends (infer E)[] ? E : T', output: 'type Unwrap = T extends Array ? E : T', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -832,7 +859,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: 'const x: readonly number[] = [];', output: 'const x: ReadonlyArray = [];', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -845,7 +872,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: 'const x: readonly (number | string | boolean)[] = [];', output: 'const x: ReadonlyArray = [];', - options: ['generic'], + options: [{ default: 'generic' }], errors: [ { messageId: 'errorStringGeneric', @@ -858,7 +885,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: 'const x: ReadonlyArray = [];', output: 'const x: readonly number[] = [];', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -871,7 +898,7 @@ let yyyy: Arr>>> = [[[["2"]]]];`, { code: 'const x: ReadonlyArray = [];', output: 'const x: readonly (number | string | boolean)[] = [];', - options: ['array'], + options: [{ default: 'array' }], errors: [ { messageId: 'errorStringArray', @@ -881,6 +908,32 @@ let yyyy: Arr>>> = [[[["2"]]]];`, }, ], }, + { + code: 'const x: readonly number[] = []', + output: 'const x: ReadonlyArray = []', + options: [{ default: 'array', readonly: 'generic' }], + errors: [ + { + messageId: 'errorStringGenericSimple', + data: { type: 'number' }, + line: 1, + column: 10, + }, + ], + }, + { + code: 'const x: readonly number[][] = []', + output: 'const x: readonly Array[] = []', + options: [{ default: 'generic', readonly: 'array' }], + errors: [ + { + messageId: 'errorStringGeneric', + data: { type: 'number' }, + line: 1, + column: 19, + }, + ], + }, ], }); @@ -893,16 +946,20 @@ describe('array-type (nested)', () => { describe('should deeply fix correctly', () => { function testOutput( - option: OptionString, + defaultOption: OptionString, code: string, output: string, + readonlyOption?: OptionString, ): void { it(code, () => { const result = linter.verifyAndFix( code, { rules: { - 'array-type': ['error', option], + 'array-type': [ + 2, + { default: defaultOption, readonly: readonlyOption }, + ], }, parser: '@typescript-eslint/parser', }, @@ -912,7 +969,6 @@ describe('array-type (nested)', () => { ); expect(result.messages).toHaveLength(0); - expect(result.fixed).toBeTruthy(); expect(result.output).toBe(output); }); } @@ -985,5 +1041,35 @@ class Foo extends Bar implements Baz { `let x: ReadonlyArray`, `let x: readonly (readonly number[])[]`, ); + testOutput( + 'array', + `let x: ReadonlyArray`, + `let x: ReadonlyArray`, + 'generic', + ); + testOutput( + 'array', + `let a: string[] = []`, + `let a: string[] = []`, + 'generic', + ); + testOutput( + 'array', + `let a: readonly number[][] = []`, + `let a: ReadonlyArray = []`, + 'generic', + ); + testOutput( + 'generic', + `let a: string[] = []`, + `let a: Array = []`, + 'array', + ); + testOutput( + 'generic', + `let a: readonly number[][] = []`, + `let a: readonly Array[] = []`, + 'array', + ); }); }); From d11fbbefd95833daff6dc60cd465a514eeb679c2 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 23 Jul 2019 18:37:57 +0200 Subject: [PATCH 06/38] fix(utils): add ES2019 as valid `ecmaVersion` (#746) --- packages/experimental-utils/src/ts-eslint/ParserOptions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts b/packages/experimental-utils/src/ts-eslint/ParserOptions.ts index 915e6726172d..eea1a9577684 100644 --- a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts +++ b/packages/experimental-utils/src/ts-eslint/ParserOptions.ts @@ -4,7 +4,7 @@ export interface ParserOptions { range?: boolean; tokens?: boolean; sourceType?: 'script' | 'module'; - ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 2015 | 2016 | 2017 | 2018; + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 2015 | 2016 | 2017 | 2018 | 2019; ecmaFeatures?: { globalReturn?: boolean; jsx?: boolean; From 35dec52fce1c49c93c3db872f0ab639b46587ba2 Mon Sep 17 00:00:00 2001 From: Michael Meisel Date: Wed, 24 Jul 2019 07:48:07 -0700 Subject: [PATCH 07/38] fix(typescript-estree): fix `is` token typed as `Keyword (#750) --- .../lib/__snapshots__/typescript.ts.snap | 245 ++++++--- .../basics/keyword-variables.src.ts | 2 + packages/typescript-estree/src/node-utils.ts | 1 + .../lib/__snapshots__/typescript.ts.snap | 519 +++++++++++++----- 4 files changed, 567 insertions(+), 200 deletions(-) diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 2e00218b783a..7b48c204e9ca 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -18536,21 +18536,21 @@ Object { exports[`typescript fixtures/basics/keyword-variables.src 1`] = ` Object { - "$id": 11, + "$id": 13, "block": Object { "range": Array [ 0, - 154, + 174, ], "type": "Program", }, "childScopes": Array [ Object { - "$id": 10, + "$id": 12, "block": Object { "range": Array [ 0, - 154, + 174, ], "type": "Program", }, @@ -18559,9 +18559,9 @@ Object { "isStrict": true, "references": Array [ Object { - "$id": 5, + "$id": 6, "from": Object { - "$ref": 10, + "$ref": 12, }, "identifier": Object { "name": "get", @@ -18584,9 +18584,9 @@ Object { }, }, Object { - "$id": 6, + "$id": 7, "from": Object { - "$ref": 10, + "$ref": 12, }, "identifier": Object { "name": "set", @@ -18609,9 +18609,9 @@ Object { }, }, Object { - "$id": 7, + "$id": 8, "from": Object { - "$ref": 10, + "$ref": 12, }, "identifier": Object { "name": "module", @@ -18634,9 +18634,9 @@ Object { }, }, Object { - "$id": 8, + "$id": 9, "from": Object { - "$ref": 10, + "$ref": 12, }, "identifier": Object { "name": "type", @@ -18659,9 +18659,9 @@ Object { }, }, Object { - "$id": 9, + "$id": 10, "from": Object { - "$ref": 10, + "$ref": 12, }, "identifier": Object { "name": "async", @@ -18683,11 +18683,36 @@ Object { "type": "Literal", }, }, + Object { + "$id": 11, + "from": Object { + "$ref": 12, + }, + "identifier": Object { + "name": "is", + "range": Array [ + 87, + 89, + ], + "type": "Identifier", + }, + "kind": "w", + "resolved": Object { + "$ref": 5, + }, + "writeExpr": Object { + "range": Array [ + 92, + 93, + ], + "type": "Literal", + }, + }, ], "throughReferences": Array [], "type": "module", "upperScope": Object { - "$ref": 11, + "$ref": 13, }, "variableMap": Object { "async": Object { @@ -18696,6 +18721,9 @@ Object { "get": Object { "$ref": 0, }, + "is": Object { + "$ref": 5, + }, "module": Object { "$ref": 2, }, @@ -18707,7 +18735,7 @@ Object { }, }, "variableScope": Object { - "$ref": 10, + "$ref": 12, }, "variables": Array [ Object { @@ -18742,22 +18770,22 @@ Object { "name": Object { "name": "get", "range": Array [ - 93, - 96, + 107, + 110, ], "type": "Identifier", }, "node": Object { "range": Array [ - 93, - 96, + 107, + 110, ], "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 82, - 153, + 96, + 173, ], "type": "ImportDeclaration", }, @@ -18777,8 +18805,8 @@ Object { Object { "name": "get", "range": Array [ - 93, - 96, + 107, + 110, ], "type": "Identifier", }, @@ -18786,11 +18814,11 @@ Object { "name": "get", "references": Array [ Object { - "$ref": 5, + "$ref": 6, }, ], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { @@ -18825,22 +18853,22 @@ Object { "name": Object { "name": "set", "range": Array [ - 100, - 103, + 114, + 117, ], "type": "Identifier", }, "node": Object { "range": Array [ - 100, - 103, + 114, + 117, ], "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 82, - 153, + 96, + 173, ], "type": "ImportDeclaration", }, @@ -18860,8 +18888,8 @@ Object { Object { "name": "set", "range": Array [ - 100, - 103, + 114, + 117, ], "type": "Identifier", }, @@ -18869,11 +18897,11 @@ Object { "name": "set", "references": Array [ Object { - "$ref": 6, + "$ref": 7, }, ], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { @@ -18908,22 +18936,22 @@ Object { "name": Object { "name": "module", "range": Array [ - 107, - 113, + 121, + 127, ], "type": "Identifier", }, "node": Object { "range": Array [ - 107, - 113, + 121, + 127, ], "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 82, - 153, + 96, + 173, ], "type": "ImportDeclaration", }, @@ -18943,8 +18971,8 @@ Object { Object { "name": "module", "range": Array [ - 107, - 113, + 121, + 127, ], "type": "Identifier", }, @@ -18952,11 +18980,11 @@ Object { "name": "module", "references": Array [ Object { - "$ref": 7, + "$ref": 8, }, ], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { @@ -18991,22 +19019,22 @@ Object { "name": Object { "name": "type", "range": Array [ - 117, - 121, + 131, + 135, ], "type": "Identifier", }, "node": Object { "range": Array [ - 117, - 121, + 131, + 135, ], "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 82, - 153, + 96, + 173, ], "type": "ImportDeclaration", }, @@ -19026,8 +19054,8 @@ Object { Object { "name": "type", "range": Array [ - 117, - 121, + 131, + 135, ], "type": "Identifier", }, @@ -19035,11 +19063,11 @@ Object { "name": "type", "references": Array [ Object { - "$ref": 8, + "$ref": 9, }, ], "scope": Object { - "$ref": 10, + "$ref": 12, }, }, Object { @@ -19074,22 +19102,22 @@ Object { "name": Object { "name": "async", "range": Array [ - 125, - 130, + 139, + 144, ], "type": "Identifier", }, "node": Object { "range": Array [ - 125, - 130, + 139, + 144, ], "type": "ImportSpecifier", }, "parent": Object { "range": Array [ - 82, - 153, + 96, + 173, ], "type": "ImportDeclaration", }, @@ -19109,8 +19137,8 @@ Object { Object { "name": "async", "range": Array [ - 125, - 130, + 139, + 144, ], "type": "Identifier", }, @@ -19118,11 +19146,94 @@ Object { "name": "async", "references": Array [ Object { - "$ref": 9, + "$ref": 10, }, ], "scope": Object { - "$ref": 10, + "$ref": 12, + }, + }, + Object { + "$id": 5, + "defs": Array [ + Object { + "name": Object { + "name": "is", + "range": Array [ + 87, + 89, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 87, + 93, + ], + "type": "VariableDeclarator", + }, + "parent": Object { + "range": Array [ + 81, + 94, + ], + "type": "VariableDeclaration", + }, + "type": "Variable", + }, + Object { + "name": Object { + "name": "is", + "range": Array [ + 148, + 150, + ], + "type": "Identifier", + }, + "node": Object { + "range": Array [ + 148, + 150, + ], + "type": "ImportSpecifier", + }, + "parent": Object { + "range": Array [ + 96, + 173, + ], + "type": "ImportDeclaration", + }, + "type": "ImportBinding", + }, + ], + "eslintUsed": undefined, + "identifiers": Array [ + Object { + "name": "is", + "range": Array [ + 87, + 89, + ], + "type": "Identifier", + }, + Object { + "name": "is", + "range": Array [ + 148, + 150, + ], + "type": "Identifier", + }, + ], + "name": "is", + "references": Array [ + Object { + "$ref": 11, + }, + ], + "scope": Object { + "$ref": 12, }, }, ], @@ -19136,7 +19247,7 @@ Object { "upperScope": null, "variableMap": Object {}, "variableScope": Object { - "$ref": 11, + "$ref": 13, }, "variables": Array [], } diff --git a/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts index f4cbb3212bf1..a54c3851de81 100644 --- a/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts +++ b/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts @@ -3,6 +3,7 @@ const set = 1; const module = 1; const type = 1; const async = 1; +const is = 1; import { get, @@ -10,4 +11,5 @@ import { module, type, async, + is, } from 'fake-module'; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index a8d1b137d1c2..3ea42a02a85e 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -456,6 +456,7 @@ export function getTokenType(token: any): AST_TOKEN_TYPES { case SyntaxKind.TypeKeyword: case SyntaxKind.ModuleKeyword: case SyntaxKind.AsyncKeyword: + case SyntaxKind.IsKeyword: return AST_TOKEN_TYPES.Identifier; default: diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 0859b0362508..e433f0a3fc6c 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -58981,35 +58981,109 @@ Object { ], "type": "VariableDeclaration", }, + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "name": "is", + "range": Array [ + 87, + 89, + ], + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 11, + "line": 6, + }, + }, + "range": Array [ + 92, + 93, + ], + "raw": "1", + "type": "Literal", + "value": 1, + }, + "loc": Object { + "end": Object { + "column": 12, + "line": 6, + }, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "range": Array [ + 87, + 93, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "range": Array [ + 81, + 94, + ], + "type": "VariableDeclaration", + }, Object { "loc": Object { "end": Object { "column": 21, - "line": 13, + "line": 15, }, "start": Object { "column": 0, - "line": 7, + "line": 8, }, }, "range": Array [ - 82, - 153, + 96, + 173, ], "source": Object { "loc": Object { "end": Object { "column": 20, - "line": 13, + "line": 15, }, "start": Object { "column": 7, - "line": 13, + "line": 15, }, }, "range": Array [ - 139, - 152, + 159, + 172, ], "raw": "'fake-module'", "type": "Literal", @@ -59021,51 +59095,51 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 8, + "line": 9, }, "start": Object { "column": 2, - "line": 8, + "line": 9, }, }, "name": "get", "range": Array [ - 93, - 96, + 107, + 110, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 5, - "line": 8, + "line": 9, }, "start": Object { "column": 2, - "line": 8, + "line": 9, }, }, "local": Object { "loc": Object { "end": Object { "column": 5, - "line": 8, + "line": 9, }, "start": Object { "column": 2, - "line": 8, + "line": 9, }, }, "name": "get", "range": Array [ - 93, - 96, + 107, + 110, ], "type": "Identifier", }, "range": Array [ - 93, - 96, + 107, + 110, ], "type": "ImportSpecifier", }, @@ -59074,51 +59148,51 @@ Object { "loc": Object { "end": Object { "column": 5, - "line": 9, + "line": 10, }, "start": Object { "column": 2, - "line": 9, + "line": 10, }, }, "name": "set", "range": Array [ - 100, - 103, + 114, + 117, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 5, - "line": 9, + "line": 10, }, "start": Object { "column": 2, - "line": 9, + "line": 10, }, }, "local": Object { "loc": Object { "end": Object { "column": 5, - "line": 9, + "line": 10, }, "start": Object { "column": 2, - "line": 9, + "line": 10, }, }, "name": "set", "range": Array [ - 100, - 103, + 114, + 117, ], "type": "Identifier", }, "range": Array [ - 100, - 103, + 114, + 117, ], "type": "ImportSpecifier", }, @@ -59127,51 +59201,51 @@ Object { "loc": Object { "end": Object { "column": 8, - "line": 10, + "line": 11, }, "start": Object { "column": 2, - "line": 10, + "line": 11, }, }, "name": "module", "range": Array [ - 107, - 113, + 121, + 127, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 8, - "line": 10, + "line": 11, }, "start": Object { "column": 2, - "line": 10, + "line": 11, }, }, "local": Object { "loc": Object { "end": Object { "column": 8, - "line": 10, + "line": 11, }, "start": Object { "column": 2, - "line": 10, + "line": 11, }, }, "name": "module", "range": Array [ - 107, - 113, + 121, + 127, ], "type": "Identifier", }, "range": Array [ - 107, - 113, + 121, + 127, ], "type": "ImportSpecifier", }, @@ -59180,51 +59254,51 @@ Object { "loc": Object { "end": Object { "column": 6, - "line": 11, + "line": 12, }, "start": Object { "column": 2, - "line": 11, + "line": 12, }, }, "name": "type", "range": Array [ - 117, - 121, + 131, + 135, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 6, - "line": 11, + "line": 12, }, "start": Object { "column": 2, - "line": 11, + "line": 12, }, }, "local": Object { "loc": Object { "end": Object { "column": 6, - "line": 11, + "line": 12, }, "start": Object { "column": 2, - "line": 11, + "line": 12, }, }, "name": "type", "range": Array [ - 117, - 121, + 131, + 135, ], "type": "Identifier", }, "range": Array [ - 117, - 121, + 131, + 135, ], "type": "ImportSpecifier", }, @@ -59233,51 +59307,104 @@ Object { "loc": Object { "end": Object { "column": 7, - "line": 12, + "line": 13, }, "start": Object { "column": 2, - "line": 12, + "line": 13, }, }, "name": "async", "range": Array [ - 125, - 130, + 139, + 144, ], "type": "Identifier", }, "loc": Object { "end": Object { "column": 7, - "line": 12, + "line": 13, }, "start": Object { "column": 2, - "line": 12, + "line": 13, }, }, "local": Object { "loc": Object { "end": Object { "column": 7, - "line": 12, + "line": 13, }, "start": Object { "column": 2, - "line": 12, + "line": 13, }, }, "name": "async", "range": Array [ - 125, - 130, + 139, + 144, ], "type": "Identifier", }, "range": Array [ - 125, - 130, + 139, + 144, + ], + "type": "ImportSpecifier", + }, + Object { + "imported": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "name": "is", + "range": Array [ + 148, + 150, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "local": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "name": "is", + "range": Array [ + 148, + 150, + ], + "type": "Identifier", + }, + "range": Array [ + 148, + 150, ], "type": "ImportSpecifier", }, @@ -59288,7 +59415,7 @@ Object { "loc": Object { "end": Object { "column": 0, - "line": 14, + "line": 16, }, "start": Object { "column": 0, @@ -59297,7 +59424,7 @@ Object { }, "range": Array [ 0, - 154, + 174, ], "sourceType": "module", "tokens": Array [ @@ -59754,56 +59881,92 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, - "line": 7, + "column": 5, + "line": 6, }, "start": Object { "column": 0, - "line": 7, + "line": 6, }, }, "range": Array [ - 82, - 88, + 81, + 86, ], "type": "Keyword", - "value": "import", + "value": "const", }, Object { "loc": Object { "end": Object { "column": 8, - "line": 7, + "line": 6, }, "start": Object { - "column": 7, - "line": 7, + "column": 6, + "line": 6, }, }, "range": Array [ + 87, 89, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 6, + }, + "start": Object { + "column": 9, + "line": 6, + }, + }, + "range": Array [ 90, + 91, ], "type": "Punctuator", - "value": "{", + "value": "=", }, Object { "loc": Object { "end": Object { - "column": 5, - "line": 8, + "column": 12, + "line": 6, }, "start": Object { - "column": 2, - "line": 8, + "column": 11, + "line": 6, }, }, "range": Array [ + 92, 93, - 96, ], - "type": "Identifier", - "value": "get", + "type": "Numeric", + "value": "1", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 6, + }, + "start": Object { + "column": 12, + "line": 6, + }, + }, + "range": Array [ + 93, + 94, + ], + "type": "Punctuator", + "value": ";", }, Object { "loc": Object { @@ -59812,16 +59975,34 @@ Object { "line": 8, }, "start": Object { - "column": 5, + "column": 0, "line": 8, }, }, "range": Array [ 96, - 97, + 102, + ], + "type": "Keyword", + "value": "import", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 103, + 104, ], "type": "Punctuator", - "value": ",", + "value": "{", }, Object { "loc": Object { @@ -59835,11 +60016,11 @@ Object { }, }, "range": Array [ - 100, - 103, + 107, + 110, ], "type": "Identifier", - "value": "set", + "value": "get", }, Object { "loc": Object { @@ -59853,8 +60034,8 @@ Object { }, }, "range": Array [ - 103, - 104, + 110, + 111, ], "type": "Punctuator", "value": ",", @@ -59862,7 +60043,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 8, + "column": 5, "line": 10, }, "start": Object { @@ -59871,26 +60052,26 @@ Object { }, }, "range": Array [ - 107, - 113, + 114, + 117, ], "type": "Identifier", - "value": "module", + "value": "set", }, Object { "loc": Object { "end": Object { - "column": 9, + "column": 6, "line": 10, }, "start": Object { - "column": 8, + "column": 5, "line": 10, }, }, "range": Array [ - 113, - 114, + 117, + 118, ], "type": "Punctuator", "value": ",", @@ -59898,7 +60079,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 6, + "column": 8, "line": 11, }, "start": Object { @@ -59907,26 +60088,26 @@ Object { }, }, "range": Array [ - 117, 121, + 127, ], "type": "Identifier", - "value": "type", + "value": "module", }, Object { "loc": Object { "end": Object { - "column": 7, + "column": 9, "line": 11, }, "start": Object { - "column": 6, + "column": 8, "line": 11, }, }, "range": Array [ - 121, - 122, + 127, + 128, ], "type": "Punctuator", "value": ",", @@ -59934,7 +60115,7 @@ Object { Object { "loc": Object { "end": Object { - "column": 7, + "column": 6, "line": 12, }, "start": Object { @@ -59943,8 +60124,44 @@ Object { }, }, "range": Array [ - 125, - 130, + 131, + 135, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 12, + }, + "start": Object { + "column": 6, + "line": 12, + }, + }, + "range": Array [ + 135, + 136, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "range": Array [ + 139, + 144, ], "type": "Identifier", "value": "async", @@ -59953,16 +60170,52 @@ Object { "loc": Object { "end": Object { "column": 8, - "line": 12, + "line": 13, }, "start": Object { "column": 7, - "line": 12, + "line": 13, }, }, "range": Array [ - 130, - 131, + 144, + 145, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "range": Array [ + 148, + 150, + ], + "type": "Identifier", + "value": "is", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + "range": Array [ + 150, + 151, ], "type": "Punctuator", "value": ",", @@ -59971,16 +60224,16 @@ Object { "loc": Object { "end": Object { "column": 1, - "line": 13, + "line": 15, }, "start": Object { "column": 0, - "line": 13, + "line": 15, }, }, "range": Array [ - 132, - 133, + 152, + 153, ], "type": "Punctuator", "value": "}", @@ -59989,16 +60242,16 @@ Object { "loc": Object { "end": Object { "column": 6, - "line": 13, + "line": 15, }, "start": Object { "column": 2, - "line": 13, + "line": 15, }, }, "range": Array [ - 134, - 138, + 154, + 158, ], "type": "Identifier", "value": "from", @@ -60007,16 +60260,16 @@ Object { "loc": Object { "end": Object { "column": 20, - "line": 13, + "line": 15, }, "start": Object { "column": 7, - "line": 13, + "line": 15, }, }, "range": Array [ - 139, - 152, + 159, + 172, ], "type": "String", "value": "'fake-module'", @@ -60025,16 +60278,16 @@ Object { "loc": Object { "end": Object { "column": 21, - "line": 13, + "line": 15, }, "start": Object { "column": 20, - "line": 13, + "line": 15, }, }, "range": Array [ - 152, - 153, + 172, + 173, ], "type": "Punctuator", "value": ";", From b2ca20d005d6a626319c76da121aea44df26ab53 Mon Sep 17 00:00:00 2001 From: Jaya Krishna Namburu Date: Wed, 24 Jul 2019 21:07:24 +0530 Subject: [PATCH 08/38] feat(eslint-plugin): [no-var-requires] report on foo(require('')) (#725) Fixes #665 --- packages/eslint-plugin/src/rules/no-var-requires.ts | 3 ++- .../eslint-plugin/tests/rules/no-var-requires.test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 8d8e714c4f5a..29b1c77dd34a 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -27,7 +27,8 @@ export default util.createRule({ node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === 'require' && node.parent && - node.parent.type === AST_NODE_TYPES.VariableDeclarator + (node.parent.type === AST_NODE_TYPES.VariableDeclarator || + node.parent.type === AST_NODE_TYPES.CallExpression) ) { context.report({ node, diff --git a/packages/eslint-plugin/tests/rules/no-var-requires.test.ts b/packages/eslint-plugin/tests/rules/no-var-requires.test.ts index f209c2069f03..b042ac1f8067 100644 --- a/packages/eslint-plugin/tests/rules/no-var-requires.test.ts +++ b/packages/eslint-plugin/tests/rules/no-var-requires.test.ts @@ -38,5 +38,15 @@ ruleTester.run('no-var-requires', rule, { }, ], }, + { + code: "let foo = trick(require('foo'))", + errors: [ + { + messageId: 'noVarReqs', + line: 1, + column: 17, + }, + ], + }, ], }); From e32c7ad405bd22a73bb1405e4e08897af8f36c62 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 24 Jul 2019 16:06:04 -0700 Subject: [PATCH 09/38] feat(eslint-plugin): remove deprecated rules (#739) BREAKING CHANGE: removing rules --- packages/eslint-plugin/ROADMAP.md | 8 +- .../docs/rules/no-triple-slash-reference.md | 43 ----------- .../docs/rules/prefer-interface.md | 36 --------- .../src/configs/recommended.json | 2 - packages/eslint-plugin/src/rules/index.ts | 4 - .../src/rules/no-triple-slash-reference.ts | 42 ----------- .../src/rules/prefer-interface.ts | 64 ---------------- .../rules/no-triple-slash-reference.test.ts | 45 ------------ .../tests/rules/prefer-interface.test.ts | 73 ------------------- 9 files changed, 4 insertions(+), 313 deletions(-) delete mode 100644 packages/eslint-plugin/docs/rules/no-triple-slash-reference.md delete mode 100644 packages/eslint-plugin/docs/rules/prefer-interface.md delete mode 100644 packages/eslint-plugin/src/rules/no-triple-slash-reference.ts delete mode 100644 packages/eslint-plugin/src/rules/prefer-interface.ts delete mode 100644 packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts delete mode 100644 packages/eslint-plugin/tests/rules/prefer-interface.test.ts diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 60cdbe7de24f..a30bd468d17a 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -26,7 +26,7 @@ | [`no-namespace`] | ✅ | [`@typescript-eslint/no-namespace`] | | [`no-non-null-assertion`] | ✅ | [`@typescript-eslint/no-non-null-assertion`] | | [`no-parameter-reassignment`] | ✅ | [`no-param-reassign`][no-param-reassign] | -| [`no-reference`] | ✅ | [`@typescript-eslint/no-triple-slash-reference`] | +| [`no-reference`] | ✅ | [`@typescript-eslint/triple-slash-reference`] | | [`no-unnecessary-type-assertion`] | ✅ | [`@typescript-eslint/no-unnecessary-type-assertion`] | | [`no-var-requires`] | ✅ | [`@typescript-eslint/no-var-requires`] | | [`only-arrow-functions`] | 🔌 | [`prefer-arrow/prefer-arrow-functions`] | @@ -148,7 +148,7 @@ | [`import-spacing`] | 🔌 | Use [Prettier] | | [`increment-decrement`] | 🌟 | [`no-plusplus`][no-plusplus] | | [`interface-name`] | ✅ | [`@typescript-eslint/interface-name-prefix`] | -| [`interface-over-type-literal`] | ✅ | [`@typescript-eslint/prefer-interface`] | +| [`interface-over-type-literal`] | ✅ | [`@typescript-eslint/consistent-type-definitions`] | | [`jsdoc-format`] | 🌓 | [`valid-jsdoc`][valid-jsdoc] or [`eslint-plugin-jsdoc`][plugin:jsdoc] | | [`match-default-export-name`] | 🛑 | N/A | | [`newline-before-return`] | 🌟 | [`padding-line-between-statements`][padding-line-between-statements] [1] | @@ -577,6 +577,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/await-thenable`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md [`@typescript-eslint/ban-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md [`@typescript-eslint/ban-ts-ignore`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-ignore.md +[`@typescript-eslint/consistent-type-definitions`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md [`@typescript-eslint/explicit-member-accessibility`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md [`@typescript-eslint/member-ordering`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-ordering.md [`@typescript-eslint/no-explicit-any`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -586,7 +587,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/promise-function-async`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/promise-function-async.md [`@typescript-eslint/no-namespace`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md [`@typescript-eslint/no-non-null-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md -[`@typescript-eslint/no-triple-slash-reference`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-triple-slash-reference.md +[`@typescript-eslint/triple-slash-reference`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md [`@typescript-eslint/unbound-method`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unbound-method.md [`@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 [`@typescript-eslint/no-var-requires`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md @@ -608,7 +609,6 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/no-parameter-properties`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md [`@typescript-eslint/member-delimiter-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md [`@typescript-eslint/prefer-for-of`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md -[`@typescript-eslint/prefer-interface`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-interface.md [`@typescript-eslint/no-array-constructor`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md [`@typescript-eslint/prefer-function-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-function-type.md [`@typescript-eslint/prefer-readonly`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md diff --git a/packages/eslint-plugin/docs/rules/no-triple-slash-reference.md b/packages/eslint-plugin/docs/rules/no-triple-slash-reference.md deleted file mode 100644 index 409ff6093ca1..000000000000 --- a/packages/eslint-plugin/docs/rules/no-triple-slash-reference.md +++ /dev/null @@ -1,43 +0,0 @@ -# Disallow `/// ` comments (no-triple-slash-reference) - -Triple-slash reference directive comments should not be used anymore. Use `import` instead. - -Before TypeScript adopted ES6 Module syntax, -triple-slash reference directives were used to specify dependencies. -Now that we have `import`, triple-slash reference directives are discouraged for specifying dependencies -in favor of `import`. - -A triple-slash reference directive is a comment beginning with three slashes followed by a path to the module being imported: -`/// `. -ES6 Modules handle this now: -`import animal from "./Animal"` - -## DEPRECATED - this rule has been deprecated in favour of [`triple-slash-reference`](./triple-slash-reference.md) - -## Rule Details - -Does not allow the use of `/// ` comments. - -The following patterns are considered warnings: - -```ts -/// -``` - -The following patterns are not warnings: - -```ts -import Animal from 'Animal'; -``` - -## When Not To Use It - -If you use `/// ` style imports. - -## Further Reading - -- TypeScript [Triple-Slash Directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) - -## Compatibility - -- TSLint: [no-reference](http://palantir.github.io/tslint/rules/no-reference/) diff --git a/packages/eslint-plugin/docs/rules/prefer-interface.md b/packages/eslint-plugin/docs/rules/prefer-interface.md deleted file mode 100644 index 8b995e6b06c7..000000000000 --- a/packages/eslint-plugin/docs/rules/prefer-interface.md +++ /dev/null @@ -1,36 +0,0 @@ -# Prefer an interface declaration over a type literal (type T = { ... }) (prefer-interface)\ - -Interfaces are generally preferred over type literals because interfaces can be implemented, extended and merged. - -## DEPRECATED - this rule has been deprecated in favour of [`consistent-type-definitions`](./consistent-type-definitions.md) - -## Rule Details - -Examples of **incorrect** code for this rule. - -```ts -type T = { x: number }; -``` - -Examples of **correct** code for this rule. - -```ts -type T = string; -type Foo = string | {}; - -interface T { - x: number; -} -``` - -## Options - -```CJSON -{ - "interface-over-type-literal": "error" -} -``` - -## Compatibility - -- TSLint: [interface-over-type-literal](https://palantir.github.io/tslint/rules/interface-over-type-literal/) diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index d26fd25d01c1..0e6d6d9f665f 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -24,13 +24,11 @@ "@typescript-eslint/no-non-null-assertion": "error", "@typescript-eslint/no-object-literal-type-assertion": "error", "@typescript-eslint/no-parameter-properties": "error", - "@typescript-eslint/no-triple-slash-reference": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "warn", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-interface": "error", "@typescript-eslint/prefer-namespace-keyword": "error", "@typescript-eslint/type-annotation-spacing": "error" } diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 482806640756..4ae1d9b8ea85 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -34,7 +34,6 @@ import noObjectLiteralTypeAssertion from './no-object-literal-type-assertion'; import noParameterProperties from './no-parameter-properties'; import noRequireImports from './no-require-imports'; import noThisAlias from './no-this-alias'; -import noTripleSlashReference from './no-triple-slash-reference'; import noTypeAlias from './no-type-alias'; import noUnnecessaryQualifier from './no-unnecessary-qualifier'; import noUnnecessaryTypeAssertion from './no-unnecessary-type-assertion'; @@ -45,7 +44,6 @@ import noVarRequires from './no-var-requires'; import preferForOf from './prefer-for-of'; import preferFunctionType from './prefer-function-type'; import preferIncludes from './prefer-includes'; -import preferInterface from './prefer-interface'; import preferNamespaceKeyword from './prefer-namespace-keyword'; import preferReadonly from './prefer-readonly'; import preferRegexpExec from './prefer-regexp-exec'; @@ -98,7 +96,6 @@ export default { 'no-parameter-properties': noParameterProperties, 'no-require-imports': noRequireImports, 'no-this-alias': noThisAlias, - 'no-triple-slash-reference': noTripleSlashReference, 'no-type-alias': noTypeAlias, 'no-unnecessary-qualifier': noUnnecessaryQualifier, 'no-unnecessary-type-assertion': noUnnecessaryTypeAssertion, @@ -109,7 +106,6 @@ export default { 'prefer-for-of': preferForOf, 'prefer-function-type': preferFunctionType, 'prefer-includes': preferIncludes, - 'prefer-interface': preferInterface, 'prefer-namespace-keyword': preferNamespaceKeyword, 'prefer-readonly': preferReadonly, 'prefer-regexp-exec': preferRegexpExec, diff --git a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts b/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts deleted file mode 100644 index 49f164201664..000000000000 --- a/packages/eslint-plugin/src/rules/no-triple-slash-reference.ts +++ /dev/null @@ -1,42 +0,0 @@ -import * as util from '../util'; - -export default util.createRule({ - name: 'no-triple-slash-reference', - meta: { - type: 'suggestion', - docs: { - description: 'Disallow `/// ` comments', - category: 'Best Practices', - recommended: 'error', - }, - schema: [], - deprecated: true, - replacedBy: ['triple-slash-reference'], - messages: { - noTripleSlashReference: 'Do not use a triple slash reference.', - }, - }, - defaultOptions: [], - create(context) { - const referenceRegExp = /^\/\s* { - if (comment.type !== 'Line') { - return; - } - if (referenceRegExp.test(comment.value)) { - context.report({ - node: comment, - messageId: 'noTripleSlashReference', - }); - } - }); - }, - }; - }, -}); diff --git a/packages/eslint-plugin/src/rules/prefer-interface.ts b/packages/eslint-plugin/src/rules/prefer-interface.ts deleted file mode 100644 index 555e9646b2ba..000000000000 --- a/packages/eslint-plugin/src/rules/prefer-interface.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; -import * as util from '../util'; - -export default util.createRule({ - name: 'prefer-interface', - meta: { - type: 'suggestion', - docs: { - description: - 'Prefer an interface declaration over a type literal (type T = { ... })', - category: 'Stylistic Issues', - recommended: 'error', - }, - fixable: 'code', - messages: { - interfaceOverType: 'Use an interface instead of a type literal.', - }, - schema: [], - deprecated: true, - replacedBy: ['consistent-type-definitions'], - }, - defaultOptions: [], - create(context) { - const sourceCode = context.getSourceCode(); - - return { - // VariableDeclaration with kind type has only one VariableDeclarator - "TSTypeAliasDeclaration[typeAnnotation.type='TSTypeLiteral']"( - node: TSESTree.TSTypeAliasDeclaration, - ) { - context.report({ - node: node.id, - messageId: 'interfaceOverType', - fix(fixer) { - const typeNode = node.typeParameters || node.id; - const fixes: TSESLint.RuleFix[] = []; - - const firstToken = sourceCode.getFirstToken(node); - if (firstToken) { - fixes.push(fixer.replaceText(firstToken, 'interface')); - fixes.push( - fixer.replaceTextRange( - [typeNode.range[1], node.typeAnnotation.range[0]], - ' ', - ), - ); - } - - const afterToken = sourceCode.getTokenAfter(node.typeAnnotation); - if ( - afterToken && - afterToken.type === 'Punctuator' && - afterToken.value === ';' - ) { - fixes.push(fixer.remove(afterToken)); - } - - return fixes; - }, - }); - }, - }; - }, -}); diff --git a/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts b/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts deleted file mode 100644 index 5bffd663249c..000000000000 --- a/packages/eslint-plugin/tests/rules/no-triple-slash-reference.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import rule from '../../src/rules/no-triple-slash-reference'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('no-triple-slash-reference', rule, { - valid: [ - `/// `, - `/// `, - `/// `, - '/// Non-reference triple-slash comment', - "// ", - `/* -/// -let a -*/`, - ], - invalid: [ - { - code: '/// ', - errors: [ - { - messageId: 'noTripleSlashReference', - line: 1, - column: 1, - }, - ], - }, - { - code: ` -/// -let a - `, - errors: [ - { - messageId: 'noTripleSlashReference', - line: 2, - column: 1, - }, - ], - }, - ], -}); diff --git a/packages/eslint-plugin/tests/rules/prefer-interface.test.ts b/packages/eslint-plugin/tests/rules/prefer-interface.test.ts deleted file mode 100644 index ea09c3eb91f6..000000000000 --- a/packages/eslint-plugin/tests/rules/prefer-interface.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import rule from '../../src/rules/prefer-interface'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('interface-over-type-literal', rule, { - valid: [ - `var foo = { };`, - `type U = string;`, - `type V = { x: number; } | { y: string; };`, - ` -type Record = { - [K in T]: U; -} - `, - ], - invalid: [ - { - code: `type T = { x: number; }`, - output: `interface T { x: number; }`, - errors: [ - { - messageId: 'interfaceOverType', - line: 1, - column: 6, - }, - ], - }, - { - code: `type T={ x: number; }`, - output: `interface T { x: number; }`, - errors: [ - { - messageId: 'interfaceOverType', - line: 1, - column: 6, - }, - ], - }, - { - code: `type T= { x: number; }`, - output: `interface T { x: number; }`, - errors: [ - { - messageId: 'interfaceOverType', - line: 1, - column: 6, - }, - ], - }, - { - code: ` -export type W = { - x: T, -}; -`, - output: ` -export interface W { - x: T, -} -`, - errors: [ - { - messageId: 'interfaceOverType', - line: 2, - column: 13, - }, - ], - }, - ], -}); From 4893aecf68012bb3868632bd06f21dcc714e1442 Mon Sep 17 00:00:00 2001 From: Borek Bernard Date: Thu, 25 Jul 2019 01:06:53 +0200 Subject: [PATCH 10/38] feat(eslint-plugin): move opinionated rules between configs (#595) BREAKING CHANGE: both 'eslint-recommended' and 'recommended' have changed. --- .../src/configs/eslint-recommended.ts | 20 ++----------------- .../src/configs/recommended.json | 4 ++++ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/eslint-plugin/src/configs/eslint-recommended.ts b/packages/eslint-plugin/src/configs/eslint-recommended.ts index 283cd46aa2f2..39e8379b56b0 100644 --- a/packages/eslint-plugin/src/configs/eslint-recommended.ts +++ b/packages/eslint-plugin/src/configs/eslint-recommended.ts @@ -1,19 +1,12 @@ /** - * The goal of this ruleset is to update the eslint:recommended config to better - * suit Typescript. There are two main reasons to change the configuration: - * 1. The Typescript compiler natively checks some things that therefore don't - * need extra rules anymore. - * 2. Typescript allows for more modern Javascript code that can thus be - * enabled. + * This is a compatibility ruleset that disables rules from eslint:recommended + * which are already handled by TypeScript. */ export default { overrides: [ { files: ['*.ts', '*.tsx'], rules: { - /** - * 1. Disable things that are checked by Typescript - */ //Checked by Typescript - ts(2378) 'getter-return': 'off', // Checked by Typescript - ts(2300) @@ -36,15 +29,6 @@ export default { 'no-dupe-class-members': 'off', // This is already checked by Typescript. 'no-redeclare': 'off', - /** - * 2. Enable more ideomatic code - */ - // Typescript allows const and let instead of var. - 'no-var': 'error', - 'prefer-const': 'error', - // The spread operator/rest parameters should be prefered in Typescript. - 'prefer-rest-params': 'error', - 'prefer-spread': 'error', }, }, ], diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 0e6d6d9f665f..471d3df02a94 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -1,6 +1,10 @@ { "extends": "./configs/base.json", "rules": { + "no-var": "error", + "prefer-const": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", "@typescript-eslint/adjacent-overload-signatures": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/ban-types": "error", From 35cc99b72e9dda2729517218ebf4f6fae6ecfd9c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 24 Jul 2019 19:24:50 -0400 Subject: [PATCH 11/38] feat(eslint-plugin): added new rule typedef (#581) --- packages/eslint-plugin/README.md | 1 + packages/eslint-plugin/ROADMAP.md | 3 +- packages/eslint-plugin/docs/rules/typedef.md | 264 ++++++++++ packages/eslint-plugin/src/configs/all.json | 1 + packages/eslint-plugin/src/rules/index.ts | 4 +- packages/eslint-plugin/src/rules/typedef.ts | 136 +++++ .../eslint-plugin/tests/rules/typedef.test.ts | 476 ++++++++++++++++++ 7 files changed, 883 insertions(+), 2 deletions(-) create mode 100644 packages/eslint-plugin/docs/rules/typedef.md create mode 100644 packages/eslint-plugin/src/rules/typedef.ts create mode 100644 packages/eslint-plugin/tests/rules/typedef.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index ce069a2aff6d..167bb2b49334 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -181,6 +181,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | | :thought_balloon: | | [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | | | | | [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | | [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | | | :thought_balloon: | | [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index a30bd468d17a..ab59ea66ab09 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -32,8 +32,8 @@ | [`only-arrow-functions`] | 🔌 | [`prefer-arrow/prefer-arrow-functions`] | | [`prefer-for-of`] | ✅ | [`@typescript-eslint/prefer-for-of`] | | [`promise-function-async`] | ✅ | [`@typescript-eslint/promise-function-async`] | -| [`typedef`] | 🛑 | N/A | | [`typedef-whitespace`] | ✅ | [`@typescript-eslint/type-annotation-spacing`] | +| [`typedef`] | ✅ | [`@typescript-eslint/typedef`] | | [`unified-signatures`] | ✅ | [`@typescript-eslint/unified-signatures`] | [1] The ESLint rule only supports exact string matching, rather than regular expressions
@@ -592,6 +592,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@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 [`@typescript-eslint/no-var-requires`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md [`@typescript-eslint/type-annotation-spacing`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md +[`@typescript-eslint/typedef`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md [`@typescript-eslint/unified-signatures`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md [`@typescript-eslint/no-misused-new`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md [`@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 diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md new file mode 100644 index 000000000000..4498ab956100 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -0,0 +1,264 @@ +# Require type annotations to exist (typedef) + +TypeScript cannot always infer types for all places in code. +Some locations require type annotations for their types to be inferred. + +```ts +class ContainsText { + // There must be a type annotation here to infer the type + delayedText: string; + + // `typedef` requires a type annotation here to maintain consistency + immediateTextExplicit: string = 'text'; + + // This is still a string type because of its initial value + immediateTextImplicit = 'text'; +} +``` + +> Note: requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. +> TypeScript is often better at inferring types than easily written type annotations would allow. +> Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and/or `--strictPropertyInitialization` compiler options to enforce type annotations only when useful. + +## Rule Details + +This rule can enforce type annotations in locations regardless of whether they're required. +This is typically used to maintain consistency for element types that sometimes require them. + +> To enforce type definitions existing on call signatures as per TSLint's `arrow-call-signature` and `call-signature` options, use `explicit-function-return-type`. + +## Options + +This rule has an object option that may receive any of the following as booleans: + +- `"arrayDestructuring"` +- `"arrowParameter"`: `true` by default +- `"memberVariableDeclaration"`: `true` by default +- `"objectDestructuring"` +- `"parameter"`: `true` by default +- `"propertyDeclaration"`: `true` by default +- `"variableDeclaration"` + +For example, with the following configuration: + +```json +{ + "rules": { + "typedef": [ + "error", + { + "arrowParameter": false, + "variableDeclaration": true + } + ] + } +} +``` + +- Type annotations on arrow function parameters are not required +- Type annotations on variables are required +- Options otherwise adhere to the defaults + +### arrayDestructuring + +Whether to enforce type annotations on variables declared using array destructuring. + +Examples of **incorrect** code with `{ "arrayDestructuring": true }`: + +```ts +const [a] = [1]; +const [b, c] = [1, 2]; +``` + +Examples of **correct** code with `{ "arrayDestructuring": true }`: + +```ts +const [a]: number[] = [1]; +const [b]: [number] = [2]; +const [c, d]: [boolean, string] = [true, 'text']; +``` + +### arrowParameter + +Whether to enforce type annotations for parameters of arrow functions. + +Examples of **incorrect** code with `{ "arrowParameter": true }`: + +```ts +const logsSize = size => console.log(size); + +['hello', 'world'].map(text => text.length); + +const mapper = { + map: text => text + '...', +}; +``` + +Examples of **correct** code with `{ "arrowParameter": true }`: + +```ts +const logsSize = (size: number) => console.log(text); + +['hello', 'world'].map((text: string) => text.length); + +const mapper = { + map: (text: string) => text + '...', +}; +``` + +### memberVariableDeclaration + +Whether to enforce type annotations on member variables of classes. + +Examples of **incorrect** code with `{ "memberVariableDeclaration": true }`: + +```ts +class ContainsText { + delayedText; + immediateTextImplicit = 'text'; +} +``` + +Examples of **correct** code with `{ "memberVariableDeclaration": true }`: + +```ts +class ContainsText { + delayedText: string; + immediateTextImplicit: string = 'text'; +} +``` + +### objectDestructuring + +Whether to enforce type annotations on variables declared using object destructuring. + +Examples of **incorrect** code with `{ "objectDestructuring": true }`: + +```ts +const { length } = 'text'; +const [b, c] = Math.random() ? [1, 2] : [3, 4]; +``` + +Examples of **correct** code with `{ "objectDestructuring": true }`: + +```ts +const { length }: { length: number } = 'text'; +const [b, c]: [number, number] = Math.random() ? [1, 2] : [3, 4]; +``` + +### parameter + +Whether to enforce type annotations for parameters of functions and methods. + +Examples of **incorrect** code with `{ "parameter": true }`: + +```ts +function logsSize(size): void { + console.log(size); +} + +const doublesSize = function(size): numeber { + return size * 2; +}; + +const divider = { + curriesSize(size): number { + return size; + }, + dividesSize: function(size): number { + return size / 2; + }, +}; + +class Logger { + log(text): boolean { + console.log('>', text); + return true; + } +} +``` + +Examples of **correct** code with `{ "parameter": true }`: + +```ts +function logsSize(size: number): void { + console.log(size); +} + +const doublesSize = function(size: number): numeber { + return size * 2; +}; + +const divider = { + curriesSize(size: number): number { + return size; + }, + dividesSize: function(size: number): number { + return size / 2; + }, +}; + +class Logger { + log(text: boolean): boolean { + console.log('>', text); + return true; + } +} +``` + +### propertyDeclaration + +Whether to enforce type annotations for properties of interfaces and types. + +Examples of **incorrect** code with `{ "propertyDeclaration": true }`: + +```ts +type Members = { + member; + otherMember; +}; +``` + +Examples of **correct** code with `{ "propertyDeclaration": true }`: + +```ts +type Members = { + member: boolean; + otherMember: string; +}; +``` + +### variableDeclaration + +Whether to enforce type annotations for variable declarations, excluding array and object destructuring. + +Examples of **incorrect** code with `{ "variableDeclaration": true }`: + +```ts +const text = 'text'; +let initialText = 'text'; +let delayedText; +``` + +Examples of **correct** code with `{ "variableDeclaration": true }`: + +```ts +const text: string = 'text'; +let initialText: string = 'text'; +let delayedText: string; +``` + +## When Not To Use It + +If you are using stricter TypeScript compiler options, particularly `--noImplicitAny` and/or `--strictPropertyInitialization`, you likely don't need this rule. + +In general, if you do not consider the cost of writing unnecessary type annotations reasonable, then do not use this rule. + +## Further Reading + +- [TypeScript Type System](https://basarat.gitbooks.io/typescript/docs/types/type-system.html) +- [Type Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html) + +## Compatibility + +- TSLint: [typedef](https://palantir.github.io/tslint/rules/typedef) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index cf3f61c69cd6..dac2e6b3f6b2 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -69,6 +69,7 @@ "@typescript-eslint/strict-boolean-expressions": "error", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/typedef": "error", "@typescript-eslint/unbound-method": "error", "@typescript-eslint/unified-signatures": "error" } diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 4ae1d9b8ea85..1d1bc59a846b 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -56,6 +56,7 @@ import semi from './semi'; import strictBooleanExpressions from './strict-boolean-expressions'; import tripleSlashReference from './triple-slash-reference'; import typeAnnotationSpacing from './type-annotation-spacing'; +import typedef from './typedef'; import unboundMethod from './unbound-method'; import unifiedSignatures from './unified-signatures'; @@ -114,10 +115,11 @@ export default { 'require-array-sort-compare': requireArraySortCompare, 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, - semi: semi, 'strict-boolean-expressions': strictBooleanExpressions, 'triple-slash-reference': tripleSlashReference, 'type-annotation-spacing': typeAnnotationSpacing, 'unbound-method': unboundMethod, 'unified-signatures': unifiedSignatures, + semi: semi, + typedef: typedef, }; diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts new file mode 100644 index 000000000000..a53f173303cc --- /dev/null +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -0,0 +1,136 @@ +import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import * as util from '../util'; + +const enum OptionKeys { + ArrayDestructuring = 'arrayDestructuring', + ArrowParameter = 'arrowParameter', + MemberVariableDeclaration = 'memberVariableDeclaration', + ObjectDestructuring = 'objectDestructuring', + Parameter = 'parameter', + PropertyDeclaration = 'propertyDeclaration', + VariableDeclaration = 'variableDeclaration', +} + +type Options = { [k in OptionKeys]?: boolean }; + +type MessageIds = 'expectedTypedef' | 'expectedTypedefNamed'; + +export default util.createRule<[Options], MessageIds>({ + name: 'typedef', + meta: { + docs: { + description: 'Requires type annotations to exist', + category: 'Stylistic Issues', + recommended: false, + }, + messages: { + expectedTypedef: 'expected a type annotation', + expectedTypedefNamed: 'expected {{name}} to have a type annotation', + }, + schema: [ + { + type: 'object', + properties: { + [OptionKeys.ArrayDestructuring]: { type: 'boolean' }, + [OptionKeys.ArrowParameter]: { type: 'boolean' }, + [OptionKeys.MemberVariableDeclaration]: { type: 'boolean' }, + [OptionKeys.ObjectDestructuring]: { type: 'boolean' }, + [OptionKeys.Parameter]: { type: 'boolean' }, + [OptionKeys.PropertyDeclaration]: { type: 'boolean' }, + [OptionKeys.VariableDeclaration]: { type: 'boolean' }, + }, + }, + ], + type: 'suggestion', + }, + defaultOptions: [ + { + [OptionKeys.ArrowParameter]: true, + [OptionKeys.MemberVariableDeclaration]: true, + [OptionKeys.Parameter]: true, + [OptionKeys.PropertyDeclaration]: true, + }, + ], + create(context, [options]) { + function report(location: TSESTree.Node, name?: string) { + context.report({ + node: location, + messageId: name ? 'expectedTypedefNamed' : 'expectedTypedef', + data: { name }, + }); + } + + function getNodeName(node: TSESTree.Parameter | TSESTree.PropertyName) { + return node.type === AST_NODE_TYPES.Identifier ? node.name : undefined; + } + + function checkParameters(params: TSESTree.Parameter[]) { + for (const param of params) { + if ( + param.type !== AST_NODE_TYPES.TSParameterProperty && + !param.typeAnnotation + ) { + report(param, getNodeName(param)); + } + } + } + + return { + ArrayPattern(node) { + if (options[OptionKeys.ArrayDestructuring] && !node.typeAnnotation) { + report(node); + } + }, + ArrowFunctionExpression(node) { + if (options[OptionKeys.ArrowParameter]) { + checkParameters(node.params); + } + }, + ClassProperty(node) { + if ( + options[OptionKeys.MemberVariableDeclaration] && + !node.typeAnnotation + ) { + report( + node, + node.key.type === AST_NODE_TYPES.Identifier + ? node.key.name + : undefined, + ); + } + }, + 'FunctionDeclaration, FunctionExpression'( + node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, + ) { + if (options[OptionKeys.Parameter]) { + checkParameters(node.params); + } + }, + ObjectPattern(node) { + if (options[OptionKeys.ObjectDestructuring] && !node.typeAnnotation) { + report(node); + } + }, + 'TSIndexSignature, TSPropertySignature'( + node: TSESTree.TSIndexSignature | TSESTree.TSPropertySignature, + ) { + if (options[OptionKeys.PropertyDeclaration] && !node.typeAnnotation) { + report( + node, + node.type === AST_NODE_TYPES.TSPropertySignature + ? getNodeName(node.key) + : undefined, + ); + } + }, + VariableDeclarator(node) { + if ( + options[OptionKeys.VariableDeclaration] && + !node.id.typeAnnotation + ) { + report(node, getNodeName(node.id)); + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts new file mode 100644 index 000000000000..8c281fe5e395 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -0,0 +1,476 @@ +import rule from '../../src/rules/typedef'; +import { RuleTester, getFixturesRootDir } from '../RuleTester'; + +const rootDir = getFixturesRootDir(); +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 2015, + tsconfigRootDir: rootDir, + project: './tsconfig.json', + }, +}); + +ruleTester.run('typedef', rule, { + valid: [ + // Array destructuring + { + code: `const [a]: [number] = [1]`, + options: [ + { + arrayDestructuring: true, + }, + ], + }, + { + code: `const [a, b]: [number, number] = [1, 2]`, + options: [ + { + arrayDestructuring: true, + }, + ], + }, + { + code: `const [a] = 1;`, + options: [ + { + arrayDestructuring: false, + }, + ], + }, + `let a: number; + [a] = [1];`, + // Arrow parameters + `((a: number): void => {})()`, + `((a: string, b: string): void => {})()`, + { + code: `((a: number): void => { })()`, + options: [ + { + arrowParameter: false, + }, + ], + }, + { + code: `((a: string, b: string): void => { })()`, + options: [ + { + arrowParameter: false, + }, + ], + }, + // Member variable declarations + `class Test { + state: number; + }`, + `class Test { + state: number = 1; + }`, + { + code: `class Test { + state = 1; + }`, + options: [ + { + memberVariableDeclaration: false, + }, + ], + }, + // Object destructuring + { + code: `const { a }: { a: number } = { a: 1 }`, + options: [ + { + objectDestructuring: true, + }, + ], + }, + { + code: `const { a, b }: { [i: string]: number } = { a: 1, b: 2 }`, + options: [ + { + objectDestructuring: true, + }, + ], + }, + { + code: `const { a } = { a: 1 };`, + options: [ + { + objectDestructuring: false, + }, + ], + }, + // Parameters + `function receivesNumber(a: number): void { }`, + `function receivesStrings(a: string, b: string): void { }`, + `function receivesNumber([a]: [number]): void { }`, + `function receivesNumbers([a, b]: number[]): void { }`, + `function receivesString({ a }: { a: string }): void { }`, + `function receivesStrings({ a, b }: { [i: string ]: string }): void { }`, + // Property declarations + `type Test = { + member: number; + };`, + `type Test = { + [i: string]: number; + };`, + `interface Test { + member: string; + };`, + `interface Test { + [i: number]: string; + };`, + { + code: `type Test = { + member; + };`, + options: [ + { + propertyDeclaration: false, + }, + ], + }, + { + code: `type Test = { + [i: string]; + };`, + options: [ + { + propertyDeclaration: false, + }, + ], + }, + // Variable declarations + { + code: `const x: string = "";`, + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `let x: string = "";`, + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `let x: string;`, + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `const a = 1;`, + options: [ + { + variableDeclaration: false, + }, + ], + }, + { + code: `let a;`, + options: [ + { + variableDeclaration: false, + }, + ], + }, + { + code: `let a = 1;`, + options: [ + { + variableDeclaration: false, + }, + ], + }, + ], + invalid: [ + // Array destructuring + { + code: `const [a] = [1]`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + options: [ + { + arrayDestructuring: true, + }, + ], + }, + { + code: `const [a, b] = [1, 2]`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + options: [ + { + arrayDestructuring: true, + }, + ], + }, + // Object destructuring + { + code: `const { a } = { a: 1 }`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + options: [ + { + objectDestructuring: true, + }, + ], + }, + { + code: `const { a, b } = { a: 1, b: 2 }`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + options: [ + { + objectDestructuring: true, + }, + ], + }, + // Arrow parameters + { + code: `const receivesNumber = (a): void => { }`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `const receivesStrings = (a, b): void => { }`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + { + data: { name: 'b' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + // Member variable declarations + { + code: `class Test { + state = 1; + }`, + errors: [ + { + data: { name: 'state' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `class Test { + ["state"] = 1; + }`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + }, + // Parameters + { + code: `function receivesNumber(a): void { }`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `function receivesStrings(a, b): void { }`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + { + data: { name: 'b' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `function receivesNumber([a]): void { }`, + errors: [ + { + column: 25, + messageId: 'expectedTypedef', + }, + ], + }, + { + code: `function receivesNumbers([a, b]): void { }`, + errors: [ + { + column: 26, + messageId: 'expectedTypedef', + }, + ], + }, + { + code: `function receivesString({ a }): void { }`, + errors: [ + { + column: 25, + messageId: 'expectedTypedef', + }, + ], + }, + { + code: `function receivesStrings({ a, b }): void { }`, + errors: [ + { + column: 26, + messageId: 'expectedTypedef', + }, + ], + }, + // Property declarations + { + code: `type Test = { + member; + };`, + errors: [ + { + data: { name: 'member' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `type Test = { + [i: string]; + };`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + }, + { + code: `interface Test { + member; + };`, + errors: [ + { + data: { name: 'member' }, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `interface Test { + [i: string]; + };`, + errors: [ + { + messageId: 'expectedTypedef', + }, + ], + }, + // Variable declarations + { + code: `const a = 1;`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + ], + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `const a = 1, b: number = 2, c = 3;`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + { + data: { name: 'c' }, + messageId: 'expectedTypedefNamed', + }, + ], + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `let a;`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + ], + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `let a = 1;`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + ], + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `let a = 1, b: number, c = 2;`, + errors: [ + { + data: { name: 'a' }, + messageId: 'expectedTypedefNamed', + }, + { + data: { name: 'c' }, + messageId: 'expectedTypedefNamed', + }, + ], + options: [ + { + variableDeclaration: true, + }, + ], + }, + ], +}); From f6f89e5fe91d9a170d6a65e2c0525fe22e0102dd Mon Sep 17 00:00:00 2001 From: ulrichb Date: Thu, 25 Jul 2019 01:25:22 +0200 Subject: [PATCH 12/38] docs(eslint-plugin) Add `no-async-without-await` to ROADMAP (#727) --- packages/eslint-plugin/ROADMAP.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index ab59ea66ab09..eff7e0656f98 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -51,6 +51,7 @@ | [`import-blacklist`] | 🌟 | [`no-restricted-imports`][no-restricted-imports] | | [`label-position`] | 🌟 | [`no-unused-labels`][no-unused-labels] (similar) | | [`no-arg`] | 🌟 | [`no-caller`][no-caller] (also blocks `arguments.caller`) | +| [`no-async-without-await`] | ✅ | [`@typescript-eslint/require-await`] | | [`no-bitwise`] | 🌟 | [`no-bitwise`][no-bitwise] | | [`no-conditional-assignment`] | 🌟 | [`no-cond-assign`][no-cond-assign][1] | | [`no-console`] | 🌟 | [`no-console`][no-console] (configuration works slightly differently) | @@ -355,6 +356,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`import-blacklist`]: https://palantir.github.io/tslint/rules/import-blacklist [`label-position`]: https://palantir.github.io/tslint/rules/label-position [`no-arg`]: https://palantir.github.io/tslint/rules/no-arg +[`no-async-without-await`]: https://palantir.github.io/tslint/rules/no-async-without-await [`no-bitwise`]: https://palantir.github.io/tslint/rules/no-bitwise [`no-conditional-assignment`]: https://palantir.github.io/tslint/rules/no-conditional-assignment [`no-console`]: https://palantir.github.io/tslint/rules/no-console @@ -613,6 +615,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/no-array-constructor`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md [`@typescript-eslint/prefer-function-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-function-type.md [`@typescript-eslint/prefer-readonly`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md +[`@typescript-eslint/require-await`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md [`@typescript-eslint/no-for-in-array`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md [`@typescript-eslint/no-unnecessary-qualifier`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md [`@typescript-eslint/semi`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md From fd6be425a80567aa4f723b6d56bf550b66fe9371 Mon Sep 17 00:00:00 2001 From: Retsam Date: Wed, 24 Jul 2019 19:33:39 -0400 Subject: [PATCH 13/38] feat(eslint-plugin): [strict-boolean-expressions] add ignoreRhs option (#691) --- .../docs/rules/strict-boolean-expressions.md | 6 ++++ .../src/rules/strict-boolean-expressions.ts | 33 ++++++++++++++++--- .../rules/strict-boolean-expressions.test.ts | 30 +++++++++++++++++ 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index 699af9baa431..de27437a47c2 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -52,6 +52,12 @@ while (typeof str !== 'undefined') { } ``` +## Options + +Options may be provided as an object with: + +- `ignoreRhs` to skip the check on the right hand side of expressions like `a && b` or `a || b` - allows these operators to be used for their short-circuiting behavior. (`false` by default). + ## Related To - TSLint: [strict-boolean-expressions](https://palantir.github.io/tslint/rules/strict-boolean-expressions) diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 5118b46a2486..867c69d5f9e3 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -13,7 +13,13 @@ type ExpressionWithTest = | TSESTree.IfStatement | TSESTree.WhileStatement; -export default util.createRule({ +type Options = [ + { + ignoreRhs?: boolean; + } +]; + +export default util.createRule({ name: 'strict-boolean-expressions', meta: { type: 'suggestion', @@ -22,13 +28,27 @@ export default util.createRule({ category: 'Best Practices', recommended: false, }, - schema: [], + schema: [ + { + type: 'object', + properties: { + ignoreRhs: { + type: 'boolean', + }, + }, + additionalProperties: false, + }, + ], messages: { strictBooleanExpression: 'Unexpected non-boolean in conditional.', }, }, - defaultOptions: [], - create(context) { + defaultOptions: [ + { + ignoreRhs: false, + }, + ], + create(context, [{ ignoreRhs }]) { const service = util.getParserServices(context); const checker = service.program.getTypeChecker(); @@ -65,7 +85,10 @@ export default util.createRule({ function assertLocalExpressionContainsBoolean( node: TSESTree.LogicalExpression, ): void { - if (!isBooleanType(node.left) || !isBooleanType(node.right)) { + if ( + !isBooleanType(node.left) || + (!ignoreRhs && !isBooleanType(node.right)) + ) { reportNode(node); } } diff --git a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts index 030bade0f480..1067b5fa4c68 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -156,6 +156,15 @@ ruleTester.run('strict-boolean-expressions', rule, { ` function foo(arg: T) { return !arg; } `, + { + options: [{ ignoreRhs: true }], + code: ` +const obj = {}; +const bool = false; +const boolOrObj = bool || obj; +const boolAndObj = bool && obj; +`, + }, ], invalid: [ @@ -903,5 +912,26 @@ ruleTester.run('strict-boolean-expressions', rule, { }, ], }, + { + options: [{ ignoreRhs: true }], + errors: [ + { + messageId: 'strictBooleanExpression', + line: 4, + column: 19, + }, + { + messageId: 'strictBooleanExpression', + line: 5, + column: 20, + }, + ], + code: ` +const obj = {}; +const bool = false; +const objOrBool = obj || bool; +const objAndBool = obj && bool; +`, + }, ], }); From 8141f01db8fa0c7b75fa1ef989ea0b8a4635fe0c Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 24 Jul 2019 16:45:14 -0700 Subject: [PATCH 14/38] feat(eslint-plugin): add support for object props in CallExpressions (#728) --- .../rules/explicit-function-return-type.md | 7 + .../rules/explicit-function-return-type.ts | 19 +-- .../explicit-function-return-type.test.ts | 143 ++++++++++++------ 3 files changed, 116 insertions(+), 53 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 9aacb0acafc7..01755e395409 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -141,6 +141,13 @@ let objectPropCast = { declare functionWithArg(arg: () => number); functionWithArg(() => 1); + +declare functionWithObjectArg(arg: { meth: () => number }); +functionWithObjectArg({ + meth() { + return 1; + }, +}); ``` ### allowHigherOrderFunctions diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 6d0625cd5cd5..8e02b893f646 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -118,20 +118,20 @@ export default util.createRule({ * `const x = { prop: () => {} }` */ function isPropertyOfObjectWithType( - parent: TSESTree.Node | undefined, + property: TSESTree.Node | undefined, ): boolean { - if (!parent || parent.type !== AST_NODE_TYPES.Property) { + if (!property || property.type !== AST_NODE_TYPES.Property) { return false; } - parent = parent.parent; // this shouldn't happen, checking just in case + const objectExpr = property.parent; // this shouldn't happen, checking just in case /* istanbul ignore if */ if ( - !parent || - parent.type !== AST_NODE_TYPES.ObjectExpression + !objectExpr || + objectExpr.type !== AST_NODE_TYPES.ObjectExpression ) { return false; } - parent = parent.parent; // this shouldn't happen, checking just in case + const parent = objectExpr.parent; // this shouldn't happen, checking just in case /* istanbul ignore if */ if (!parent) { return false; } @@ -139,7 +139,8 @@ export default util.createRule({ return ( isTypeCast(parent) || isClassPropertyWithTypeAnnotation(parent) || - isVariableDeclaratorWithTypeAnnotation(parent) + isVariableDeclaratorWithTypeAnnotation(parent) || + isFunctionArgument(parent) ); } @@ -193,12 +194,12 @@ export default util.createRule({ */ function isFunctionArgument( parent: TSESTree.Node, - child: TSESTree.Node, + callee?: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression, ): boolean { return ( parent.type === AST_NODE_TYPES.CallExpression && // make sure this isn't an IIFE - parent.callee !== child + parent.callee !== callee ); } diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index ddcf99e127a7..72d64d2abe06 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -273,6 +273,32 @@ new Accumulator().accumulate(() => 1); }, ], }, + { + filename: 'test.ts', + code: ` +declare function foo(arg: { meth: () => number }): void +foo({ + meth() { + return 1; + }, +}) +foo({ + meth: function () { + return 1; + }, +}) +foo({ + meth: () => { + return 1; + }, +}) + `, + options: [ + { + allowTypedFunctionExpressions: true, + }, + ], + }, ], invalid: [ { @@ -281,7 +307,7 @@ new Accumulator().accumulate(() => 1); function test() { return; } - `, + `, errors: [ { messageId: 'missingReturnType', @@ -296,7 +322,7 @@ function test() { var fn = function() { return 1; }; - `, + `, errors: [ { messageId: 'missingReturnType', @@ -309,7 +335,7 @@ var fn = function() { filename: 'test.ts', code: ` var arrowFn = () => 'test'; - `, + `, errors: [ { messageId: 'missingReturnType', @@ -332,7 +358,7 @@ class Test { } arrow = () => 'arrow'; } - `, + `, errors: [ { messageId: 'missingReturnType', @@ -353,21 +379,23 @@ class Test { }, { filename: 'test.ts', - code: `function test() { - return; - }`, + code: ` +function test() { + return; +} + `, options: [{ allowExpressions: true }], errors: [ { messageId: 'missingReturnType', - line: 1, + line: 2, column: 1, }, ], }, { filename: 'test.ts', - code: `const foo = () => {};`, + code: 'const foo = () => {};', options: [{ allowExpressions: true }], errors: [ { @@ -379,7 +407,7 @@ class Test { }, { filename: 'test.ts', - code: `const foo = function() {};`, + code: 'const foo = function() {};', options: [{ allowExpressions: true }], errors: [ { @@ -391,7 +419,7 @@ class Test { }, { filename: 'test.ts', - code: `var arrowFn = () => 'test';`, + code: "var arrowFn = () => 'test';", options: [{ allowTypedFunctionExpressions: true }], errors: [ { @@ -403,7 +431,7 @@ class Test { }, { filename: 'test.ts', - code: `var funcExpr = function() { return 'test'; };`, + code: "var funcExpr = function() { return 'test'; };", options: [{ allowTypedFunctionExpressions: true }], errors: [ { @@ -416,7 +444,7 @@ class Test { { filename: 'test.ts', - code: `const x = (() => {}) as Foo`, + code: 'const x = (() => {}) as Foo', options: [{ allowTypedFunctionExpressions: false }], errors: [ { @@ -459,84 +487,72 @@ const x: Foo = { }, { filename: 'test.ts', - code: ` -() => () => {}; - `, + code: '() => () => {};', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 7, }, ], }, { filename: 'test.ts', - code: ` -() => function () {}; - `, + code: '() => function () {};', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 7, }, ], }, { filename: 'test.ts', - code: ` -() => { return () => {} }; - `, + code: '() => { return () => {} };', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 16, }, ], }, { filename: 'test.ts', - code: ` -() => { return function () {} }; - `, + code: '() => { return function () {} };', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 16, }, ], }, { filename: 'test.ts', - code: ` -function fn() { return () => {} }; - `, + code: 'function fn() { return () => {} };', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 24, }, ], }, { filename: 'test.ts', - code: ` -function fn() { return function () {} }; - `, + code: 'function fn() { return function () {} };', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 24, }, ], @@ -566,14 +582,12 @@ function FunctionDeclaration() { }, { filename: 'test.ts', - code: ` -() => () => { return () => { return; } }; - `, + code: '() => () => { return () => { return; } };', options: [{ allowHigherOrderFunctions: true }], errors: [ { messageId: 'missingReturnType', - line: 2, + line: 1, column: 22, }, ], @@ -643,10 +657,41 @@ new Accumulator().accumulate(() => 1); }, ], }, + { + filename: 'test.ts', + code: '(() => true)()', + options: [ + { + allowTypedFunctionExpressions: false, + }, + ], + errors: [ + { + messageId: 'missingReturnType', + line: 1, + column: 2, + }, + ], + }, { filename: 'test.ts', code: ` -(() => true)() +declare function foo(arg: { meth: () => number }): void +foo({ + meth() { + return 1; + }, +}) +foo({ + meth: function () { + return 1; + }, +}) +foo({ + meth: () => { + return 1; + }, +}) `, options: [ { @@ -656,8 +701,18 @@ new Accumulator().accumulate(() => 1); errors: [ { messageId: 'missingReturnType', - line: 2, - column: 2, + line: 4, + column: 7, + }, + { + messageId: 'missingReturnType', + line: 9, + column: 9, + }, + { + messageId: 'missingReturnType', + line: 14, + column: 9, }, ], }, From 15191bb28769e0574718f4ce4083b20ec71942b9 Mon Sep 17 00:00:00 2001 From: James Henry Date: Wed, 24 Jul 2019 20:01:32 -0400 Subject: [PATCH 15/38] test: setup for real-world performance testing (#458) --- tests/performance/README.md | 28 +++++++++++++++++++ tests/performance/docker-compose.yml | 21 ++++++++++++++ .../fixtures/lint-real-repo/Dockerfile | 15 ++++++++++ .../lint-real-repo/install-local-packages.sh | 10 +++++++ 4 files changed, 74 insertions(+) create mode 100644 tests/performance/README.md create mode 100644 tests/performance/docker-compose.yml create mode 100644 tests/performance/fixtures/lint-real-repo/Dockerfile create mode 100755 tests/performance/fixtures/lint-real-repo/install-local-packages.sh diff --git a/tests/performance/README.md b/tests/performance/README.md new file mode 100644 index 000000000000..18dfdd118159 --- /dev/null +++ b/tests/performance/README.md @@ -0,0 +1,28 @@ +# Temp README (intended for maintainers only at this time) + +Run: + +```sh +docker-compose -f tests/performance/docker-compose.yml up --build +``` + +It will build the docker container, create volumes for the local files, and will clone the real world project repo ready for experimentation. + +The docker container is configured to run forever, so you just need to attach a shell to it, + +e.g. by running + +```sh +docker exec -it {{ RUNNING_CONTAINER_ID_HERE }} bash +``` + +Or by using the docker extension in VSCode and right clicking on the running container. + +Every time you make an update to the local built packages (e.g. parser or eslint-plugin), you need to rerun +the utility script _within_ the running container. + +For example, you will run something like the following (where `root@a91d93f9ffc3` refers to what's running in your container): + +```sh +root@a91d93f9ffc3:/usr/vega-lite# ../linked/install-local-packages.sh +``` diff --git a/tests/performance/docker-compose.yml b/tests/performance/docker-compose.yml new file mode 100644 index 000000000000..e47eb9581b7b --- /dev/null +++ b/tests/performance/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3' + +services: + lint-real-repo: + build: ./fixtures/lint-real-repo + container_name: "lint-real-repo" + volumes: + # Runtime link to the relevant built @typescript-eslint packages and test utils, + # but apply an empty volume for the package tests, we don't need those. + - ../../package.json/:/usr/root-package.json + - ./utils/:/usr/utils + - ../../packages/parser/:/usr/parser + - /usr/parser/tests + - ../../packages/typescript-estree/:/usr/typescript-estree + - /usr/typescript-estree/tests + - ../../packages/eslint-plugin/:/usr/eslint-plugin + - /usr/eslint-plugin/tests + - ../../packages/eslint-plugin-tslint/:/usr/eslint-plugin-tslint + - /usr/eslint-plugin-tslint/tests + # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. + - ./fixtures/lint-real-repo:/usr/linked diff --git a/tests/performance/fixtures/lint-real-repo/Dockerfile b/tests/performance/fixtures/lint-real-repo/Dockerfile new file mode 100644 index 000000000000..f3002796ecbb --- /dev/null +++ b/tests/performance/fixtures/lint-real-repo/Dockerfile @@ -0,0 +1,15 @@ +FROM node:carbon + +WORKDIR /usr + +# Clone the repo and checkout the relevant commit +RUN git clone https://github.com/typescript-eslint/vega-lite +WORKDIR /usr/vega-lite +RUN git checkout f1e4c1ebe50fdf3b9131ba5dde915e6efbe4bd87 + +# Run the equivalent of the project's travis build before linting starts +RUN yarn install --frozen-lockfile && yarn cache clean +RUN yarn build + +# Keep the container alive forever +CMD [ "tail", "-f", "/dev/null"] diff --git a/tests/performance/fixtures/lint-real-repo/install-local-packages.sh b/tests/performance/fixtures/lint-real-repo/install-local-packages.sh new file mode 100755 index 000000000000..f38459f34552 --- /dev/null +++ b/tests/performance/fixtures/lint-real-repo/install-local-packages.sh @@ -0,0 +1,10 @@ +# This script should be run by attaching a shell to the running docker +# container, and then running `../linked/install-local-packages.sh` from +# that shell. +# +# Use the local volumes for our own packages +# NOTE: You need to rerun this script every time the local packages change +# in order to apply the changes to the node_modules of the repo under test +yarn add @typescript-eslint/typescript-estree@file:///usr/typescript-estree +yarn add @typescript-eslint/parser@file:///usr/parser +yarn add @typescript-eslint/eslint-plugin@file:///usr/eslint-plugin From 92e98deed6290479b54f768b396ddfbc9e00b55b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 24 Jul 2019 17:14:54 -0700 Subject: [PATCH 16/38] feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) BREAKING CHANGE: Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule --- packages/eslint-plugin/README.md | 3 +- packages/eslint-plugin/ROADMAP.md | 7 +- .../docs/rules/consistent-type-assertions.md | 79 +++++ .../rules/no-angle-bracket-type-assertion.md | 32 -- .../rules/no-object-literal-type-assertion.md | 33 -- packages/eslint-plugin/src/configs/all.json | 3 +- packages/eslint-plugin/src/configs/base.json | 4 +- .../src/configs/recommended.json | 3 +- .../src/rules/consistent-type-assertions.ts | 158 +++++++++ packages/eslint-plugin/src/rules/index.ts | 6 +- .../rules/no-angle-bracket-type-assertion.ts | 34 -- .../rules/no-object-literal-type-assertion.ts | 91 ------ .../rules/consistent-type-assertions.test.ts | 302 ++++++++++++++++++ .../no-angle-bracket-type-assertion.test.ts | 164 ---------- .../no-object-literal-type-assertion.test.ts | 100 ------ .../eslint-utils/batchedSingleLineTests.ts | 13 +- .../src/ts-estree/ts-estree.ts | 2 +- 17 files changed, 563 insertions(+), 471 deletions(-) create mode 100644 packages/eslint-plugin/docs/rules/consistent-type-assertions.md delete mode 100644 packages/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md delete mode 100644 packages/eslint-plugin/docs/rules/no-object-literal-type-assertion.md create mode 100644 packages/eslint-plugin/src/rules/consistent-type-assertions.ts delete mode 100644 packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts delete mode 100644 packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts create mode 100644 packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts delete mode 100644 packages/eslint-plugin/tests/rules/no-angle-bracket-type-assertion.test.ts delete mode 100644 packages/eslint-plugin/tests/rules/no-object-literal-type-assertion.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 167bb2b49334..f33823200e72 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -130,6 +130,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Enforces that types will not to be used | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/camelcase`](./docs/rules/camelcase.md) | Enforce camelCase naming convention | :heavy_check_mark: | | | | [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names | :heavy_check_mark: | | | +| [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions. | :heavy_check_mark: | | | | [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | | [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | :heavy_check_mark: | | | | [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | :heavy_check_mark: | | | @@ -140,7 +141,6 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/member-naming`](./docs/rules/member-naming.md) | Enforces naming conventions for class members by visibility | | | | | [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | -| [`@typescript-eslint/no-angle-bracket-type-assertion`](./docs/rules/no-angle-bracket-type-assertion.md) | Enforces the use of `as Type` assertions instead of `` assertions | :heavy_check_mark: | | | | [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | | | | | [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :heavy_check_mark: | | | @@ -155,7 +155,6 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using promises in places not designed to handle them | | | :thought_balloon: | | [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :heavy_check_mark: | | | | [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :heavy_check_mark: | | | -| [`@typescript-eslint/no-object-literal-type-assertion`](./docs/rules/no-object-literal-type-assertion.md) | Forbids an object literal to appear in a type assertion expression | :heavy_check_mark: | | | | [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | :heavy_check_mark: | | | | [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | | [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | | | | diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index eff7e0656f98..cdad2d46f1b6 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -71,7 +71,7 @@ | [`no-invalid-this`] | 🌟 | [`no-invalid-this`][no-invalid-this] | | [`no-misused-new`] | ✅ | [`@typescript-eslint/no-misused-new`] | | [`no-null-keyword`] | 🔌 | [`no-null/no-null`] (doesn’t handle `null` type) | -| [`no-object-literal-type-assertion`] | ✅ | [`@typescript-eslint/no-object-literal-type-assertion`] | +| [`no-object-literal-type-assertion`] | ✅ | [`@typescript-eslint/consistent-type-assertions`] | | [`no-return-await`] | 🌟 | [`no-return-await`][no-return-await] | | [`no-shadowed-variable`] | 🌟 | [`no-shadow`][no-shadow] | | [`no-sparse-arrays`] | 🌟 | [`no-sparse-arrays`][no-sparse-arrays] | @@ -155,7 +155,7 @@ | [`newline-before-return`] | 🌟 | [`padding-line-between-statements`][padding-line-between-statements] [1] | | [`newline-per-chained-call`] | 🌟 | [`newline-per-chained-call`][newline-per-chained-call] | | [`new-parens`] | 🌟 | [`new-parens`][new-parens] | -| [`no-angle-bracket-type-assertion`] | ✅ | [`@typescript-eslint/no-angle-bracket-type-assertion`] | +| [`no-angle-bracket-type-assertion`] | ✅ | [`@typescript-eslint/consistent-type-assertions`] | | [`no-boolean-literal-compare`] | 🛑 | N/A | | [`no-consecutive-blank-lines`] | 🌟 | [`no-multiple-empty-lines`][no-multiple-empty-lines] | | [`no-irregular-whitespace`] | 🌟 | [`no-irregular-whitespace`][no-irregular-whitespace] with `skipStrings: false` | @@ -579,6 +579,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/await-thenable`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md [`@typescript-eslint/ban-types`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md [`@typescript-eslint/ban-ts-ignore`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-ignore.md +[`@typescript-eslint/consistent-type-assertions`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-assertions.md [`@typescript-eslint/consistent-type-definitions`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md [`@typescript-eslint/explicit-member-accessibility`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md [`@typescript-eslint/member-ordering`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-ordering.md @@ -597,7 +598,6 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/typedef`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md [`@typescript-eslint/unified-signatures`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md [`@typescript-eslint/no-misused-new`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md -[`@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 [`@typescript-eslint/no-this-alias`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-this-alias.md [`@typescript-eslint/no-extraneous-class`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extraneous-class.md [`@typescript-eslint/no-unused-vars`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -608,7 +608,6 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/array-type`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md [`@typescript-eslint/class-name-casing`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/class-name-casing.md [`@typescript-eslint/interface-name-prefix`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/interface-name-prefix.md -[`@typescript-eslint/no-angle-bracket-type-assertion`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md [`@typescript-eslint/no-parameter-properties`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md [`@typescript-eslint/member-delimiter-style`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md [`@typescript-eslint/prefer-for-of`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md new file mode 100644 index 000000000000..8e619c430ea7 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -0,0 +1,79 @@ +# Enforces consistent usage of type assertions. (consistent-type-assertions) + +## Rule Details + +This rule aims to standardise the use of type assertion style across the codebase. + +Type assertions are also commonly referred as "type casting" in TypeScript (even though it is technically slightly different to what is understood by type casting in other languages), so you can think of type assertions and type casting referring to the same thing. It is essentially you saying to the TypeScript compiler, "in this case, I know better than you!". + +## Options + +```ts +type Options = + | { + assertionStyle: 'as' | 'angle-bracket'; + objectLiteralTypeAssertions: 'allow' | 'allow-as-parameter' | 'never'; + } + | { + assertionStyle: 'never'; + }; + +const defaultOptions: Options = { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', +}; +``` + +### assertionStyle + +This option defines the expected assertion style. Valid values for `assertionStyle` are: + +- `as` will enforce that you always use `... as foo`. +- `angle-bracket` will enforce that you always use `...` +- `never` will enforce that you do not do any type assertions. + +Most code bases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with with generic syntax. + +Some codebases like to go for an extra level of type safety, and ban assertions altogether via the `never` option. + +### objectLiteralTypeAssertions + +Always prefer `const x: T = { ... };` to `const x = { ... } as T;` (or similar with angle brackets). The type assertion in the latter case is either unnecessary or will probably hide an error. + +The compiler will warn for excess properties with this syntax, but not missing _required_ fields. For example: `const x: { foo: number } = {};` will fail to compile, but `const x = {} as { foo: number }` will succeed. + +The const assertion `const x = { foo: 1 } as const`, introduced in TypeScript 3.4, is considered beneficial and is ignored by this option. + +Examples of **incorrect** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }` (and for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`) + +```ts +const x = { ... } as T; +``` + +Examples of **correct** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`. + +```ts +const x: T = { ... }; +const y = { ... } as any; +const z = { ... } as unknown; +``` + +Examples of **correct** code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`. + +```ts +const x: T = { ... }; +const y = { ... } as any; +const z = { ... } as unknown; +foo({ ... } as T); +new Clazz({ ... } as T); +function foo() { throw { bar: 5 } as Foo } +``` + +## When Not To Use It + +If you do not want to enforce consistent type assertions. + +## Compatibility + +- TSLint: [no-angle-bracket-type-assertion](https://palantir.github.io/tslint/rules/no-angle-bracket-type-assertion/) +- TSLint: [no-object-literal-type-assertion](https://palantir.github.io/tslint/rules/no-object-literal-type-assertion/) diff --git a/packages/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md b/packages/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md deleted file mode 100644 index 68cf1591a75f..000000000000 --- a/packages/eslint-plugin/docs/rules/no-angle-bracket-type-assertion.md +++ /dev/null @@ -1,32 +0,0 @@ -# Enforces the use of `as Type` assertions instead of `` assertions (no-angle-bracket-type-assertion) - -TypeScript disallows the use of `` assertions in `.tsx` because of the similarity with -JSX's syntax, which makes it impossible to parse. - -## Rule Details - -This rule aims to standardise the use of type assertion style across the codebase - -The following patterns are considered warnings: - -```ts -const foo = bar; -``` - -The following patterns are not warnings: - -```ts -const foo = bar as Foo; -``` - -## When Not To Use It - -If your codebase does not include `.tsx` files, then you will not need this rule. - -## Further Reading - -- [Typescript and JSX](https://www.typescriptlang.org/docs/handbook/jsx.html) - -## Compatibility - -- TSLint: [no-angle-bracket-type-assertion](https://palantir.github.io/tslint/rules/no-angle-bracket-type-assertion/) diff --git a/packages/eslint-plugin/docs/rules/no-object-literal-type-assertion.md b/packages/eslint-plugin/docs/rules/no-object-literal-type-assertion.md deleted file mode 100644 index 044c68aa57fd..000000000000 --- a/packages/eslint-plugin/docs/rules/no-object-literal-type-assertion.md +++ /dev/null @@ -1,33 +0,0 @@ -# Forbids an object literal to appear in a type assertion expression (no-object-literal-type-assertion) - -Always prefer `const x: T = { ... };` to `const x = { ... } as T;`. Casting to `any` and `unknown` is still allowed, and const assertions (`as const`) are still allowed. - -## Rule Details - -Examples of **incorrect** code for this rule. - -```ts -const x = { ... } as T; -``` - -Examples of **correct** code for this rule. - -```ts -const x: T = { ... }; -const y = { ... } as any; -const z = { ... } as unknown; -``` - -## Options - -```cjson -{ - "@typescript-eslint/no-object-literal-type-assertion": ["error", { - allowAsParameter: false // Allow type assertion in call and new expression, default false - }] -} -``` - -## Compatibility - -- TSLint: [no-object-literal-type-assertion](https://palantir.github.io/tslint/rules/no-object-literal-type-assertion/) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index dac2e6b3f6b2..00bdf366600a 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -9,6 +9,7 @@ "camelcase": "off", "@typescript-eslint/camelcase": "error", "@typescript-eslint/class-name-casing": "error", + "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/consistent-type-definitions": "error", "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/explicit-member-accessibility": "error", @@ -21,7 +22,6 @@ "@typescript-eslint/member-delimiter-style": "error", "@typescript-eslint/member-naming": "error", "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/no-angle-bracket-type-assertion": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-empty-function": "error", @@ -39,7 +39,6 @@ "@typescript-eslint/no-misused-promises": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-object-literal-type-assertion": "error", "@typescript-eslint/no-parameter-properties": "error", "@typescript-eslint/no-require-imports": "error", "@typescript-eslint/no-this-alias": "error", diff --git a/packages/eslint-plugin/src/configs/base.json b/packages/eslint-plugin/src/configs/base.json index 9b6931ad616d..6f56100a6ae7 100644 --- a/packages/eslint-plugin/src/configs/base.json +++ b/packages/eslint-plugin/src/configs/base.json @@ -3,5 +3,7 @@ "parserOptions": { "sourceType": "module" }, - "plugins": ["@typescript-eslint"] + "plugins": [ + "@typescript-eslint" + ] } diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 471d3df02a94..121b85bf17a6 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -11,13 +11,13 @@ "camelcase": "off", "@typescript-eslint/camelcase": "error", "@typescript-eslint/class-name-casing": "error", + "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/explicit-function-return-type": "warn", "@typescript-eslint/explicit-member-accessibility": "error", "indent": "off", "@typescript-eslint/indent": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-delimiter-style": "error", - "@typescript-eslint/no-angle-bracket-type-assertion": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", "@typescript-eslint/no-empty-interface": "error", @@ -26,7 +26,6 @@ "@typescript-eslint/no-misused-new": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-object-literal-type-assertion": "error", "@typescript-eslint/no-parameter-properties": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "warn", diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts new file mode 100644 index 000000000000..6380f9f00035 --- /dev/null +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -0,0 +1,158 @@ +import * as util from '../util'; +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; + +// intentionally mirroring the options +type MessageIds = + | 'as' + | 'angle-bracket' + | 'never' + | 'unexpectedObjectTypeAssertion'; +// https://github.com/prettier/prettier/issues/4794 +type OptUnion = + | { + assertionStyle: 'as' | 'angle-bracket'; + objectLiteralTypeAssertions?: 'allow' | 'allow-as-parameter' | 'never'; + } + | { + assertionStyle: 'never'; + }; +type Options = [OptUnion]; + +export default util.createRule({ + name: 'consistent-type-assertions', + meta: { + type: 'suggestion', + docs: { + category: 'Best Practices', + description: 'Enforces consistent usage of type assertions.', + recommended: 'error', + }, + messages: { + as: "Use 'as {{cast}}' instead of '<{{cast}}>'.", + 'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.", + never: 'Do not use any type assertions.', + unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.', + }, + schema: [ + { + oneOf: [ + { + type: 'object', + properties: { + assertionStyle: { + enum: ['never'], + }, + }, + additionalProperties: false, + required: ['assertionStyle'], + }, + { + type: 'object', + properties: { + assertionStyle: { + enum: ['as', 'angle-bracket'], + }, + objectLiteralTypeAssertions: { + enum: ['allow', 'allow-as-parameter', 'never'], + }, + }, + additionalProperties: false, + required: ['assertionStyle'], + }, + ], + }, + ], + }, + defaultOptions: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], + create(context, [options]) { + const sourceCode = context.getSourceCode(); + + function reportIncorrectAssertionType( + node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression, + ) { + const messageId = options.assertionStyle; + context.report({ + node, + messageId, + data: + messageId !== 'never' + ? { cast: sourceCode.getText(node.typeAnnotation) } + : {}, + }); + } + + function checkType(node: TSESTree.TypeNode) { + switch (node.type) { + case AST_NODE_TYPES.TSAnyKeyword: + case AST_NODE_TYPES.TSUnknownKeyword: + return false; + case AST_NODE_TYPES.TSTypeReference: + // Ignore `as const` and `` + return ( + node.typeName.type === AST_NODE_TYPES.Identifier && + node.typeName.name !== 'const' + ); + default: + return true; + } + } + + function checkExpression( + node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression, + ) { + if ( + options.assertionStyle === 'never' || + options.objectLiteralTypeAssertions === 'allow' || + node.expression.type !== AST_NODE_TYPES.ObjectExpression + ) { + return; + } + if ( + options.objectLiteralTypeAssertions === 'allow-as-parameter' && + node.parent && + (node.parent.type === AST_NODE_TYPES.NewExpression || + node.parent.type === AST_NODE_TYPES.CallExpression || + node.parent.type === AST_NODE_TYPES.ThrowStatement) + ) { + return; + } + + if ( + checkType(node.typeAnnotation) && + node.expression.type === AST_NODE_TYPES.ObjectExpression + ) { + context.report({ + node, + messageId: 'unexpectedObjectTypeAssertion', + }); + } + } + + return { + TSTypeAssertion(node) { + if (options.assertionStyle !== 'angle-bracket') { + reportIncorrectAssertionType(node); + return; + } + + checkExpression(node); + }, + TSAsExpression(node) { + if (options.assertionStyle !== 'as') { + reportIncorrectAssertionType(node); + return; + } + + checkExpression(node); + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 1d1bc59a846b..3f10d73426ed 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -5,6 +5,7 @@ import banTsIgnore from './ban-ts-ignore'; import banTypes from './ban-types'; import camelcase from './camelcase'; import classNameCasing from './class-name-casing'; +import consistentTypeAssertions from './consistent-type-assertions'; import consistentTypeDefinitions from './consistent-type-definitions'; import explicitFunctionReturnType from './explicit-function-return-type'; import explicitMemberAccessibility from './explicit-member-accessibility'; @@ -15,7 +16,6 @@ import interfaceNamePrefix from './interface-name-prefix'; import memberDelimiterStyle from './member-delimiter-style'; import memberNaming from './member-naming'; import memberOrdering from './member-ordering'; -import noAngleBracketTypeAssertion from './no-angle-bracket-type-assertion'; import noArrayConstructor from './no-array-constructor'; import noEmptyFunction from './no-empty-function'; import noEmptyInterface from './no-empty-interface'; @@ -30,7 +30,6 @@ import noMisusedNew from './no-misused-new'; import noMisusedPromises from './no-misused-promises'; import noNamespace from './no-namespace'; import noNonNullAssertion from './no-non-null-assertion'; -import noObjectLiteralTypeAssertion from './no-object-literal-type-assertion'; import noParameterProperties from './no-parameter-properties'; import noRequireImports from './no-require-imports'; import noThisAlias from './no-this-alias'; @@ -68,6 +67,7 @@ export default { 'ban-types': banTypes, camelcase: camelcase, 'class-name-casing': classNameCasing, + 'consistent-type-assertions': consistentTypeAssertions, 'consistent-type-definitions': consistentTypeDefinitions, 'explicit-function-return-type': explicitFunctionReturnType, 'explicit-member-accessibility': explicitMemberAccessibility, @@ -78,7 +78,6 @@ export default { 'member-delimiter-style': memberDelimiterStyle, 'member-naming': memberNaming, 'member-ordering': memberOrdering, - 'no-angle-bracket-type-assertion': noAngleBracketTypeAssertion, 'no-array-constructor': noArrayConstructor, 'no-empty-function': noEmptyFunction, 'no-empty-interface': noEmptyInterface, @@ -93,7 +92,6 @@ export default { 'no-misused-promises': noMisusedPromises, 'no-namespace': noNamespace, 'no-non-null-assertion': noNonNullAssertion, - 'no-object-literal-type-assertion': noObjectLiteralTypeAssertion, 'no-parameter-properties': noParameterProperties, 'no-require-imports': noRequireImports, 'no-this-alias': noThisAlias, diff --git a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts b/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts deleted file mode 100644 index 82848a07196f..000000000000 --- a/packages/eslint-plugin/src/rules/no-angle-bracket-type-assertion.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as util from '../util'; - -export default util.createRule({ - name: 'no-angle-bracket-type-assertion', - meta: { - type: 'problem', - docs: { - description: - 'Enforces the use of `as Type` assertions instead of `` assertions', - category: 'Stylistic Issues', - recommended: 'error', - }, - messages: { - preferAs: - "Prefer 'as {{cast}}' instead of '<{{cast}}>' when doing type assertions.", - }, - schema: [], - }, - defaultOptions: [], - create(context) { - const sourceCode = context.getSourceCode(); - return { - TSTypeAssertion(node) { - context.report({ - node, - messageId: 'preferAs', - data: { - cast: sourceCode.getText(node.typeAnnotation), - }, - }); - }, - }; - }, -}); diff --git a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts b/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts deleted file mode 100644 index f40896553370..000000000000 --- a/packages/eslint-plugin/src/rules/no-object-literal-type-assertion.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { - AST_NODE_TYPES, - TSESTree, -} from '@typescript-eslint/experimental-utils'; -import * as util from '../util'; - -type Options = [ - { - allowAsParameter?: boolean; - } -]; -type MessageIds = 'unexpectedTypeAssertion'; - -export default util.createRule({ - name: 'no-object-literal-type-assertion', - meta: { - type: 'problem', - docs: { - description: - 'Forbids an object literal to appear in a type assertion expression', - category: 'Stylistic Issues', - recommended: 'error', - }, - messages: { - unexpectedTypeAssertion: - 'Type assertion on object literals is forbidden, use a type annotation instead.', - }, - schema: [ - { - type: 'object', - additionalProperties: false, - properties: { - allowAsParameter: { - type: 'boolean', - }, - }, - }, - ], - }, - defaultOptions: [ - { - allowAsParameter: false, - }, - ], - create(context, [{ allowAsParameter }]) { - /** - * Check whatever node should be reported - * @param node the node to be evaluated. - */ - function checkType(node: TSESTree.TypeNode): boolean { - switch (node.type) { - case AST_NODE_TYPES.TSAnyKeyword: - case AST_NODE_TYPES.TSUnknownKeyword: - return false; - case AST_NODE_TYPES.TSTypeReference: - // Ignore `as const` and `` (#166) - return ( - node.typeName.type === AST_NODE_TYPES.Identifier && - node.typeName.name !== 'const' - ); - default: - return true; - } - } - - return { - 'TSTypeAssertion, TSAsExpression'( - node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression, - ) { - if ( - allowAsParameter && - node.parent && - (node.parent.type === AST_NODE_TYPES.NewExpression || - node.parent.type === AST_NODE_TYPES.CallExpression) - ) { - return; - } - - if ( - checkType(node.typeAnnotation) && - node.expression.type === AST_NODE_TYPES.ObjectExpression - ) { - context.report({ - node, - messageId: 'unexpectedTypeAssertion', - }); - } - }, - }; - }, -}); diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts new file mode 100644 index 000000000000..b631fdda9d4a --- /dev/null +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -0,0 +1,302 @@ +import rule from '../../src/rules/consistent-type-assertions'; +import { RuleTester, batchedSingleLineTests } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +const ANGLE_BRACKET_TESTS = ` +const x = new Generic(); +const x = b; +const x = [1]; +const x = [1]; +const x = ('string'); +`; +const AS_TESTS = ` +const x = new Generic() as Foo; +const x = b as A; +const x = [1] as readonly number[]; +const x = [1] as const; +const x = ('string') as a | b; +`; +const OBJECT_LITERAL_AS_CASTS = ` +const x = {} as Foo; +`; +const OBJECT_LITERAL_ANGLE_BRACKET_CASTS = ` +const x = >{}; +`; +const OBJECT_LITERAL_ARGUMENT_AS_CASTS = ` +print({ bar: 5 } as Foo) +new print({ bar: 5 } as Foo) +function foo() { throw { bar: 5 } as Foo } +`; +const OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS = ` +print({ bar: 5 }) +new print({ bar: 5 }) +function foo() { throw { bar: 5 } } +`; + +ruleTester.run('consistent-type-assertions', rule, { + valid: [ + ...batchedSingleLineTests({ + code: AS_TESTS, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], + }), + ...batchedSingleLineTests({ + code: ANGLE_BRACKET_TESTS, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }), + ...batchedSingleLineTests({ + code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', + }, + ], + }), + ...batchedSingleLineTests({ + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }), + ...batchedSingleLineTests({ + code: OBJECT_LITERAL_ARGUMENT_AS_CASTS, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }), + ...batchedSingleLineTests({ + code: OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }), + ], + invalid: [ + ...batchedSingleLineTests({ + code: AS_TESTS, + options: [ + { + assertionStyle: 'angle-bracket', + }, + ], + errors: [ + { + messageId: 'angle-bracket', + line: 2, + }, + { + messageId: 'angle-bracket', + line: 3, + }, + { + messageId: 'angle-bracket', + line: 4, + }, + { + messageId: 'angle-bracket', + line: 5, + }, + { + messageId: 'angle-bracket', + line: 6, + }, + ], + }), + ...batchedSingleLineTests({ + code: ANGLE_BRACKET_TESTS, + options: [ + { + assertionStyle: 'as', + }, + ], + errors: [ + { + messageId: 'as', + line: 2, + }, + { + messageId: 'as', + line: 3, + }, + { + messageId: 'as', + line: 4, + }, + { + messageId: 'as', + line: 5, + }, + { + messageId: 'as', + line: 6, + }, + ], + }), + ...batchedSingleLineTests({ + code: AS_TESTS, + options: [ + { + assertionStyle: 'never', + }, + ], + errors: [ + { + messageId: 'never', + line: 2, + }, + { + messageId: 'never', + line: 3, + }, + { + messageId: 'never', + line: 4, + }, + { + messageId: 'never', + line: 5, + }, + { + messageId: 'never', + line: 6, + }, + ], + }), + ...batchedSingleLineTests({ + code: ANGLE_BRACKET_TESTS, + options: [ + { + assertionStyle: 'never', + }, + ], + errors: [ + { + messageId: 'never', + line: 2, + }, + { + messageId: 'never', + line: 3, + }, + { + messageId: 'never', + line: 4, + }, + { + messageId: 'never', + line: 5, + }, + { + messageId: 'never', + line: 6, + }, + ], + }), + ...batchedSingleLineTests({ + code: OBJECT_LITERAL_AS_CASTS, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + errors: [ + { + messageId: 'unexpectedObjectTypeAssertion', + line: 2, + }, + ], + }), + ...batchedSingleLineTests({ + code: OBJECT_LITERAL_ANGLE_BRACKET_CASTS, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + errors: [ + { + messageId: 'unexpectedObjectTypeAssertion', + line: 2, + }, + ], + }), + ...batchedSingleLineTests({ + code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'never', + }, + ], + errors: [ + { + messageId: 'unexpectedObjectTypeAssertion', + line: 2, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 3, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 4, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 5, + }, + ], + }), + ...batchedSingleLineTests({ + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + errors: [ + { + messageId: 'unexpectedObjectTypeAssertion', + line: 2, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 3, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 4, + }, + { + messageId: 'unexpectedObjectTypeAssertion', + line: 5, + }, + ], + }), + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-angle-bracket-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-angle-bracket-type-assertion.test.ts deleted file mode 100644 index 1d8bd4b23212..000000000000 --- a/packages/eslint-plugin/tests/rules/no-angle-bracket-type-assertion.test.ts +++ /dev/null @@ -1,164 +0,0 @@ -import rule from '../../src/rules/no-angle-bracket-type-assertion'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('no-angle-bracket-type-assertion', rule, { - valid: [ - ` -interface Foo { - bar : number; - bas : string; -} - -class Generic implements Foo {} - -const foo = {} as Foo; -const bar = new Generic() as Foo; - `, - 'const array : Array = [];', - ` -class A {} -class B extends A {} - -const b : B = new B(); -const a : A = b as A; - `, - ` -type A = { - num: number -}; - -const b = { - num: 5 -}; - -const a: A = b as A; - `, - 'const a : number = 5 as number', - ` -const a : number = 5; -const b : number = a as number; - `, - 'const a : Array = [1] as Array;', - ], - invalid: [ - { - code: ` -interface Foo { - bar : number; - bas : string; -} - -class Generic implements Foo {} - -const foo = {}; -const bar = new Generic(); - `, - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'Foo', - }, - line: 9, - column: 13, - }, - { - messageId: 'preferAs', - data: { - cast: 'Foo', - }, - line: 10, - column: 13, - }, - ], - }, - { - code: 'const a : number = 5', - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'number', - }, - line: 1, - column: 20, - }, - ], - }, - { - code: ` -const a : number = 5; -const b : number = a; - `, - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'number', - }, - line: 3, - column: 20, - }, - ], - }, - { - code: 'const a : Array = >[1];', - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'Array', - }, - line: 1, - column: 27, - }, - ], - }, - { - code: ` -class A {} -class B extends A {} - -const b : B = new B(); -const a : A = b; - `, - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'A', - }, - line: 6, - column: 15, - }, - ], - }, - { - code: ` -type A = { - num: number -}; - -const b = { - num: 5 -}; - -const a: A = b; - `, - errors: [ - { - messageId: 'preferAs', - data: { - cast: 'A', - }, - line: 10, - column: 14, - }, - ], - }, - ], -}); diff --git a/packages/eslint-plugin/tests/rules/no-object-literal-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-object-literal-type-assertion.test.ts deleted file mode 100644 index 336df4c29a1b..000000000000 --- a/packages/eslint-plugin/tests/rules/no-object-literal-type-assertion.test.ts +++ /dev/null @@ -1,100 +0,0 @@ -import rule from '../../src/rules/no-object-literal-type-assertion'; -import { RuleTester } from '../RuleTester'; - -const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 6, - sourceType: 'module', - ecmaFeatures: { - jsx: false, - }, - }, -}); - -ruleTester.run('no-object-literal-type-assertion', rule, { - valid: [ - ` x;`, - `x as T;`, - `const foo = bar;`, - `const foo: baz = bar;`, - `const x: T = {};`, - `const foo = { bar: { } };`, - // Allow cast to 'any' - `const foo = {} as any;`, - `const foo = {};`, - // Allow cast to 'unknown' - `const foo = {} as unknown;`, - `const foo = {};`, - `const foo = {} as const;`, - `const foo = {};`, - { - code: `print({ bar: 5 } as Foo)`, - options: [ - { - allowAsParameter: true, - }, - ], - }, - { - code: `new print({ bar: 5 } as Foo)`, - options: [ - { - allowAsParameter: true, - }, - ], - }, - ], - invalid: [ - { - code: ` ({});`, - errors: [ - { - messageId: 'unexpectedTypeAssertion', - line: 1, - column: 1, - }, - ], - }, - { - code: `({}) as T;`, - errors: [ - { - messageId: 'unexpectedTypeAssertion', - line: 1, - column: 1, - }, - ], - }, - { - code: `const x = {} as T;`, - errors: [ - { - messageId: 'unexpectedTypeAssertion', - line: 1, - column: 11, - }, - ], - }, - { - code: `print({ bar: 5 } as Foo)`, - errors: [ - { - messageId: 'unexpectedTypeAssertion', - line: 1, - column: 7, - }, - ], - }, - { - code: `new print({ bar: 5 } as Foo)`, - errors: [ - { - messageId: 'unexpectedTypeAssertion', - line: 1, - column: 11, - }, - ], - }, - ], -}); diff --git a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts index 0812adade321..567378fdd5dd 100644 --- a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts +++ b/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts @@ -36,6 +36,10 @@ function batchedSingleLineTests< ): (ValidTestCase | InvalidTestCase)[] { // eslint counts lines from 1 const lineOffset = options.code[0] === '\n' ? 2 : 1; + const output = + 'output' in options && options.output + ? options.output.trim().split('\n') + : null; return options.code .trim() .split('\n') @@ -45,7 +49,7 @@ function batchedSingleLineTests< 'errors' in options ? options.errors.filter(e => e.line === lineNum) : []; - return { + const returnVal = { ...options, code, errors: errors.map(e => ({ @@ -53,6 +57,13 @@ function batchedSingleLineTests< line: 1, })), }; + if (output && output[i]) { + return { + ...returnVal, + output: output[i], + }; + } + return returnVal; }); } diff --git a/packages/typescript-estree/src/ts-estree/ts-estree.ts b/packages/typescript-estree/src/ts-estree/ts-estree.ts index 8eed48390d0f..f079fd68d471 100644 --- a/packages/typescript-estree/src/ts-estree/ts-estree.ts +++ b/packages/typescript-estree/src/ts-estree/ts-estree.ts @@ -1312,7 +1312,7 @@ export interface TSTypeAnnotation extends BaseNode { export interface TSTypeAssertion extends BaseNode { type: AST_NODE_TYPES.TSTypeAssertion; typeAnnotation: TypeNode; - expression: UnaryExpression; + expression: Expression; } export interface TSTypeLiteral extends BaseNode { From 55e788c818d022f6b4cd9e00ef69882d78daaa21 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 24 Jul 2019 17:34:25 -0700 Subject: [PATCH 17/38] fix(eslint-plugin): [no-useless-constructor] handle bodyless constructor (#685) --- packages/eslint-plugin/src/rules/no-useless-constructor.ts | 1 + .../eslint-plugin/tests/rules/no-useless-constructor.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index e6b48a055ed1..6410fa5fa435 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -63,6 +63,7 @@ export default util.createRule({ if ( node.value && node.value.type === AST_NODE_TYPES.FunctionExpression && + node.value.body && checkAccessibility(node) && checkParams(node) ) { diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts index ab84faa5c664..18446ad64707 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -50,6 +50,8 @@ ruleTester.run('no-useless-constructor', rule, { 'class A extends B { private constructor(foo, bar) { super(bar); } }', 'class A extends B { public constructor(foo){ super(foo); } }', 'class A extends B { public constructor(foo){} }', + // type definition / overload + 'class A { constructor(foo); }', ], invalid: [ { From 2b942ba35ebfb1db7375da564d758e79acab2028 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 24 Jul 2019 21:01:37 -0400 Subject: [PATCH 18/38] feat(eslint-plugin): added new rule use-default-type-parameter (#562) --- packages/eslint-plugin/README.md | 1 + packages/eslint-plugin/ROADMAP.md | 3 +- .../rules/no-unnecessary-type-arguments.md | 53 ++++++ packages/eslint-plugin/src/configs/all.json | 1 + .../indent-new-do-not-use/BinarySearchTree.ts | 2 +- packages/eslint-plugin/src/rules/index.ts | 6 +- .../rules/no-unnecessary-type-arguments.ts | 159 ++++++++++++++++++ packages/eslint-plugin/src/util/misc.ts | 14 ++ .../no-unnecessary-type-arguments.test.ts | 126 ++++++++++++++ 9 files changed, 361 insertions(+), 4 deletions(-) create mode 100644 packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md create mode 100644 packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts create mode 100644 packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index f33823200e72..05916fa1cbdf 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -160,6 +160,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | | | | | [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | | [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Warns if an explicitly specified type argument is the default for that type parameter | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | | [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | :heavy_check_mark: | | | diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index cdad2d46f1b6..58580935012b 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -99,7 +99,7 @@ | [`triple-equals`] | 🌟 | [`eqeqeq`][eqeqeq] | | [`typeof-compare`] | 🌟 | [`valid-typeof`][valid-typeof] | | [`unnecessary-constructor`] | 🌟 | [`no-useless-constructor`][no-useless-constructor] | -| [`use-default-type-parameter`] | 🛑 | N/A | +| [`use-default-type-parameter`] | ✅ | [`@typescript-eslint/no-unnecessary-type-arguments`] | | [`use-isnan`] | 🌟 | [`use-isnan`][use-isnan] | [1] The ESLint rule also supports silencing with an extra set of parens (`if ((foo = bar)) {}`)
@@ -617,6 +617,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/require-await`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md [`@typescript-eslint/no-for-in-array`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md [`@typescript-eslint/no-unnecessary-qualifier`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +[`@typescript-eslint/no-unnecessary-type-arguments`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md [`@typescript-eslint/semi`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md [`@typescript-eslint/no-floating-promises`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md new file mode 100644 index 000000000000..35fb14c54687 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -0,0 +1,53 @@ +# Enforces that types will not to be used (no-unnecessary-type-arguments) + +Warns if an explicitly specified type argument is the default for that type parameter. + +## Rule Details + +Type parameters in TypeScript may specify a default value. +For example: + +```ts +function f() {} +``` + +It is redundant to provide an explicit type parameter equal to that default. + +Examples of **incorrect** code for this rule: + +```ts +function f() {} +f(); + +function g() {} +g(); + +class C {} +function h(c: C) {} +new C(); +class D extends C {} + +interface I {} +class Impl implements I {} +``` + +Examples of **correct** code for this rule: + +```ts +function f() {} +f(); + +function g() {} +g(); + +class C {} +new C(); +class D extends C {} + +interface I {} +class Impl implements I {} +``` + +## Related to + +- TSLint: [use-default-type-parameter](https://palantir.github.io/tslint/rules/use-default-type-parameter) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 00bdf366600a..0c17ccb04266 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -44,6 +44,7 @@ "@typescript-eslint/no-this-alias": "error", "@typescript-eslint/no-type-alias": "error", "@typescript-eslint/no-unnecessary-qualifier": "error", + "@typescript-eslint/no-unnecessary-type-arguments": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts index e530efb40991..0010750ebfd8 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts @@ -17,7 +17,7 @@ export interface TreeValue { * can easily be swapped out. */ export class BinarySearchTree { - private rbTree = createTree(); + private rbTree = createTree(); /** * Inserts an entry into the tree. diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 3f10d73426ed..db155e691bfa 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -58,6 +58,7 @@ import typeAnnotationSpacing from './type-annotation-spacing'; import typedef from './typedef'; import unboundMethod from './unbound-method'; import unifiedSignatures from './unified-signatures'; +import useDefaultTypeParameter from './no-unnecessary-type-arguments'; export default { 'adjacent-overload-signatures': adjacentOverloadSignatures, @@ -97,6 +98,7 @@ export default { 'no-this-alias': noThisAlias, 'no-type-alias': noTypeAlias, 'no-unnecessary-qualifier': noUnnecessaryQualifier, + 'no-unnecessary-type-arguments': useDefaultTypeParameter, 'no-unnecessary-type-assertion': noUnnecessaryTypeAssertion, 'no-unused-vars': noUnusedVars, 'no-use-before-define': noUseBeforeDefine, @@ -113,11 +115,11 @@ export default { 'require-array-sort-compare': requireArraySortCompare, 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, + semi: semi, 'strict-boolean-expressions': strictBooleanExpressions, 'triple-slash-reference': tripleSlashReference, 'type-annotation-spacing': typeAnnotationSpacing, + typedef: typedef, 'unbound-method': unboundMethod, 'unified-signatures': unifiedSignatures, - semi: semi, - typedef: typedef, }; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts new file mode 100644 index 000000000000..39f506cd9eee --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -0,0 +1,159 @@ +import { TSESTree } from '@typescript-eslint/experimental-utils'; +import * as tsutils from 'tsutils'; +import ts from 'typescript'; +import * as util from '../util'; +import { findFirstResult } from '../util'; + +interface ArgsAndParams { + typeArguments: ts.NodeArray; + typeParameters: readonly ts.TypeParameterDeclaration[]; +} + +type ExtendingClassLikeDeclaration = ts.ClassLikeDeclaration & { + heritageClauses: ts.NodeArray; +}; + +type ParameterCapableTSNode = + | ts.CallExpression + | ts.NewExpression + | ts.TypeReferenceNode + | ts.ExpressionWithTypeArguments; + +type MessageIds = 'unnecessaryTypeParameter'; + +export default util.createRule<[], MessageIds>({ + name: 'no-unnecessary-type-arguments', + meta: { + docs: { + description: + 'Warns if an explicitly specified type argument is the default for that type parameter', + category: 'Best Practices', + recommended: false, + }, + fixable: 'code', + messages: { + unnecessaryTypeParameter: + 'This is the default value for this type parameter, so it can be omitted.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + + function checkTSArgsAndParameters( + esParameters: TSESTree.TSTypeParameterInstantiation, + { typeArguments, typeParameters }: ArgsAndParams, + ): void { + // Just check the last one. Must specify previous type parameters if the last one is specified. + const i = typeArguments.length - 1; + const arg = typeArguments[i]; + const param = typeParameters[i]; + + // TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502 + if ( + param.default === undefined || + param.default.getText() !== arg.getText() + ) { + return; + } + + context.report({ + fix: fixer => + fixer.removeRange( + i === 0 + ? [typeArguments.pos - 1, typeArguments.end + 1] + : [typeArguments[i - 1].end, arg.end], + ), + messageId: 'unnecessaryTypeParameter', + node: esParameters!.params[i], + }); + } + + return { + TSTypeParameterInstantiation(node) { + const parentDeclaration = parserServices.esTreeNodeToTSNodeMap.get( + node.parent!, + ) as ExtendingClassLikeDeclaration | ParameterCapableTSNode; + + const expression = tsutils.isClassLikeDeclaration(parentDeclaration) + ? parentDeclaration.heritageClauses[0].types[0] + : parentDeclaration; + + const argsAndParams = getArgsAndParameters(expression, checker); + if (argsAndParams !== undefined) { + checkTSArgsAndParameters(node, argsAndParams); + } + }, + }; + }, +}); + +function getArgsAndParameters( + node: ParameterCapableTSNode, + checker: ts.TypeChecker, +): ArgsAndParams | undefined { + const typeParameters = getTypeParametersFromNode(node, checker); + return typeParameters === undefined + ? undefined + : { typeArguments: node.typeArguments!, typeParameters }; +} + +function getTypeParametersFromNode( + node: ParameterCapableTSNode, + checker: ts.TypeChecker, +) { + if (ts.isExpressionWithTypeArguments(node)) { + return getTypeParametersFromType(node.expression, checker); + } + + if (ts.isTypeReferenceNode(node)) { + return getTypeParametersFromType(node.typeName, checker); + } + + return getTypeParametersFromCall(node, checker); +} + +function getTypeParametersFromType( + type: ts.EntityName | ts.Expression | ts.ClassDeclaration, + checker: ts.TypeChecker, +): readonly ts.TypeParameterDeclaration[] | undefined { + const sym = getAliasedSymbol(checker.getSymbolAtLocation(type)!, checker); + if (sym === undefined || sym.declarations === undefined) { + return undefined; + } + + return findFirstResult(sym.declarations, decl => + tsutils.isClassLikeDeclaration(decl) || + ts.isTypeAliasDeclaration(decl) || + ts.isInterfaceDeclaration(decl) + ? decl.typeParameters + : undefined, + ); +} + +function getTypeParametersFromCall( + node: ts.CallExpression | ts.NewExpression, + checker: ts.TypeChecker, +): readonly ts.TypeParameterDeclaration[] | undefined { + const sig = checker.getResolvedSignature(node); + const sigDecl = sig === undefined ? undefined : sig.getDeclaration(); + if (sigDecl === undefined) { + return ts.isNewExpression(node) + ? getTypeParametersFromType(node.expression, checker) + : undefined; + } + + return sigDecl.typeParameters; +} + +function getAliasedSymbol( + symbol: ts.Symbol, + checker: ts.TypeChecker, +): ts.Symbol | undefined { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; +} diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 3c88d766fe99..050438d3843b 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -77,6 +77,20 @@ export function arraysAreEqual( ); } +/** Returns the first non-`undefined` result. */ +export function findFirstResult( + inputs: T[], + getResult: (t: T) => U | undefined, +): U | undefined { + for (const element of inputs) { + const result = getResult(element); + if (result !== undefined) { + return result; + } + } + return undefined; +} + /** * Gets a string name representation of the name of the given MethodDefinition * or ClassProperty node, with handling for computed property names. diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts new file mode 100644 index 000000000000..d6ea679f8237 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -0,0 +1,126 @@ +import path from 'path'; +import rule from '../../src/rules/no-unnecessary-type-arguments'; +import { RuleTester } from '../RuleTester'; + +const rootDir = path.join(process.cwd(), 'tests/fixtures'); +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 2015, + tsconfigRootDir: rootDir, + project: './tsconfig.json', + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-unnecessary-type-arguments', rule, { + valid: [ + `function f() { } + f();`, + `function f() { } + f();`, + `declare const f: any; + f();`, + `declare const f: any; + f();`, + `declare const f: unknown; + f();`, + `declare const f: unknown; + f();`, + `function g() { } + g();`, + `declare const g: any; + g();`, + `declare const g: unknown; + g();`, + `class C { } + new C();`, + `declare const C: any; + new C();`, + `declare const C: unknown; + new C();`, + `class C { } + class D extends C { }`, + `declare const C: any; + class D extends C { }`, + `declare const C: unknown; + class D extends C { }`, + `interface I { } + class Impl implements I { }`, + `class C { } + class D extends C { }`, + `declare const C: any; + class D extends C { }`, + `declare const C: unknown; + class D extends C { }`, + ], + invalid: [ + { + code: `function f() { } + f();`, + errors: [ + { + column: 11, + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `function f() { } + f();`, + }, + { + code: `function g() { } + g();`, + errors: [ + { + column: 19, + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `function g() { } + g();`, + }, + { + code: `class C { } + function h(c: C) { }`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `class C { } + function h(c: C) { }`, + }, + { + code: `class C { } + new C();`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `class C { } + new C();`, + }, + { + code: `class C { } + class D extends C { }`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `class C { } + class D extends C { }`, + }, + { + code: `interface I { } + class Impl implements I { }`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `interface I { } + class Impl implements I { }`, + }, + ], +}); From 211b1b5ae9f3e7d54b98b0522a80194f7c803a69 Mon Sep 17 00:00:00 2001 From: Eran Shabi Date: Thu, 25 Jul 2019 18:34:31 +0300 Subject: [PATCH 19/38] =?UTF-8?q?fix(eslint-plugin):=20[prefer-readonly]?= =?UTF-8?q?=20TypeError=20when=20having=20comp=E2=80=A6=20(#761)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/eslint-plugin/src/rules/prefer-readonly.ts | 2 +- packages/eslint-plugin/tests/rules/prefer-readonly.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index c82aaf45ab34..451515d18ed1 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -179,7 +179,7 @@ export default util.createRule({ const tsNode = parserServices.esTreeNodeToTSNodeMap.get< ts.PropertyAccessExpression >(node); - if (classScopeStack.length !== 0) { + if (classScopeStack.length !== 0 && !node.computed) { handlePropertyAccessExpression( tsNode, tsNode.parent, diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts index a5ff4734e1c5..5b2a6687339a 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts @@ -215,6 +215,11 @@ ruleTester.run('prefer-readonly', rule, { }, ], }, + `class TestComputedParameter { + public mutate() { + this['computed'] = 1; + } + }`, ], invalid: [ { From 4496288266ed98b6068332ce2230c251d11b8e83 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 25 Jul 2019 09:04:29 -0700 Subject: [PATCH 20/38] chore: tighter linting (#535) --- .eslintrc.js | 181 + .eslintrc.json | 73 - package.json | 43 +- packages/eslint-plugin-tslint/package.json | 3 +- .../eslint-plugin-tslint/src/custom-linter.ts | 2 + .../eslint-plugin-tslint/src/rules/config.ts | 11 +- .../docs/rules/generic-type-naming.md | 2 +- packages/eslint-plugin/package.json | 7 +- .../eslint-plugin/src/rules/array-type.ts | 2 +- packages/eslint-plugin/src/rules/ban-types.ts | 5 +- packages/eslint-plugin/src/rules/camelcase.ts | 9 +- .../rules/explicit-function-return-type.ts | 2 +- .../src/rules/func-call-spacing.ts | 2 +- .../src/rules/indent-new-do-not-use/index.ts | 24 +- packages/eslint-plugin/src/rules/indent.ts | 1 + .../src/rules/member-delimiter-style.ts | 15 +- .../src/rules/member-ordering.ts | 6 +- .../src/rules/no-empty-interface.ts | 2 +- .../src/rules/no-explicit-any.ts | 2 +- .../src/rules/no-extra-parens.ts | 3 + .../src/rules/no-extraneous-class.ts | 2 +- .../src/rules/no-floating-promises.ts | 6 +- .../src/rules/no-inferrable-types.ts | 2 +- .../src/rules/no-magic-numbers.ts | 5 +- .../src/rules/no-misused-promises.ts | 2 +- .../eslint-plugin/src/rules/no-namespace.ts | 2 +- .../src/rules/no-parameter-properties.ts | 4 +- .../eslint-plugin/src/rules/no-this-alias.ts | 2 +- .../eslint-plugin/src/rules/no-type-alias.ts | 10 +- .../rules/no-unnecessary-type-arguments.ts | 8 +- .../rules/no-unnecessary-type-assertion.ts | 6 +- .../src/rules/no-use-before-define.ts | 4 +- .../src/rules/prefer-readonly.ts | 2 +- .../src/rules/prefer-regexp-exec.ts | 2 +- .../rules/prefer-string-starts-ends-with.ts | 5 +- .../src/rules/promise-function-async.ts | 2 +- .../src/rules/strict-boolean-expressions.ts | 2 +- .../src/rules/triple-slash-reference.ts | 2 +- .../src/rules/type-annotation-spacing.ts | 4 +- packages/eslint-plugin/src/rules/typedef.ts | 5 +- .../src/util/getParserServices.ts | 4 +- packages/eslint-plugin/src/util/misc.ts | 8 +- packages/eslint-plugin/tests/RuleTester.ts | 2 +- .../tests/eslint-rules/strict.test.ts | 4 +- .../rules/consistent-type-definitions.test.ts | 12 - .../tests/rules/func-call-spacing.test.ts | 16 +- .../eslint-plugin/tests/rules/indent/utils.ts | 4 +- .../tests/rules/no-unused-vars.test.ts | 9 +- .../rules/no-useless-constructor.test.ts | 1 + .../tests/rules/require-await.test.ts | 6 +- .../eslint-plugin/tests/rules/semi.test.ts | 11 +- .../eslint-plugin/tools/generate-configs.ts | 4 +- .../validate-docs/check-for-rule-docs.ts | 2 +- .../validate-docs/validate-table-rules.ts | 2 +- .../validate-docs/validate-table-structure.ts | 4 +- .../eslint-plugin/typings/eslint-rules.d.ts | 20 +- .../eslint-plugin/typings/eslint-utils.d.ts | 4 +- .../src/eslint-utils/RuleCreator.ts | 2 +- .../src/eslint-utils/applyDefault.ts | 2 +- .../eslint-utils/batchedSingleLineTests.ts | 8 +- .../src/eslint-utils/deepMerge.ts | 18 +- packages/experimental-utils/src/index.ts | 3 +- .../experimental-utils/src/json-schema.ts | 1 + .../src/ts-eslint-scope/PatternVisitor.ts | 4 +- .../src/ts-eslint-scope/Referencer.ts | 1 + .../src/ts-eslint-scope/Scope.ts | 2 +- .../src/ts-eslint/CLIEngine.ts | 10 +- .../src/ts-eslint/Linter.ts | 24 +- .../experimental-utils/src/ts-eslint/Rule.ts | 8 +- .../src/ts-eslint/RuleTester.ts | 12 +- .../experimental-utils/src/ts-eslint/Scope.ts | 2 +- .../src/ts-eslint/SourceCode.ts | 2 +- packages/parser/package.json | 4 +- packages/parser/src/analyze-scope.ts | 29 +- packages/parser/src/parser.ts | 8 +- packages/parser/src/simple-traverse.ts | 3 +- packages/parser/tests/lib/basics.ts | 1 + packages/parser/tests/lib/parser.ts | 4 + packages/parser/tests/tools/scope-analysis.ts | 2 + packages/parser/tests/tools/test-utils.ts | 35 +- packages/typescript-estree/package.json | 15 +- .../typescript-estree/src/ast-converter.ts | 9 +- packages/typescript-estree/src/convert.ts | 4 +- packages/typescript-estree/src/node-utils.ts | 11 +- .../typescript-estree/src/parser-options.ts | 2 +- packages/typescript-estree/src/parser.ts | 10 +- .../typescript-estree/src/semantic-errors.ts | 2 +- .../typescript-estree/src/tsconfig-parser.ts | 3 + .../tests/ast-alignment/parse.ts | 4 +- .../tests/ast-alignment/utils.ts | 2 + .../typescript-estree/tests/lib/convert.ts | 2 + packages/typescript-estree/tests/lib/parse.ts | 6 +- .../tests/lib/semanticInfo.ts | 38 +- .../typescript-estree/tools/test-utils.ts | 2 +- .../utils/generate-package-json.js | 1 + yarn.lock | 4399 +++++++++++------ 96 files changed, 3454 insertions(+), 1826 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.json create mode 100644 packages/experimental-utils/src/json-schema.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000000..45426c37acf6 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,181 @@ +module.exports = { + root: true, + plugins: [ + 'eslint-plugin', + '@typescript-eslint', + 'jest', + 'import', + 'eslint-comments', + ], + env: { + es6: true, + node: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + ], + rules: { + // + // our plugin :D + // + + '@typescript-eslint/ban-ts-ignore': 'error', + '@typescript-eslint/consistent-type-definitions': 'error', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-member-accessibility': 'off', + '@typescript-eslint/indent': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-inferrable-types': 'error', + '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-object-literal-type-assertion': 'off', + '@typescript-eslint/no-parameter-properties': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/prefer-includes': 'error', + '@typescript-eslint/prefer-regexp-exec': 'error', + '@typescript-eslint/prefer-string-starts-ends-with': 'error', + + // + // eslint base + // + + 'comma-dangle': ['error', 'always-multiline'], + curly: ['error', 'all'], + 'no-mixed-operators': 'error', + 'no-console': 'error', + 'no-process-exit': 'error', + + // + // eslint-plugin-eslint-comment + // + + // require a eslint-enable comment for every eslint-disable comment + 'eslint-comments/disable-enable-pair': [ + 'error', + { + allowWholeFile: true, + }, + ], + // disallow a eslint-enable comment for multiple eslint-disable comments + 'eslint-comments/no-aggregating-enable': 'error', + // disallow duplicate eslint-disable comments + 'eslint-comments/no-duplicate-disable': 'error', + // disallow eslint-disable comments without rule names + 'eslint-comments/no-unlimited-disable': 'error', + // disallow unused eslint-disable comments + 'eslint-comments/no-unused-disable': 'error', + // disallow unused eslint-enable comments + 'eslint-comments/no-unused-enable': 'error', + // disallow ESLint directive-comments + 'eslint-comments/no-use': [ + 'error', + { + allow: [ + 'eslint-disable', + 'eslint-disable-line', + 'eslint-disable-next-line', + 'eslint-enable', + ], + }, + ], + + // + // eslint-plugin-import + // + + // disallow non-import statements appearing before import statements + 'import/first': 'error', + // Require a newline after the last import/require in a group + 'import/newline-after-import': 'error', + // Forbid import of modules using absolute paths + 'import/no-absolute-path': 'error', + // disallow AMD require/define + 'import/no-amd': 'error', + // forbid default exports + 'import/no-default-export': 'error', + // Forbid the use of extraneous packages + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + peerDependencies: true, + optionalDependencies: false, + }, + ], + // Forbid mutable exports + 'import/no-mutable-exports': 'error', + // Prevent importing the default as if it were named + 'import/no-named-default': 'error', + // Prohibit named exports // we want everything to be a named export + 'import/no-named-export': 'off', + // Forbid a module from importing itself + 'import/no-self-import': 'error', + // Require modules with a single export to use a default export // we want everything to be named + 'import/prefer-default-export': 'off', + }, + parserOptions: { + sourceType: 'module', + ecmaFeatures: { + jsx: false, + }, + project: './tsconfig.base.json', + }, + overrides: [ + { + files: [ + 'packages/eslint-plugin-tslint/tests/**/*.ts', + 'packages/eslint-plugin/tests/**/*.test.ts', + 'packages/parser/tests/**/*.ts', + 'packages/typescript-estree/tests/**/*.ts', + ], + env: { + 'jest/globals': true, + }, + rules: { + 'jest/no-disabled-tests': 'warn', + 'jest/no-focused-tests': 'error', + 'jest/no-alias-methods': 'error', + 'jest/no-identical-title': 'error', + 'jest/no-jasmine-globals': 'error', + 'jest/no-jest-import': 'error', + 'jest/no-test-prefixes': 'error', + 'jest/no-test-callback': 'error', + 'jest/no-test-return-statement': 'error', + 'jest/prefer-to-have-length': 'warn', + 'jest/prefer-spy-on': 'error', + 'jest/valid-expect': 'error', + }, + }, + { + files: [ + 'packages/eslint-plugin/tests/**/*.test.ts', + 'packages/eslint-plugin-tslint/tests/**/*.spec.ts', + ], + rules: { + 'eslint-plugin/no-identical-tests': 'error', + }, + }, + { + files: [ + 'packages/eslint-plugin/src/rules/**/*.ts', + 'packages/eslint-plugin/src/configs/**/*.ts', + 'packages/eslint-plugin-tslint/src/rules/**/*.ts', + ], + rules: { + // specifically for rules - default exports makes the tooling easier + 'import/no-default-export': 'off', + }, + }, + { + files: ['**/tools/**/*.ts', '**/tests/**/*.ts'], + rules: { + // allow console logs in tools and tests + 'no-console': 'off', + }, + }, + ], +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 649b9ec25021..000000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "root": true, - "plugins": ["eslint-plugin", "@typescript-eslint", "jest"], - "env": { - "es6": true, - "node": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "comma-dangle": ["error", "always-multiline"], - "curly": ["error", "all"], - "no-mixed-operators": "error", - "no-console": "off", - "no-dupe-class-members": "off", - "no-undef": "off", - "@typescript-eslint/indent": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/no-parameter-properties": "off" - }, - "parserOptions": { - "sourceType": "module", - "ecmaFeatures": { - "jsx": false - }, - "project": "./tsconfig.base.json" - }, - "overrides": [ - { - "files": [ - "packages/eslint-plugin-tslint/tests/**/*.ts", - "packages/eslint-plugin/tests/**/*.test.ts", - "packages/parser/tests/**/*.ts", - "packages/typescript-estree/tests/**/*.ts" - ], - "env": { - "jest/globals": true - }, - "rules": { - "jest/no-disabled-tests": "warn", - "jest/no-focused-tests": "error", - "jest/no-alias-methods": "error", - "jest/no-identical-title": "error", - "jest/no-jasmine-globals": "error", - "jest/no-jest-import": "error", - "jest/no-test-prefixes": "error", - "jest/no-test-callback": "error", - "jest/no-test-return-statement": "error", - "jest/prefer-to-have-length": "warn", - "jest/prefer-spy-on": "error", - "jest/valid-expect": "error" - } - }, - { - "files": [ - "packages/eslint-plugin/test/**/*.ts", - "packages/eslint-plugin-tslint/tests/**/*.spec.ts" - ], - "rules": { - "eslint-plugin/no-identical-tests": "error" - } - } - ] -} diff --git a/package.json b/package.json index 66015996551d..4e630cb4b1bc 100644 --- a/package.json +++ b/package.json @@ -50,36 +50,29 @@ "node": ">=6.14.0" }, "devDependencies": { - "@babel/code-frame": "7.0.0", - "@babel/parser": "7.3.2", - "@commitlint/cli": "^7.1.2", - "@commitlint/config-conventional": "^7.1.2", - "@commitlint/travis-cli": "^7.1.2", - "@types/babel-code-frame": "^6.20.1", - "@types/glob": "^7.1.1", - "@types/jest": "^24.0.6", - "@types/lodash.isplainobject": "^4.0.4", - "@types/lodash.unescape": "^4.0.4", - "@types/node": "^10.12.2", - "@types/semver": "^5.5.0", - "all-contributors-cli": "^6.0.0", - "babel-code-frame": "^6.26.0", + "@commitlint/cli": "^8.1.0", + "@commitlint/config-conventional": "^8.1.0", + "@commitlint/travis-cli": "^8.1.0", + "@types/jest": "^24.0.15", + "@types/node": "^12.6.8", + "all-contributors-cli": "^6.8.0", "cz-conventional-changelog": "2.1.0", "eslint": "^6.0.0", - "eslint-plugin-eslint-plugin": "^2.0.1", - "eslint-plugin-jest": "^22.2.2", - "glob": "7.1.2", - "husky": "^1.3.1", + "eslint-plugin-eslint-comments": "^3.1.2", + "eslint-plugin-eslint-plugin": "^2.1.0", + "eslint-plugin-import": "^2.18.0", + "eslint-plugin-jest": "^22.10.0", + "glob": "^7.1.4", + "husky": "^3.0.0", "isomorphic-fetch": "^2.2.1", - "jest": "24.3.0", - "lerna": "^3.10.5", - "lint-staged": "8.1.0", - "lodash.isplainobject": "4.0.6", - "prettier": "^1.17.0", + "jest": "^24.8.0", + "lerna": "^3.15.0", + "lint-staged": "^9.2.0", + "prettier": "^1.18.2", "rimraf": "^2.6.3", "ts-jest": "^24.0.0", - "ts-node": "^8.0.1", - "tslint": "^5.11.0", + "ts-node": "^8.3.0", + "tslint": "^5.18.0", "typescript": ">=3.2.1 <3.6.0" } } diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index b5075e0a351e..bed7e2fd46f4 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -36,7 +36,8 @@ }, "peerDependencies": { "eslint": "^5.0.0 || ^6.0.0", - "tslint": "^5.0.0" + "tslint": "^5.0.0", + "typescript": "*" }, "devDependencies": { "@types/lodash.memoize": "^4.1.4", diff --git a/packages/eslint-plugin-tslint/src/custom-linter.ts b/packages/eslint-plugin-tslint/src/custom-linter.ts index 833fda00ca92..5de914e5f8f9 100644 --- a/packages/eslint-plugin-tslint/src/custom-linter.ts +++ b/packages/eslint-plugin-tslint/src/custom-linter.ts @@ -1,6 +1,8 @@ import { ILinterOptions, Linter, LintResult } from 'tslint'; import { Program } from 'typescript'; +// We need to access the program, but Linter has private program already +// eslint-disable-next-line @typescript-eslint/no-explicit-any const TSLintLinter = Linter as any; export class CustomLinter extends TSLintLinter { diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts index e9cd3f53bb5f..7152d21f69b6 100644 --- a/packages/eslint-plugin-tslint/src/rules/config.ts +++ b/packages/eslint-plugin-tslint/src/rules/config.ts @@ -18,10 +18,10 @@ export type RawRulesConfig = Record< | null | undefined | boolean - | any[] + | unknown[] | { severity?: RuleSeverity | 'warn' | 'none' | 'default'; - options?: any; + options?: unknown; } >; @@ -31,7 +31,7 @@ export type Options = [ rules?: RawRulesConfig; rulesDirectory?: string[]; lintFile?: string; - } + }, ]; /** @@ -63,7 +63,8 @@ export default createRule({ docs: { description: 'Wraps a TSLint configuration and lints the whole source using TSLint', - category: 'TSLint' as any, + // one off special category for this plugin + category: 'TSLint' as any, // eslint-disable-line @typescript-eslint/no-explicit-any recommended: false, }, type: 'problem', @@ -95,7 +96,7 @@ export default createRule({ }, ], }, - defaultOptions: [] as any, + defaultOptions: [{}], create(context) { const fileName = context.getFilename(); const sourceCode = context.getSourceCode().text; diff --git a/packages/eslint-plugin/docs/rules/generic-type-naming.md b/packages/eslint-plugin/docs/rules/generic-type-naming.md index cda927f2935c..a24bb281d666 100644 --- a/packages/eslint-plugin/docs/rules/generic-type-naming.md +++ b/packages/eslint-plugin/docs/rules/generic-type-naming.md @@ -15,7 +15,7 @@ Examples of **correct** code with a configuration of `'^T[A-Z][a-zA-Z]+$'`: ```typescript type ReadOnly = { - readonly [TKey in keyof TType]: TType[TKey] + readonly [TKey in keyof TType]: TType[TKey]; }; interface SimpleMap { diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 50a0337f4540..991831222811 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -41,16 +41,17 @@ }, "dependencies": { "@typescript-eslint/experimental-utils": "1.13.0", - "eslint-utils": "^1.3.1", + "eslint-utils": "^1.4.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", - "tsutils": "^3.7.0" + "tsutils": "^3.14.0" }, "devDependencies": { "@types/json-schema": "^7.0.3", "@types/marked": "^0.6.5", "chalk": "^2.4.2", - "marked": "^0.6.2" + "marked": "^0.7.0", + "typescript": "*" }, "peerDependencies": { "@typescript-eslint/parser": "^1.9.0", diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index ee0b35fdde85..8fe28bc32177 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -77,7 +77,7 @@ type Options = [ { default: OptionString; readonly?: OptionString; - } + }, ]; type MessageIds = | 'errorStringGeneric' diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index d0a57daf2335..1a38bf66f287 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -12,7 +12,7 @@ type Options = [ fixWith?: string; } >; - } + }, ]; type MessageIds = 'bannedTypeMessage'; @@ -114,7 +114,8 @@ export default util.createRule({ if (name in bannedTypes) { const bannedType = bannedTypes[name]; const customMessage = getCustomMessage(bannedType); - const fixWith = bannedType && (bannedType as any).fixWith; + const fixWith = + bannedType && typeof bannedType === 'object' && bannedType.fixWith; context.report({ node: typeName, diff --git a/packages/eslint-plugin/src/rules/camelcase.ts b/packages/eslint-plugin/src/rules/camelcase.ts index f3cb5948e5d0..ffa5a62ed894 100644 --- a/packages/eslint-plugin/src/rules/camelcase.ts +++ b/packages/eslint-plugin/src/rules/camelcase.ts @@ -37,7 +37,10 @@ export default util.createRule({ ]; const properties = options.properties; - const allow = options.allow!; + const allow = (options.allow || []).map(entry => ({ + name: entry, + regex: new RegExp(entry), + })); /** * Checks if a string contains an underscore and isn't all upper-case @@ -45,7 +48,7 @@ export default util.createRule({ */ function isUnderscored(name: string): boolean { // if there's an underscore, it might be A_CONSTANT, which is okay - return name.indexOf('_') > -1 && name !== name.toUpperCase(); + return name.includes('_') && name !== name.toUpperCase(); } /** @@ -57,7 +60,7 @@ export default util.createRule({ function isAllowed(name: string): boolean { return ( allow.findIndex( - entry => name === entry || name.match(new RegExp(entry)) !== null, + entry => name === entry.name || entry.regex.test(name), ) !== -1 ); } diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 8e02b893f646..b431fe7675ce 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -9,7 +9,7 @@ type Options = [ allowExpressions?: boolean; allowTypedFunctionExpressions?: boolean; allowHigherOrderFunctions?: boolean; - } + }, ]; type MessageIds = 'missingReturnType'; diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts index b64207816549..876761819fd7 100644 --- a/packages/eslint-plugin/src/rules/func-call-spacing.ts +++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts @@ -6,7 +6,7 @@ export type Options = [ 'never' | 'always', { allowNewlines?: boolean; - }? + }?, ]; export type MessageIds = 'unexpected' | 'missing'; diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 9ff5e31bbb5a..3549da45d74d 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -33,6 +33,7 @@ function createGlobalLinebreakMatcher() { // Rule Definition //------------------------------------------------------------------------------ +const WHITESPACE_REGEX = /\s*$/u; const KNOWN_NODES = new Set([ AST_NODE_TYPES.AssignmentExpression, AST_NODE_TYPES.AssignmentPattern, @@ -245,7 +246,8 @@ type Options = [('tab' | number)?, IndentConfig?]; type MessageIds = 'wrongIndentation'; type AppliedOptions = ExcludeKeys< - RequireKeys, + // slight hack to make interface work with Record + RequireKeys, keyof IndentConfig>, 'VariableDeclarator' > & { VariableDeclarator: 'off' | VariableDeclaratorObj; @@ -540,7 +542,7 @@ export default createRule({ while ( statement && ((statement.type === AST_NODE_TYPES.UnaryExpression && - ['!', '~', '+', '-'].indexOf(statement.operator) > -1) || + ['!', '~', '+', '-'].includes(statement.operator)) || statement.type === AST_NODE_TYPES.AssignmentExpression || statement.type === AST_NODE_TYPES.LogicalExpression || statement.type === AST_NODE_TYPES.SequenceExpression || @@ -565,9 +567,9 @@ export default createRule({ * or the total number of linebreaks if the string is all whitespace. */ function countTrailingLinebreaks(str: string): number { - const trailingWhitespace = str.match(/\s*$/u)![0]; - const linebreakMatches = trailingWhitespace.match( - createGlobalLinebreakMatcher(), + const trailingWhitespace = WHITESPACE_REGEX.exec(str)![0]; + const linebreakMatches = createGlobalLinebreakMatcher().exec( + trailingWhitespace, ); return linebreakMatches === null ? 0 : linebreakMatches.length; @@ -722,7 +724,7 @@ export default createRule({ parameterParens.add(closingParen); offsets.setDesiredOffset( openingParen, - sourceCode.getTokenBefore(openingParen)!, + sourceCode.getTokenBefore(openingParen), 0, ); @@ -900,7 +902,7 @@ export default createRule({ offsets.setDesiredOffsets( [operator.range[0], node.range[1]], - sourceCode.getLastToken(node.left)!, + sourceCode.getLastToken(node.left), 1, ); offsets.ignoreToken(operator); @@ -958,7 +960,7 @@ export default createRule({ if (node.parent && !STATEMENT_LIST_PARENTS.has(node.parent.type)) { offsets.setDesiredOffset( sourceCode.getFirstToken(node)!, - sourceCode.getFirstToken(node.parent)!, + sourceCode.getFirstToken(node.parent), 0, ); } @@ -1088,7 +1090,7 @@ export default createRule({ // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` offsets.setDesiredOffsets( [closingCurly.range[1], node.range[1]], - sourceCode.getFirstToken(node)!, + sourceCode.getFirstToken(node), 1, ); } @@ -1182,7 +1184,7 @@ export default createRule({ offsets.setDesiredOffsets( [fromToken.range[0], end], - sourceCode.getFirstToken(node)!, + sourceCode.getFirstToken(node), 1, ); } @@ -1521,7 +1523,7 @@ export default createRule({ } offsets.setDesiredOffsets( node.name.range, - sourceCode.getFirstToken(node)!, + sourceCode.getFirstToken(node), ); addElementListIndent(node.attributes, firstToken, closingToken, 1); }, diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 321f32f4cceb..76d1edf1cdbb 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -3,6 +3,7 @@ * This is due to some really funky type conversions between different node types. * This is done intentionally based on the internal implementation of the base indent rule. */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { TSESTree, diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 326a0d961e52..d1efe5e11330 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -5,20 +5,23 @@ import { import * as util from '../util'; type Delimiter = 'comma' | 'none' | 'semi'; -interface TypeOptions { +// need type's implicit index sig for deepMerge +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type TypeOptions = { delimiter?: Delimiter; requireLast?: boolean; -} -interface BaseOptions { +}; +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type BaseOptions = { multiline?: TypeOptions; singleline?: TypeOptions; -} -interface Config extends BaseOptions { +}; +type Config = BaseOptions & { overrides?: { typeLiteral?: BaseOptions; interface?: BaseOptions; }; -} +}; type Options = [Config]; type MessageIds = | 'unexpectedComma' diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 25dd2f79ca1e..d2becd1655fa 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -13,7 +13,7 @@ type Options = [ classExpressions?: OrderConfig; interfaces?: OrderConfig; typeLiterals?: OrderConfig; - } + }, ]; const allMemberTypes = ['field', 'method', 'constructor'].reduce( @@ -26,7 +26,7 @@ const allMemberTypes = ['field', 'method', 'constructor'].reduce( if (type !== 'constructor') { // There is no `static-constructor` or `instance-constructor ['static', 'instance'].forEach(scope => { - if (all.indexOf(`${scope}-${type}`) === -1) { + if (!all.includes(`${scope}-${type}`)) { all.push(`${scope}-${type}`); } @@ -195,7 +195,7 @@ export default util.createRule({ case AST_NODE_TYPES.TSConstructSignatureDeclaration: return 'constructor'; case AST_NODE_TYPES.ClassProperty: - return node.value && functionExpressions.indexOf(node.value.type) > -1 + return node.value && functionExpressions.includes(node.value.type) ? 'method' : 'field'; case AST_NODE_TYPES.TSPropertySignature: diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index 277e9ebb3132..4d2a0a5a4882 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -3,7 +3,7 @@ import * as util from '../util'; type Options = [ { allowSingleExtends?: boolean; - } + }, ]; type MessageIds = 'noEmpty' | 'noEmptyWithSuper'; diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index f5a555933615..a84327a0d553 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -9,7 +9,7 @@ export type Options = [ { fixToUnknown?: boolean; ignoreRestArgs?: boolean; - } + }, ]; export type MessageIds = 'unexpectedAny'; diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 8f94fc1fa9db..28e69478d7e5 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -1,3 +1,6 @@ +// anys are required to work around manipulating the AST in weird ways +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { AST_NODE_TYPES, TSESTree, diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index 29928b6709dc..846416866f25 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -9,7 +9,7 @@ type Options = [ allowConstructorOnly?: boolean; allowEmpty?: boolean; allowStaticOnly?: boolean; - } + }, ]; type MessageIds = 'empty' | 'onlyStatic' | 'onlyConstructor'; diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 1c8cf412c070..04d6664525c8 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -25,9 +25,9 @@ export default util.createRule({ return { ExpressionStatement(node) { - const { expression } = parserServices.esTreeNodeToTSNodeMap.get( - node, - ) as ts.ExpressionStatement; + const { expression } = parserServices.esTreeNodeToTSNodeMap.get< + ts.ExpressionStatement + >(node); if (isUnhandledPromise(checker, expression)) { context.report({ diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index e9db74cab3f3..f3b44e512fa7 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -8,7 +8,7 @@ type Options = [ { ignoreParameters?: boolean; ignoreProperties?: boolean; - } + }, ]; type MessageIds = 'noInferrableType'; diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 1880aa19c9d0..8a50fa87c390 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -4,12 +4,13 @@ import { } from '@typescript-eslint/experimental-utils'; import baseRule from 'eslint/lib/rules/no-magic-numbers'; import * as util from '../util'; -import { JSONSchema4 } from 'json-schema'; type Options = util.InferOptionsTypeFromRule; type MessageIds = util.InferMessageIdsTypeFromRule; -const baseRuleSchema = (baseRule.meta.schema as JSONSchema4[])[0]; +const baseRuleSchema = Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema; export default util.createRule({ name: 'no-magic-numbers', diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 7b1181ff179d..b36046352d7d 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -8,7 +8,7 @@ type Options = [ { checksConditionals?: boolean; checksVoidReturn?: boolean; - } + }, ]; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index 930b3067eba3..ca68fcf647b5 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -8,7 +8,7 @@ type Options = [ { allowDeclarations?: boolean; allowDefinitionFiles?: boolean; - } + }, ]; type MessageIds = 'moduleSyntaxIsPreferred'; diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index 2ef515b721f2..a7727a33602b 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -15,7 +15,7 @@ type Modifier = type Options = [ { allows: Modifier[]; - } + }, ]; type MessageIds = 'noParamProp'; @@ -84,7 +84,7 @@ export default util.createRule({ TSParameterProperty(node) { const modifiers = getModifiers(node); - if (allows.indexOf(modifiers) === -1) { + if (!allows.includes(modifiers)) { // HAS to be an identifier or assignment or TSC will throw if ( node.parameter.type !== AST_NODE_TYPES.Identifier && diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index 6b913539903c..e156cbd24e2f 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -8,7 +8,7 @@ type Options = [ { allowDestructuring?: boolean; allowedNames?: string[]; - } + }, ]; type MessageIds = 'thisAssignment' | 'thisDestructure'; diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index a4bf7fca2d39..f260d124133f 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -25,7 +25,7 @@ type Options = [ | 'in-unions' | 'in-intersections' | 'in-unions-and-intersections'; - } + }, ]; type MessageIds = 'noTypeAlias' | 'noCompositionAlias'; @@ -133,12 +133,12 @@ export default util.createRule({ allowed: string, ): boolean { return ( - compositions.indexOf(allowed) === -1 || + !compositions.includes(allowed) || (!isTopLevel && ((compositionType === AST_NODE_TYPES.TSUnionType && - unions.indexOf(allowed) > -1) || + unions.includes(allowed)) || (compositionType === AST_NODE_TYPES.TSIntersectionType && - intersections.indexOf(allowed) > -1))) + intersections.includes(allowed)))) ); } @@ -225,7 +225,7 @@ export default util.createRule({ ); } } else if ( - /Keyword$/.test(type.node.type) || + type.node.type.endsWith('Keyword') || aliasTypes.has(type.node.type) ) { // alias / keyword diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 39f506cd9eee..d93e205c7bb5 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -68,15 +68,15 @@ export default util.createRule<[], MessageIds>({ : [typeArguments[i - 1].end, arg.end], ), messageId: 'unnecessaryTypeParameter', - node: esParameters!.params[i], + node: esParameters.params[i], }); } return { TSTypeParameterInstantiation(node) { - const parentDeclaration = parserServices.esTreeNodeToTSNodeMap.get( - node.parent!, - ) as ExtendingClassLikeDeclaration | ParameterCapableTSNode; + const parentDeclaration = parserServices.esTreeNodeToTSNodeMap.get< + ExtendingClassLikeDeclaration | ParameterCapableTSNode + >(node.parent!); const expression = tsutils.isClassLikeDeclaration(parentDeclaration) ? parentDeclaration.heritageClauses[0].types[0] diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index 6dd69974ca2f..c91c3d678c7b 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -16,7 +16,7 @@ import * as util from '../util'; type Options = [ { typesToIgnore?: string[]; - } + }, ]; type MessageIds = 'contextuallyUnnecessary' | 'unnecessaryAssertion'; @@ -239,9 +239,9 @@ export default util.createRule({ if ( options && options.typesToIgnore && - options.typesToIgnore.indexOf( + options.typesToIgnore.includes( sourceCode.getText(node.typeAnnotation), - ) !== -1 + ) ) { return; } diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index c18e8e0cc11a..20ed4edc77aa 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -245,7 +245,9 @@ export default util.createRule({ context.report({ node: reference.identifier, messageId: 'noUseBeforeDefine', - data: reference.identifier, + data: { + name: reference.identifier.name, + }, }); }); diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 451515d18ed1..01f4ea320bab 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -12,7 +12,7 @@ type MessageIds = 'preferReadonly'; type Options = [ { onlyInlineLambdas?: boolean; - } + }, ]; const functionScopeBoundaries = [ diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index dae7b8f13c1f..c48e2351985f 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -1,6 +1,6 @@ import { TSESTree } from '@typescript-eslint/experimental-utils'; -import { createRule, getParserServices, getTypeName } from '../util'; import { getStaticValue } from 'eslint-utils'; +import { createRule, getParserServices, getTypeName } from '../util'; export default createRule({ name: 'prefer-regexp-exec', diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 67b341a8e509..4e902dfd584a 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -79,6 +79,8 @@ export default createRule({ return ( evaluated != null && typeof evaluated.value === 'string' && + // checks if the string is a character long + // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with evaluated.value[0] === evaluated.value ); } @@ -508,7 +510,8 @@ export default createRule({ } const eqNode = parentNode; - const negativeIndexSupported = (node.property as any).name === 'slice'; + const negativeIndexSupported = + (node.property as TSESTree.Identifier).name === 'slice'; context.report({ node: parentNode, messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 529f41ee72bb..48d63cf0f545 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -9,7 +9,7 @@ type Options = [ checkFunctionDeclarations?: boolean; checkFunctionExpressions?: boolean; checkMethodDeclarations?: boolean; - } + }, ]; type MessageIds = 'missingAsync'; diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 867c69d5f9e3..d9077bf31548 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -16,7 +16,7 @@ type ExpressionWithTest = type Options = [ { ignoreRhs?: boolean; - } + }, ]; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts index 906efaa7db81..7d74ab0c603d 100644 --- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts @@ -6,7 +6,7 @@ type Options = [ lib?: 'always' | 'never'; path?: 'always' | 'never'; types?: 'always' | 'never' | 'prefer-import'; - } + }, ]; type MessageIds = 'tripleSlashReference'; diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index e270c0f7feca..f5e11f51fb07 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -15,7 +15,7 @@ type Options = [ after?: boolean; }; }; - }? + }?, ]; type MessageIds = | 'expectedSpaceAfter' @@ -104,7 +104,7 @@ export default util.createRule({ let previousToken = sourceCode.getTokenBefore(punctuatorTokenEnd)!; let type = punctuatorTokenEnd.value; - if (punctuators.indexOf(type) === -1) { + if (!punctuators.includes(type)) { return; } diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index a53f173303cc..5e0465e0e231 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -1,4 +1,7 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; import * as util from '../util'; const enum OptionKeys { diff --git a/packages/eslint-plugin/src/util/getParserServices.ts b/packages/eslint-plugin/src/util/getParserServices.ts index 84a9dea98740..d0a184871718 100644 --- a/packages/eslint-plugin/src/util/getParserServices.ts +++ b/packages/eslint-plugin/src/util/getParserServices.ts @@ -4,7 +4,7 @@ import { } from '@typescript-eslint/experimental-utils'; type RequiredParserServices = { - [k in keyof ParserServices]: Exclude + [k in keyof ParserServices]: Exclude; }; /** @@ -12,7 +12,7 @@ type RequiredParserServices = { */ export function getParserServices< TMessageIds extends string, - TOptions extends any[] + TOptions extends unknown[] >( context: TSESLint.RuleContext, ): RequiredParserServices { diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 050438d3843b..30587b336ed9 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -32,7 +32,7 @@ type InferOptionsTypeFromRuleNever = T extends TSESLint.RuleModule< * Uses type inference to fetch the TOptions type from the given RuleModule */ export type InferOptionsTypeFromRule = T extends TSESLint.RuleModule< - any, + string, infer TOptions > ? TOptions @@ -43,7 +43,7 @@ export type InferOptionsTypeFromRule = T extends TSESLint.RuleModule< */ export type InferMessageIdsTypeFromRule = T extends TSESLint.RuleModule< infer TMessageIds, - any + unknown[] > ? TMessageIds : unknown; @@ -120,10 +120,10 @@ function keyCanBeReadAsPropertyName( } export type ExcludeKeys< - TObj extends Record, + TObj extends Record, TKeys extends keyof TObj > = { [k in Exclude]: TObj[k] }; export type RequireKeys< - TObj extends Record, + TObj extends Record, TKeys extends keyof TObj > = ExcludeKeys & { [k in TKeys]-?: Exclude }; diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 769d7bc1aae1..0733e1887cb2 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -20,7 +20,7 @@ class RuleTester extends TSESLint.RuleTester { // as of eslint 6 you have to provide an absolute path to the parser // If you don't do that at the test level, the test will fail somewhat cryptically... // This is a lot more explicit - run>( + run>( name: string, rule: TSESLint.RuleModule, tests: TSESLint.RunTests, diff --git a/packages/eslint-plugin/tests/eslint-rules/strict.test.ts b/packages/eslint-plugin/tests/eslint-rules/strict.test.ts index 56e951dc6030..96745d2541b9 100644 --- a/packages/eslint-plugin/tests/eslint-rules/strict.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/strict.test.ts @@ -38,7 +38,9 @@ window.whatevs = { message: "Use the function form of 'use strict'.", line: 3, column: 9, - } as any, // the base rule doesn't use messageId + // the base rule doesn't use messageId + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any, ], }, ], diff --git a/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts index b5daf40a90e8..b777a1fc68f7 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts @@ -35,18 +35,6 @@ type Record = { `, options: ['interface'], }, - { - code: `type V = { x: number; } | { y: string; };`, - options: ['interface'], - }, - { - code: `type T = { x: number; }`, - options: ['type'], - }, - { - code: `type T = { x: number; }`, - options: ['type'], - }, { code: `type T = { x: number; }`, options: ['type'], diff --git a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts index d0b8afe9b194..14184b3fe0f4 100644 --- a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts @@ -192,13 +192,13 @@ var a = foo code: 'f\r\n();', output: null, // no change }, - ].map>( + ].map( code => ({ options: ['never'], errors: [{ messageId: 'unexpected' }], ...code, - } as any), + } as TSESLint.InvalidTestCase), ), // "always" @@ -227,13 +227,13 @@ var a = foo code: 'f(0) (1)', output: 'f (0) (1)', }, - ].map>( + ].map( code => ({ options: ['always'], errors: [{ messageId: 'missing' }], ...code, - } as any), + } as TSESLint.InvalidTestCase), ), ...[ { @@ -303,13 +303,13 @@ var a = foo code: 'f\r\n();', output: 'f ();', }, - ].map>( + ].map( code => ({ options: ['always'], errors: [{ messageId: 'unexpected' as MessageIds }], ...code, - } as any), + } as TSESLint.InvalidTestCase), ), // "always", "allowNewlines": true @@ -356,13 +356,13 @@ var a = foo output: 'f ();\n t ();', errors: [{ messageId: 'missing' }, { messageId: 'missing' }], }, - ].map>( + ].map( code => ({ options: ['always', { allowNewlines: true }], errors: [{ messageId: 'missing' }], ...code, - } as any), + } as TSESLint.InvalidTestCase), ), ], }); diff --git a/packages/eslint-plugin/tests/rules/indent/utils.ts b/packages/eslint-plugin/tests/rules/indent/utils.ts index 091f68740cd1..72cedd3ea645 100644 --- a/packages/eslint-plugin/tests/rules/indent/utils.ts +++ b/packages/eslint-plugin/tests/rules/indent/utils.ts @@ -24,7 +24,7 @@ export function unIndent(strings: TemplateStringsArray): string { .split('\n'); const lineIndents = lines .filter(line => line.trim()) - .map(line => line.match(/ */u)![0].length); + .map(line => / */u.exec(line)![0].length); const minLineIndent = Math.min(...lineIndents); return lines.map(line => line.slice(minLineIndent)).join('\n'); @@ -38,7 +38,7 @@ type ProvidedError = [ // actual indent number | string, // node type - AST_NODE_TYPES | AST_TOKEN_TYPES + AST_NODE_TYPES | AST_TOKEN_TYPES, ]; function is2DProvidedErrorArr( diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 76c5e69fa05f..d09724e8eee2 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -10,11 +10,10 @@ const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -// the base rule doesn't have messageIds -function error( - messages: { message: string; line: number; column: number }[], -): any[] { - return messages; +function error(messages: { message: string; line: number; column: number }[]) { + // the base rule doesn't have messageIds + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return messages as any[]; } ruleTester.run('no-unused-vars', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts index 18446ad64707..2a5d97a4cf88 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -10,6 +10,7 @@ const ruleTester = new RuleTester({ }); // the base rule doesn't use a message id... +// eslint-disable-next-line @typescript-eslint/no-explicit-any const error: any = { message: 'Useless constructor.', type: 'MethodDefinition', diff --git a/packages/eslint-plugin/tests/rules/require-await.test.ts b/packages/eslint-plugin/tests/rules/require-await.test.ts index 0b5f299e579d..3ea207713b2d 100644 --- a/packages/eslint-plugin/tests/rules/require-await.test.ts +++ b/packages/eslint-plugin/tests/rules/require-await.test.ts @@ -12,14 +12,16 @@ const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); +// The rule has no messageId +// eslint-disable-next-line @typescript-eslint/no-explicit-any const noAwaitFunctionDeclaration: any = { message: "Async function 'numberOne' has no 'await' expression.", }; - +// eslint-disable-next-line @typescript-eslint/no-explicit-any const noAwaitFunctionExpression: any = { message: "Async function has no 'await' expression.", }; - +// eslint-disable-next-line @typescript-eslint/no-explicit-any const noAwaitAsyncFunctionExpression: any = { message: "Async arrow function has no 'await' expression.", }; diff --git a/packages/eslint-plugin/tests/rules/semi.test.ts b/packages/eslint-plugin/tests/rules/semi.test.ts index 83bc750a2353..95f22986b108 100644 --- a/packages/eslint-plugin/tests/rules/semi.test.ts +++ b/packages/eslint-plugin/tests/rules/semi.test.ts @@ -18,10 +18,13 @@ const neverOptionWithoutContinuationChars: Options = [ ]; // the base rule doesn't use a message id... +// eslint-disable-next-line @typescript-eslint/no-explicit-any const missingSemicolon: any = { message: 'Missing semicolon.', }; +// the base rule doesn't use a message id... +// eslint-disable-next-line @typescript-eslint/no-explicit-any const extraSemicolon: any = { message: 'Extra semicolon.', }; @@ -624,16 +627,16 @@ class PanCamera extends FreeCamera { options: ['always'], errors: test.errors.map(e => ({ ...e, - message: 'Missing semicolon.', - })) as any, + ...missingSemicolon, + })), }); acc.push({ code: test.code, options: ['never'], errors: test.errors.map(e => ({ ...e, - message: 'Extra semicolon.', - })) as any, + ...extraSemicolon, + })), }); return acc; diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index d268ccd5d2ea..5e293018eb4c 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -1,5 +1,3 @@ -/* eslint-disable no-console */ - import { TSESLint } from '@typescript-eslint/experimental-utils'; import chalk from 'chalk'; import fs from 'fs'; @@ -42,7 +40,7 @@ const ruleEntries = Object.entries(rules); */ const reducer = ( config: LinterConfigRules, - entry: [string, TSESLint.RuleModule], + entry: [string, TSESLint.RuleModule], settings: { errorLevel?: 'error' | 'warn'; filterDeprecated: boolean; diff --git a/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts b/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts index 158af4513f3e..f83cd8fbe583 100644 --- a/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts +++ b/packages/eslint-plugin/tools/validate-docs/check-for-rule-docs.ts @@ -4,7 +4,7 @@ import path from 'path'; import { logRule } from '../log'; function checkForRuleDocs( - rules: Record>>, + rules: Record>>, ): boolean { const ruleDocs = new Set( fs.readdirSync(path.resolve(__dirname, '../../docs/rules')), diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts index 4e9405a653da..c3e712ca525f 100644 --- a/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts @@ -6,7 +6,7 @@ import path from 'path'; import { logRule } from '../log'; function validateTableRules( - rules: Record>>, + rules: Record>>, rulesTable: marked.Tokens.Table, ): boolean { let hasErrors = false; diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts index 377769741c35..e9d339c10c23 100644 --- a/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts @@ -4,7 +4,7 @@ import marked from 'marked'; import { logError } from '../log'; function validateTableStructure( - rules: Record>>, + rules: Record>>, rulesTable: marked.Tokens.Table, ): boolean { const ruleNames = Object.keys(rules) @@ -13,7 +13,7 @@ function validateTableStructure( let hasErrors = false; rulesTable.cells.forEach((row, rowIndex) => { - const match = row[0].match(/\[`@typescript-eslint\/(.+)`\]/); + const match = /\[`@typescript-eslint\/(.+)`\]/.exec(row[0]); if (!match) { logError(chalk.bold(`Unable to parse link in row ${rowIndex}:`), row[0]); hasErrors = true; diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index a8fe7c283f46..4e5fe5b64495 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -16,7 +16,7 @@ declare module 'eslint/lib/rules/arrow-parens' { 'always' | 'as-needed', { requireForBlockBody?: boolean; - }? + }?, ], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; @@ -35,7 +35,7 @@ declare module 'eslint/lib/rules/camelcase' { allow?: string[]; ignoreDestructuring?: boolean; properties?: 'always' | 'never'; - } + }, ], { Identifier(node: TSESTree.Identifier): void; @@ -81,7 +81,7 @@ declare module 'eslint/lib/rules/indent' { flatTernaryExpressions?: boolean; ignoredNodes?: string[]; ignoreComments?: boolean; - })? + })?, ], { '*:exit'(node: TSESTree.Node): void; @@ -163,7 +163,7 @@ declare module 'eslint/lib/rules/no-empty-function' { [ { allow?: string[]; - } + }, ], { FunctionDeclaration(node: TSESTree.FunctionDeclaration): void; @@ -199,7 +199,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' { detectObjects?: boolean; ignoreNumericLiteralTypes?: boolean; ignoreEnums?: boolean; - } + }, ], { Literal(node: TSESTree.Literal): void; @@ -216,7 +216,7 @@ declare module 'eslint/lib/rules/no-redeclare' { [ { builtinGlobals?: boolean; - }? + }?, ], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; @@ -253,7 +253,7 @@ declare module 'eslint/lib/rules/no-shadow' { builtinGlobals?: boolean; hoist: 'all' | 'functions' | 'never'; allow: string[]; - } + }, ], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; @@ -270,7 +270,7 @@ declare module 'eslint/lib/rules/no-undef' { [ { typeof?: boolean; - } + }, ], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; @@ -370,7 +370,7 @@ declare module 'eslint/lib/rules/no-extra-parens' { nestedBinaryExpressions?: boolean; ignoreJSX?: 'none' | 'all' | 'multi-line' | 'single-line'; enforceForArrowConditionals?: boolean; - }? + }?, ], { ArrayExpression(node: TSESTree.ArrayExpression): void; @@ -442,7 +442,7 @@ declare module 'eslint/lib/rules/semi' { { beforeStatementContinuationChars?: 'always' | 'any' | 'never'; omitLastInOneLineBlock?: boolean; - }? + }?, ], { VariableDeclaration(node: TSESTree.VariableDeclaration): void; diff --git a/packages/eslint-plugin/typings/eslint-utils.d.ts b/packages/eslint-plugin/typings/eslint-utils.d.ts index e7cefb09367f..607c16022eb2 100644 --- a/packages/eslint-plugin/typings/eslint-utils.d.ts +++ b/packages/eslint-plugin/typings/eslint-utils.d.ts @@ -27,7 +27,7 @@ declare module 'eslint-utils' { export function getStaticValue( node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope, - ): { value: any } | null; + ): { value: unknown } | null; export function getStringIfConstant( node: TSESTree.Node, @@ -93,6 +93,7 @@ declare module 'eslint-utils' { export type CALL = typeof ReferenceTracker.READ; export type CONSTRUCT = typeof ReferenceTracker.READ; export type ReferenceType = READ | CALL | CONSTRUCT; + // eslint-disable-next-line @typescript-eslint/no-explicit-any export type TraceMap = Record>; export interface TraceMapElement { [ReferenceTracker.READ]?: T; @@ -100,6 +101,7 @@ declare module 'eslint-utils' { [ReferenceTracker.CONSTRUCT]?: T; [key: string]: TraceMapElement; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any export interface FoundReference { node: TSESTree.Node; path: readonly string[]; diff --git a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts index 28b00b7ed9c0..e14242fca723 100644 --- a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts +++ b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts @@ -17,7 +17,7 @@ export function RuleCreator(urlCreator: (ruleName: string) => string) { // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349 // TODO - when the above PR lands; add type checking for the context.report `data` property return function createRule< - TOptions extends any[], + TOptions extends unknown[], TMessageIds extends string, TRuleListener extends RuleListener = RuleListener >({ diff --git a/packages/experimental-utils/src/eslint-utils/applyDefault.ts b/packages/experimental-utils/src/eslint-utils/applyDefault.ts index b54ca2198640..f9f9c8f3a418 100644 --- a/packages/experimental-utils/src/eslint-utils/applyDefault.ts +++ b/packages/experimental-utils/src/eslint-utils/applyDefault.ts @@ -7,7 +7,7 @@ import { deepMerge, isObjectNotArray } from './deepMerge'; * @param userOptions the user opts * @returns the options with defaults */ -export function applyDefault( +export function applyDefault( defaultOptions: TDefault, userOptions: TUser | null, ): TDefault { diff --git a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts index 567378fdd5dd..f8080ca87ffa 100644 --- a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts +++ b/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts @@ -8,7 +8,7 @@ import { ValidTestCase, InvalidTestCase } from '../ts-eslint'; * Because it makes the test error messages harder to decipher. * This way each line will fail separately, instead of them all failing together. */ -function batchedSingleLineTests>( +function batchedSingleLineTests>( test: ValidTestCase, ): ValidTestCase[]; /** @@ -24,18 +24,18 @@ function batchedSingleLineTests>( */ function batchedSingleLineTests< TMessageIds extends string, - TOptions extends Readonly + TOptions extends Readonly >( test: InvalidTestCase, ): InvalidTestCase[]; function batchedSingleLineTests< TMessageIds extends string, - TOptions extends Readonly + TOptions extends Readonly >( options: ValidTestCase | InvalidTestCase, ): (ValidTestCase | InvalidTestCase)[] { // eslint counts lines from 1 - const lineOffset = options.code[0] === '\n' ? 2 : 1; + const lineOffset = options.code.startsWith('\n') ? 2 : 1; const output = 'output' in options && options.output ? options.output.trim().split('\n') diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/experimental-utils/src/eslint-utils/deepMerge.ts index 0685fa9b0f87..966a0db08212 100644 --- a/packages/experimental-utils/src/eslint-utils/deepMerge.ts +++ b/packages/experimental-utils/src/eslint-utils/deepMerge.ts @@ -1,11 +1,13 @@ -type ObjectLike = Record; +type ObjectLike = Record; /** * Check if the variable contains an object stricly rejecting arrays * @param obj an object * @returns `true` if obj is an object */ -export function isObjectNotArray(obj: T | any[]): obj is T { +export function isObjectNotArray( + obj: unknown | unknown[], +): obj is T { return typeof obj === 'object' && !Array.isArray(obj); } @@ -24,19 +26,21 @@ export function deepMerge(first: ObjectLike = {}, second: ObjectLike = {}) { (acc, key) => { const firstHasKey = key in first; const secondHasKey = key in second; + const firstValue = first[key]; + const secondValue = second[key]; if (firstHasKey && secondHasKey) { - if (isObjectNotArray(first[key]) && isObjectNotArray(second[key])) { + if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) { // object type - acc[key] = deepMerge(first[key], second[key]); + acc[key] = deepMerge(firstValue, secondValue); } else { // value type - acc[key] = second[key]; + acc[key] = secondValue; } } else if (firstHasKey) { - acc[key] = first[key]; + acc[key] = firstValue; } else { - acc[key] = second[key]; + acc[key] = secondValue; } return acc; diff --git a/packages/experimental-utils/src/index.ts b/packages/experimental-utils/src/index.ts index 137aa956cfcb..98b643c344a1 100644 --- a/packages/experimental-utils/src/index.ts +++ b/packages/experimental-utils/src/index.ts @@ -1,8 +1,9 @@ import * as ESLintUtils from './eslint-utils'; import * as TSESLint from './ts-eslint'; import * as TSESLintScope from './ts-eslint-scope'; +import * as JSONSchema from './json-schema'; -export { ESLintUtils, TSESLint, TSESLintScope }; +export { ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; // for convenience's sake - export the types directly from here so consumers // don't need to reference/install both packages in their code diff --git a/packages/experimental-utils/src/json-schema.ts b/packages/experimental-utils/src/json-schema.ts new file mode 100644 index 000000000000..af00c2d586a8 --- /dev/null +++ b/packages/experimental-utils/src/json-schema.ts @@ -0,0 +1 @@ +export * from 'json-schema'; diff --git a/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts b/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts index a31645b12285..c53ceb69f7a1 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts @@ -8,7 +8,7 @@ import { } from './Options'; interface PatternVisitor extends Visitor { - options: any; + options: PatternVisitorOptions; scopeManager: ScopeManager; parent?: TSESTree.Node; rightHandNodes: TSESTree.Node[]; @@ -27,7 +27,7 @@ interface PatternVisitor extends Visitor { const PatternVisitor = ESLintPatternVisitor as { new ( options: PatternVisitorOptions, - rootPattern: any, + rootPattern: TSESTree.BaseNode, callback: PatternVisitorCallback, ): PatternVisitor; diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts index b430047c01ec..aa0cbc8d3e97 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { TSESTree } from '@typescript-eslint/typescript-estree'; import ESLintReferencer from 'eslint-scope/lib/referencer'; import { diff --git a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts index 71b8dbf42a4c..6ec3f1ab88d2 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */ import { TSESTree } from '@typescript-eslint/typescript-estree'; import { diff --git a/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/packages/experimental-utils/src/ts-eslint/CLIEngine.ts index 0a64a3d67344..46fc36b32ba3 100644 --- a/packages/experimental-utils/src/ts-eslint/CLIEngine.ts +++ b/packages/experimental-utils/src/ts-eslint/CLIEngine.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-namespace, no-redeclare */ +/* eslint-disable @typescript-eslint/no-namespace */ import { CLIEngine as ESLintCLIEngine } from 'eslint'; import { Linter } from './Linter'; @@ -15,15 +15,15 @@ interface CLIEngine { executeOnText(text: string, filename?: string): CLIEngine.LintReport; - addPlugin(name: string, pluginObject: any): void; + addPlugin(name: string, pluginObject: unknown): void; isPathIgnored(filePath: string): boolean; getFormatter(format?: string): CLIEngine.Formatter; getRules< - TMessageIds extends string = any, - TOptions extends readonly any[] = any[], + TMessageIds extends string = string, + TOptions extends readonly unknown[] = unknown[], // for extending base rules TRuleListener extends RuleListener = RuleListener >(): Map>; @@ -32,7 +32,7 @@ interface CLIEngine { namespace CLIEngine { export interface Options { allowInlineConfig?: boolean; - baseConfig?: false | { [name: string]: any }; + baseConfig?: false | { [name: string]: unknown }; cache?: boolean; cacheFile?: string; cacheLocation?: string; diff --git a/packages/experimental-utils/src/ts-eslint/Linter.ts b/packages/experimental-utils/src/ts-eslint/Linter.ts index dde85a07f2b4..93c5565ff4d6 100644 --- a/packages/experimental-utils/src/ts-eslint/Linter.ts +++ b/packages/experimental-utils/src/ts-eslint/Linter.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-namespace, no-redeclare */ +/* eslint-disable @typescript-eslint/no-namespace */ import { TSESTree, ParserServices } from '@typescript-eslint/typescript-estree'; import { Linter as ESLintLinter } from 'eslint'; @@ -34,7 +34,7 @@ interface Linter { getSourceCode(): SourceCode; - defineRule( + defineRule( name: string, rule: { meta?: RuleModule['meta']; @@ -42,14 +42,14 @@ interface Linter { }, ): void; - defineRules( + defineRules( rules: Record>, ): void; - getRules(): Map< - string, - RuleModule - >; + getRules< + TMessageIds extends string, + TOptions extends readonly unknown[] + >(): Map>; defineParser(name: string, parser: Linter.ParserModule): void; } @@ -58,9 +58,7 @@ namespace Linter { export type Severity = 0 | 1 | 2; export type RuleLevel = Severity | 'off' | 'warn' | 'error'; - export interface RuleLevelAndOptions extends Array { - 0: RuleLevel; - } + export type RuleLevelAndOptions = [RuleLevel, ...unknown[]]; export interface Config { rules?: { @@ -68,7 +66,7 @@ namespace Linter { }; parser?: string; parserOptions?: ParserOptions; - settings?: { [name: string]: any }; + settings?: { [name: string]: unknown }; env?: { [name: string]: boolean }; globals?: { [name: string]: boolean }; } @@ -109,10 +107,10 @@ namespace Linter { export type ParserModule = | { - parse(text: string, options?: any): TSESTree.Program; + parse(text: string, options?: unknown): TSESTree.Program; } | { - parseForESLint(text: string, options?: any): ESLintParseResult; + parseForESLint(text: string, options?: unknown): ESLintParseResult; }; export interface ESLintParseResult { diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index bc546e25caee..0175309d752f 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -1,5 +1,5 @@ import { ParserServices, TSESTree } from '@typescript-eslint/typescript-estree'; -import { JSONSchema4 } from 'json-schema'; +import { JSONSchema4 } from '../json-schema'; import { AST } from './AST'; import { Linter } from './Linter'; import { Scope } from './Scope'; @@ -109,7 +109,7 @@ interface ReportDescriptorBase { /** * The parameters for the message string associated with `messageId`. */ - data?: Record; + data?: Record; /** * The fixer function. */ @@ -142,7 +142,7 @@ type ReportDescriptor = ReportDescriptorBase< interface RuleContext< TMessageIds extends string, - TOptions extends readonly any[] + TOptions extends readonly unknown[] > { /** * The rule ID. @@ -383,7 +383,7 @@ interface RuleListener { interface RuleModule< TMessageIds extends string, - TOptions extends readonly any[], + TOptions extends readonly unknown[], // for extending base rules TRuleListener extends RuleListener = RuleListener > { diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/experimental-utils/src/ts-eslint/RuleTester.ts index 6cccf66ed4f3..863d0c076f23 100644 --- a/packages/experimental-utils/src/ts-eslint/RuleTester.ts +++ b/packages/experimental-utils/src/ts-eslint/RuleTester.ts @@ -6,12 +6,12 @@ import { RuleTester as ESLintRuleTester } from 'eslint'; import { ParserOptions } from './ParserOptions'; import { RuleModule } from './Rule'; -interface ValidTestCase> { +interface ValidTestCase> { code: string; options?: TOptions; filename?: string; parserOptions?: ParserOptions; - settings?: Record; + settings?: Record; parser?: string; globals?: Record; env?: { @@ -21,7 +21,7 @@ interface ValidTestCase> { interface InvalidTestCase< TMessageIds extends string, - TOptions extends Readonly + TOptions extends Readonly > extends ValidTestCase { errors: TestCaseError[]; output?: string | null; @@ -29,7 +29,7 @@ interface InvalidTestCase< interface TestCaseError { messageId: TMessageIds; - data?: Record; + data?: Record; type?: AST_NODE_TYPES | AST_TOKEN_TYPES; line?: number; column?: number; @@ -39,7 +39,7 @@ interface TestCaseError { interface RunTests< TMessageIds extends string, - TOptions extends Readonly + TOptions extends Readonly > { // RuleTester.run also accepts strings for valid cases valid: (ValidTestCase | string)[]; @@ -51,7 +51,7 @@ interface RuleTesterConfig { parserOptions?: ParserOptions; } declare interface RuleTester { - run>( + run>( name: string, rule: RuleModule, tests: RunTests, diff --git a/packages/experimental-utils/src/ts-eslint/Scope.ts b/packages/experimental-utils/src/ts-eslint/Scope.ts index e6922d9df190..6a85042f2b89 100644 --- a/packages/experimental-utils/src/ts-eslint/Scope.ts +++ b/packages/experimental-utils/src/ts-eslint/Scope.ts @@ -93,7 +93,7 @@ namespace Scope { | TSESTree.ArrowFunctionExpression; parent: null; } - | { type: 'TDZ'; node: any; parent: null } + | { type: 'TDZ'; node: unknown; parent: null } | { type: 'Variable'; node: TSESTree.VariableDeclarator; diff --git a/packages/experimental-utils/src/ts-eslint/SourceCode.ts b/packages/experimental-utils/src/ts-eslint/SourceCode.ts index 2fb2e0b3cab9..ac8331166063 100644 --- a/packages/experimental-utils/src/ts-eslint/SourceCode.ts +++ b/packages/experimental-utils/src/ts-eslint/SourceCode.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-namespace, no-redeclare */ +/* eslint-disable @typescript-eslint/no-namespace */ import { ParserServices, TSESTree } from '@typescript-eslint/typescript-estree'; import { SourceCode as ESLintSourceCode } from 'eslint'; diff --git a/packages/parser/package.json b/packages/parser/package.json index 0d00cd9f9e24..c11e9cb790aa 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -47,6 +47,8 @@ "eslint-visitor-keys": "^1.0.0" }, "devDependencies": { - "@typescript-eslint/shared-fixtures": "1.13.0" + "@types/glob": "^7.1.1", + "@typescript-eslint/shared-fixtures": "1.13.0", + "glob": "^7.1.4" } } diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 165d560583f2..6c7e5a38428f 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -14,12 +14,21 @@ import { visitorKeys as childVisitorKeys } from './visitor-keys'; * @param {Function} define The original Scope#__define method. * @returns {Function} The override function. */ -function overrideDefine(define: any) { - return /* @this {Scope} */ function(this: any, node: any, definition: any) { +function overrideDefine( + define: (node: TSESTree.Node, def: TSESLintScope.Definition) => void, +) { + return function( + this: TSESLintScope.Scope, + node: TSESTree.Node, + definition: TSESLintScope.Definition, + ) { define.call(this, node, definition); // Set `variable.eslintUsed` to tell ESLint that the variable is exported. - const variable = this.set.get(node.name); + const variable = + 'name' in node && + typeof node.name === 'string' && + this.set.get(node.name); if (variable) { variable.eslintUsed = true; } @@ -29,7 +38,7 @@ function overrideDefine(define: any) { class PatternVisitor extends TSESLintScope.PatternVisitor { constructor( options: TSESLintScope.PatternVisitorOptions, - rootPattern: any, + rootPattern: TSESTree.BaseNode, callback: TSESLintScope.PatternVisitorCallback, ) { super(options, rootPattern, callback); @@ -86,7 +95,10 @@ class PatternVisitor extends TSESLintScope.PatternVisitor { class Referencer extends TSESLintScope.Referencer { protected typeMode: boolean; - constructor(options: any, scopeManager: ScopeManager) { + constructor( + options: TSESLintScope.ScopeManagerOptions, + scopeManager: ScopeManager, + ) { super(options, scopeManager); this.typeMode = false; } @@ -115,7 +127,6 @@ class Referencer extends TSESLintScope.Referencer { visitor.visit(node); if (options.processRightHandNodes) { - // @ts-ignore visitor.rightHandNodes.forEach(this.visit, this); } } @@ -155,7 +166,6 @@ class Referencer extends TSESLintScope.Referencer { const def = defs[i]; if ( def.type === 'FunctionName' && - // @ts-ignore def.node.type === 'TSDeclareFunction' ) { defs.splice(i, 1); @@ -832,7 +842,10 @@ class Referencer extends TSESLintScope.Referencer { } } -export function analyzeScope(ast: any, parserOptions: ParserOptions) { +export function analyzeScope( + ast: TSESTree.Program, + parserOptions: ParserOptions, +) { const options = { ignoreEval: true, optimistic: false, diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 11a68518d73b..fb5142f9b37d 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -4,6 +4,7 @@ import { parseAndGenerateServices, ParserServices, TSESTreeOptions, + TSESTree, } from '@typescript-eslint/typescript-estree'; import { analyzeScope } from './analyze-scope'; import { simpleTraverse } from './simple-traverse'; @@ -15,7 +16,11 @@ type ParserOptions = TSESLint.ParserOptions; const packageJSON = require('../package.json'); interface ParseForESLintResult { - ast: any; + ast: TSESTree.Program & { + range?: [number, number]; + tokens?: TSESTree.Token[]; + comments?: TSESTree.Comment[]; + }; services: ParserServices; visitorKeys: typeof visitorKeys; scopeManager: ReturnType; @@ -93,6 +98,7 @@ export function parseForESLint( // Function#body cannot be null in ESTree spec. case 'FunctionExpression': if (!node.body) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any node.type = `TSEmptyBody${node.type}` as any; } break; diff --git a/packages/parser/src/simple-traverse.ts b/packages/parser/src/simple-traverse.ts index 8cc007058add..10f58918799c 100644 --- a/packages/parser/src/simple-traverse.ts +++ b/packages/parser/src/simple-traverse.ts @@ -1,6 +1,7 @@ import { TSESTree } from '@typescript-eslint/typescript-estree'; import { visitorKeys } from './visitor-keys'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any function isValidNode(x: any): x is TSESTree.Node { return x !== null && typeof x === 'object' && typeof x.type === 'string'; } @@ -37,7 +38,7 @@ class SimpleTraverser { } for (const key of keys) { - const childOrChildren = node[key as keyof typeof node]; + const childOrChildren = node[key as keyof TSESTree.Node]; if (Array.isArray(childOrChildren)) { for (const child of childOrChildren) { diff --git a/packages/parser/tests/lib/basics.ts b/packages/parser/tests/lib/basics.ts index 4b237a7dc2a3..d526745e341b 100644 --- a/packages/parser/tests/lib/basics.ts +++ b/packages/parser/tests/lib/basics.ts @@ -45,6 +45,7 @@ export const Price: React.SFC = function Price(props) {} node, message: 'called on {{name}}', data: { name }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); }, }; diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index 9545633cd6e3..0a00ef5ad155 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -20,6 +20,8 @@ describe('parser', () => { const code = 'const valid = true;'; const spy = jest.spyOn(typescriptESTree, 'parseAndGenerateServices'); const spyScope = jest.spyOn(scope, 'analyzeScope'); + // intentionally wrong sourceType + // eslint-disable-next-line @typescript-eslint/no-explicit-any parseForESLint(code, { sourceType: 'foo' as any }); expect(spy).toHaveBeenCalledWith(code, { ecmaFeatures: {}, @@ -66,6 +68,8 @@ describe('parser', () => { it('Syntax should contain a frozen object of AST_NODE_TYPES', () => { expect(Syntax).toEqual(AST_NODE_TYPES); expect( + // intentionally breaking the readonly + // eslint-disable-next-line @typescript-eslint/no-explicit-any () => ((Syntax as any).ArrayExpression = 'foo'), ).toThrowErrorMatchingInlineSnapshot( `"Cannot assign to read only property 'ArrayExpression' of object '#'"`, diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index 6d9587c2f98a..e7aab1d9951a 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + /** Reference resolver. */ export class ReferenceResolver { map: Map; diff --git a/packages/parser/tests/tools/test-utils.ts b/packages/parser/tests/tools/test-utils.ts index 455936321dae..1ce769a521bb 100644 --- a/packages/parser/tests/tools/test-utils.ts +++ b/packages/parser/tests/tools/test-utils.ts @@ -1,3 +1,4 @@ +import { TSESTree } from '@typescript-eslint/typescript-estree'; import * as parser from '../../src/parser'; import { ParserOptions } from '../../src/parser-options'; import { getScopeTree } from './scope-analysis'; @@ -14,10 +15,10 @@ const defaultConfig = { /** * Returns a raw copy of the given AST - * @param {Object} ast the AST object - * @returns {Object} copy of the AST object + * @param ast the AST object + * @returns copy of the AST object */ -function getRaw(ast: any) { +function getRaw(ast: TSESTree.Program) { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { @@ -31,11 +32,14 @@ function getRaw(ast: any) { /** * Returns a function which can be used as the callback of a Jest test() block, * and which performs an assertion on the snapshot for the given code and config. - * @param {string} code The source code to parse - * @param {ParserOptions} config the parser configuration - * @returns {Function} callback for Jest test() block + * @param code The source code to parse + * @param config the parser configuration + * @returns callback for Jest test() block */ -export function createSnapshotTestBlock(code: any, config: ParserOptions = {}) { +export function createSnapshotTestBlock( + code: string, + config: ParserOptions = {}, +) { config = Object.assign({}, defaultConfig, config); /** @@ -66,9 +70,9 @@ export function createSnapshotTestBlock(code: any, config: ParserOptions = {}) { /** * Returns a function which can be used as the callback of a Jest test() block, * and which performs an assertion on the snapshot for the given code and config. - * @param {string} code The source code to parse - * @param {ParserOptions} config the parser configuration - * @returns {Function} callback for Jest test() block + * @param code The source code to parse + * @param config the parser configuration + * @returns callback for Jest test() block */ export function createScopeSnapshotTestBlock( code: string, @@ -102,11 +106,10 @@ export function createScopeSnapshotTestBlock( } /** - * @param {string} code The code being parsed - * @param {ParserOptions} config The configuration object for the parser - * @returns {void} + * @param code The code being parsed + * @param config The configuration object for the parser */ -export function testServices(code: string, config: ParserOptions = {}) { +export function testServices(code: string, config: ParserOptions = {}): void { config = Object.assign({}, defaultConfig, config); const services = parser.parseForESLint(code, config).services; @@ -117,8 +120,8 @@ export function testServices(code: string, config: ParserOptions = {}) { } export function formatSnapshotName( - filename: any, - fixturesDir: any, + filename: string, + fixturesDir: string, fileExtension = '.js', ) { return `fixtures/${filename diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 9e39fd352cd2..fabdc79810cc 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -42,10 +42,21 @@ }, "dependencies": { "lodash.unescape": "4.0.1", - "semver": "5.5.0" + "semver": "^6.2.0" }, "devDependencies": { + "@babel/code-frame": "7.0.0", + "@babel/parser": "7.3.2", "@babel/types": "^7.3.2", - "@typescript-eslint/shared-fixtures": "1.13.0" + "@types/babel-code-frame": "^6.20.1", + "@types/glob": "^7.1.1", + "@types/lodash.isplainobject": "^4.0.4", + "@types/lodash.unescape": "^4.0.4", + "@types/semver": "^6.0.1", + "@typescript-eslint/shared-fixtures": "1.13.0", + "babel-code-frame": "^6.26.0", + "glob": "^7.1.4", + "lodash.isplainobject": "4.0.6", + "typescript": "*" } } diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 25d291dee4c2..9cb2bdc974a8 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -4,7 +4,7 @@ import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; import { Extra } from './parser-options'; -export default function astConverter( +export function astConverter( ast: SourceFile, extra: Extra, shouldPreserveNodeMaps: boolean, @@ -13,8 +13,11 @@ export default function astConverter( * The TypeScript compiler produced fundamental parse errors when parsing the * source. */ - if ((ast as any).parseDiagnostics.length) { - throw convertError((ast as any).parseDiagnostics[0]); + // internal typescript api... + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const parseDiagnostics = (ast as any).parseDiagnostics; + if (parseDiagnostics.length) { + throw convertError(parseDiagnostics[0]); } /** diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index cdf6b184150f..dedae68dd172 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,3 +1,5 @@ +// There's lots of funny stuff due to the typing of ts.Node +/* eslint-disable @typescript-eslint/no-explicit-any */ import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports import { canContainDirective, @@ -2509,7 +2511,7 @@ export class Converter { }); } case SyntaxKind.AbstractKeyword: { - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.TSAbstractKeyword, }); } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 3ea42a02a85e..f1666635b11c 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -97,7 +97,7 @@ const TOKEN_TO_TEXT: { readonly [P in ts.SyntaxKind]?: string } = { export function isAssignmentOperator( operator: ts.Token, ): boolean { - return ASSIGNMENT_OPERATORS.indexOf(operator.kind) > -1; + return ASSIGNMENT_OPERATORS.includes(operator.kind); } /** @@ -108,7 +108,7 @@ export function isAssignmentOperator( export function isLogicalOperator( operator: ts.Token, ): boolean { - return LOGICAL_OPERATORS.indexOf(operator.kind) > -1; + return LOGICAL_OPERATORS.includes(operator.kind); } /** @@ -196,6 +196,8 @@ export function isJSDocComment(node: ts.Node): boolean { * @returns the binary expression type */ export function getBinaryExpressionType( + // can be any operator + // eslint-disable-next-line @typescript-eslint/no-explicit-any operator: ts.Token, ): | AST_NODE_TYPES.AssignmentExpression @@ -444,6 +446,8 @@ export function isOptional(node: { * @param token the ts.Token * @returns the token type */ +// ts.Node types are ugly +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function getTokenType(token: any): AST_TOKEN_TYPES { // Need two checks for keywords since some are also identifiers if (token.originalKeywordKind) { @@ -668,7 +672,8 @@ export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { // If we have a token or node that has a non-zero width, it must have tokens. // Note: getWidth() does not take trivia into account. return n.kind === SyntaxKind.EndOfFileToken - ? !!(n as any).jsDoc + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + !!(n as any).jsDoc : n.getWidth(ast) !== 0; } diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 585effea268e..c224b7da5659 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -41,7 +41,7 @@ export interface TSESTreeOptions { // handle the undefined type in the get method export interface ParserWeakMap { get(key: TKey): TValue; - has(key: any): boolean; + has(key: unknown): boolean; } export interface ParserServices { diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 81825267fcb6..aed8f04b8d27 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -1,6 +1,6 @@ import semver from 'semver'; import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports -import convert from './ast-converter'; +import { astConverter } from './ast-converter'; import { convertError } from './convert'; import { firstDefined } from './node-utils'; import { Extra, TSESTreeOptions, ParserServices } from './parser-options'; @@ -50,7 +50,7 @@ function resetExtra(): void { strict: false, jsx: false, useJSXTextNode: false, - log: console.log, + log: console.log, // eslint-disable-line no-console projects: [], errorOnUnknownASTType: false, errorOnTypeScriptSyntacticAndSemanticIssues: false, @@ -312,6 +312,7 @@ export function parse( /** * Ensure the source code is a string, and store a reference to it */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (typeof code !== 'string' && !((code as any) instanceof String)) { code = String(code); } @@ -339,7 +340,7 @@ export function parse( /** * Convert the TypeScript AST to an ESTree-compatible one */ - const { estree } = convert(ast, extra, false); + const { estree } = astConverter(ast, extra, false); return estree as AST; } @@ -353,6 +354,7 @@ export function parseAndGenerateServices< /** * Ensure the source code is a string, and store a reference to it */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any if (typeof code !== 'string' && !((code as any) instanceof String)) { code = String(code); } @@ -397,7 +399,7 @@ export function parseAndGenerateServices< * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve * mappings between converted and original AST nodes */ - const { estree, astMaps } = convert(ast, extra, shouldPreserveNodeMaps); + const { estree, astMaps } = astConverter(ast, extra, shouldPreserveNodeMaps); /** * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, * there may be other syntactic or semantic issues in the code that we can optionally report on. diff --git a/packages/typescript-estree/src/semantic-errors.ts b/packages/typescript-estree/src/semantic-errors.ts index f31eb6340682..c580697a185f 100644 --- a/packages/typescript-estree/src/semantic-errors.ts +++ b/packages/typescript-estree/src/semantic-errors.ts @@ -45,7 +45,7 @@ export function getFirstSemanticOrSyntacticError( * and log a a warning. */ /* istanbul ignore next */ - console.warn(`Warning From TSC: "${e.message}`); + console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console /* istanbul ignore next */ return undefined; } diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 641af07a77a4..855355fe689b 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -146,6 +146,8 @@ export function calculateProjectParserOptions( // ensure fileWatchers aren't created for directories watchCompilerHost.watchDirectory = () => noopFileWatcher; + // we're using internal typescript APIs which aren't on the types + /* eslint-disable @typescript-eslint/no-explicit-any */ // allow files with custom extensions to be included in program (uses internal ts api) const oldOnDirectoryStructureHostCreate = (watchCompilerHost as any) .onCachedDirectoryStructureHostCreate; @@ -171,6 +173,7 @@ export function calculateProjectParserOptions( ); oldOnDirectoryStructureHostCreate(host); }; + /* eslint-enable @typescript-eslint/no-explicit-any */ // create program const programWatch = ts.createWatchProgram(watchCompilerHost); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 84fb70f5b815..43c23ce44d7c 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -6,6 +6,7 @@ import * as parseUtils from './utils'; function createError(message: string, line: number, column: number) { // Construct an error similar to the ones thrown by Babylon. const error = new SyntaxError(`${message} (${line}:${column})`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any (error as any).loc = { line, column, @@ -73,7 +74,8 @@ export function parse(text: string, opts: ASTComparisonParseOptions) { * Always return a consistent interface, there will be times when we expect both * parsers to fail to parse the invalid source. */ - const result: any = { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const result: { parseError: any | null; ast: any | null } = { parseError: null, ast: null, }; diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 678f3301e80f..43be2143e785 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,3 +1,5 @@ +// bablyon types are something we don't really care about +/* eslint-disable @typescript-eslint/no-explicit-any */ import { AST_NODE_TYPES } from '../../src/ts-estree'; import isPlainObject from 'lodash.isplainobject'; diff --git a/packages/typescript-estree/tests/lib/convert.ts b/packages/typescript-estree/tests/lib/convert.ts index d4c694379cb8..4a5ac51be55f 100644 --- a/packages/typescript-estree/tests/lib/convert.ts +++ b/packages/typescript-estree/tests/lib/convert.ts @@ -1,3 +1,5 @@ +// deeplyCopy is private internal +/* eslint-disable @typescript-eslint/no-explicit-any */ import { Converter } from '../../src/convert'; import ts from 'typescript'; diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index 3c34f7055565..3d8dfe222e45 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -14,7 +14,7 @@ describe('parse()', () => { describe('modules', () => { it('should have correct column number when strict mode error occurs', () => { try { - parser.parse('function fn(a, a) {\n}', { sourceType: 'module' } as any); + parser.parse('function fn(a, a) {\n}'); } catch (err) { expect(err.column).toEqual(16); } @@ -37,6 +37,8 @@ describe('parse()', () => { }); describe('non string code', () => { + // testing a non string code.. + // eslint-disable-next-line @typescript-eslint/no-explicit-any const code = (12345 as any) as string; const config: TSESTreeOptions = { comment: true, @@ -58,7 +60,7 @@ describe('parse()', () => { describe('loggerFn should be propagated to ast-converter', () => { it('output tokens, comments, locs, and ranges when called with those options', () => { - const spy = jest.spyOn(astConverter, 'default'); + const spy = jest.spyOn(astConverter, 'astConverter'); const loggerFn = jest.fn(() => true); diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 189816f08c64..3f0a69b30537 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -8,7 +8,10 @@ import { formatSnapshotName, parseCodeAndGenerateServices, } from '../../tools/test-utils'; -import { parseAndGenerateServices } from '../../src/parser'; +import { + parseAndGenerateServices, + ParseAndGenerateServicesResult, +} from '../../src/parser'; import { TSESTree } from '../../src/ts-estree'; const FIXTURES_DIR = './tests/fixtures/semanticInfo'; @@ -169,8 +172,10 @@ describe('semanticInfo', () => { // get array node (ast shape validated by snapshot) // node is defined in other file than the parsed one - const arrayBoundName = (parseResult.ast as any).body[1].expression.callee - .object; + const arrayBoundName = (((parseResult.ast + .body[1] as TSESTree.ExpressionStatement) + .expression as TSESTree.CallExpression) + .callee as TSESTree.MemberExpression).object as TSESTree.Identifier; expect(arrayBoundName.name).toBe('arr'); expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); @@ -178,10 +183,10 @@ describe('semanticInfo', () => { arrayBoundName, ); expect(tsArrayBoundName).toBeDefined(); - checkNumberArrayType(checker, tsArrayBoundName!); + checkNumberArrayType(checker, tsArrayBoundName); expect( - parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayBoundName!), + parseResult.services.tsNodeToESTreeNodeMap!.get(tsArrayBoundName), ).toBe(arrayBoundName); }); @@ -196,7 +201,8 @@ describe('semanticInfo', () => { const checker = parseResult.services.program!.getTypeChecker(); // get bound name - const boundName = (parseResult.ast as any).body[0].declarations[0].id; + const boundName = (parseResult.ast.body[0] as TSESTree.VariableDeclaration) + .declarations[0].id as TSESTree.Identifier; expect(boundName.name).toBe('x'); const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( @@ -204,9 +210,9 @@ describe('semanticInfo', () => { ); expect(tsBoundName).toBeDefined(); - checkNumberArrayType(checker, tsBoundName!); + checkNumberArrayType(checker, tsBoundName); - expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName!)).toBe( + expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( boundName, ); }); @@ -256,13 +262,17 @@ describe('semanticInfo', () => { }); }); -function testIsolatedFile(parseResult: any) { +function testIsolatedFile( + parseResult: ParseAndGenerateServicesResult, +) { // get type checker expect(parseResult).toHaveProperty('services.program.getTypeChecker'); const checker = parseResult.services.program!.getTypeChecker(); // get number node (ast shape validated by snapshot) - const arrayMember = (parseResult.ast as any).body[0].declarations[0].init + const declaration = (parseResult.ast.body[0] as TSESTree.VariableDeclaration) + .declarations[0]; + const arrayMember = (declaration.init! as TSESTree.ArrayExpression) .elements[0]; expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); @@ -275,9 +285,11 @@ function testIsolatedFile(parseResult: any) { expect((tsArrayMember as ts.NumericLiteral).text).toBe('3'); // get type of TS node - const arrayMemberType: any = checker.getTypeAtLocation(tsArrayMember); + const arrayMemberType = checker.getTypeAtLocation(tsArrayMember); expect(arrayMemberType.flags).toBe(ts.TypeFlags.NumberLiteral); - expect(arrayMemberType.value).toBe(3); + // using an internal api + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect((arrayMemberType as any).value).toBe(3); // make sure it maps back to original ESTree node expect(parseResult).toHaveProperty('services.tsNodeToESTreeNodeMap'); @@ -286,7 +298,7 @@ function testIsolatedFile(parseResult: any) { ); // get bound name - const boundName = (parseResult.ast as any).body[0].declarations[0].id; + const boundName = declaration.id as TSESTree.Identifier; expect(boundName.name).toBe('x'); const tsBoundName = parseResult.services.esTreeNodeToTSNodeMap!.get( boundName, diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index f1c587df237b..16210df104fb 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -6,7 +6,7 @@ import { TSESTreeOptions } from '../src/parser-options'; * @param {Object} ast the AST object * @returns {Object} copy of the AST object */ -export function getRaw(ast: any) { +export function getRaw(ast: parser.TSESTree.Program) { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { diff --git a/tests/integration/utils/generate-package-json.js b/tests/integration/utils/generate-package-json.js index bf173d5e35c4..1f6af28df63e 100644 --- a/tests/integration/utils/generate-package-json.js +++ b/tests/integration/utils/generate-package-json.js @@ -1,4 +1,5 @@ const fs = require('fs'); +// eslint-disable-next-line import/no-absolute-path const rootPackageJSON = require('/usr/root-package.json'); /** diff --git a/yarn.lock b/yarn.lock index 3141d7b2a4fb..5924927ec6d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,41 +2,48 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0", "@babel/code-frame@^7.0.0": +"@babel/code-frame@7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.4.tgz#84055750b05fcd50f9915a826b44fa347a825250" - integrity sha512-lQgGX3FPRgbz2SKmhMtYgJvVzGZrmjaF4apZ2bLwofAKiSjxU0drPh4S/VasyYXwaTs+A1gvQ45BN8SQJzHsQQ== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" - "@babel/helpers" "^7.4.4" - "@babel/parser" "^7.4.4" + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.1.0": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" + integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" + "@babel/helpers" "^7.5.5" + "@babel/parser" "^7.5.5" "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" - lodash "^4.17.11" + lodash "^4.17.13" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" - integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== +"@babel/generator@^7.4.0", "@babel/generator@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" + integrity sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ== dependencies: - "@babel/types" "^7.4.4" + "@babel/types" "^7.5.5" jsesc "^2.5.1" - lodash "^4.17.11" + lodash "^4.17.13" source-map "^0.5.0" trim-right "^1.0.1" @@ -68,19 +75,19 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helpers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" - integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== +"@babel/helpers@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" + integrity sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g== dependencies: "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" "@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== dependencies: chalk "^2.0.0" esutils "^2.0.2" @@ -91,10 +98,10 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.2.tgz#95cdeddfc3992a6ca2a1315191c1679ca32c55cd" integrity sha512-QzNUC2RO1gadg+fs21fi0Uu0OuGNzRKEmgCxoLNzbCdoprLwjfmZwzUrpUNfJPaVRwBpDY47A17yYEGWyRelnQ== -"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" - integrity sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" + integrity sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g== "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" @@ -103,10 +110,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/runtime@^7.2.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.4.tgz#dc2e34982eb236803aa27a07fea6857af1b9171d" - integrity sha512-w0+uT71b6Yi7i5SE0co4NioIpSYS6lLiXvCzWzGSKvpK5vdQtCbICHMj+gbAKAOtxiV6HsVh/MBdaF9EQ6faSg== +"@babel/runtime@^7.2.0", "@babel/runtime@^7.4.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" + integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== dependencies: regenerator-runtime "^0.13.2" @@ -119,28 +126,28 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" - integrity sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" + integrity sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/parser" "^7.5.5" + "@babel/types" "^7.5.5" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.11" + lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.2", "@babel/types@^7.4.0", "@babel/types@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" - integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.2", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" + integrity sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw== dependencies: esutils "^2.0.2" - lodash "^4.17.11" + lodash "^4.17.13" to-fast-properties "^2.0.0" "@cnakazawa/watch@^1.0.3": @@ -151,159 +158,229 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@commitlint/cli@^7.1.2", "@commitlint/cli@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.5.2.tgz#2475cd8f7ed3b2f9c2ab96c06bc24d61d23f8716" - integrity sha512-UQdW/wNb+XeANoYYLyuKEDIfWKSzdhJkPQZ8ie/IjfMNnsP+B23bkX4Ati+6U8zgz0yyngoxWl+3lfExiIL4hQ== +"@commitlint/cli@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.1.0.tgz#a3d4236c0ac961d7026a53d728b179c696d6a045" + integrity sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig== dependencies: - "@commitlint/format" "^7.5.0" - "@commitlint/lint" "^7.5.2" - "@commitlint/load" "^7.5.0" - "@commitlint/read" "^7.5.0" + "@commitlint/format" "^8.1.0" + "@commitlint/lint" "^8.1.0" + "@commitlint/load" "^8.1.0" + "@commitlint/read" "^8.1.0" babel-polyfill "6.26.0" chalk "2.3.1" - get-stdin "5.0.1" - lodash "4.17.11" + get-stdin "7.0.0" + lodash "4.17.14" meow "5.0.0" - resolve-from "4.0.0" - resolve-global "0.1.0" + resolve-from "5.0.0" + resolve-global "1.0.0" -"@commitlint/config-conventional@^7.1.2": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-7.5.0.tgz#3afd4e3e34e5c2f6ec6af03e78ae924fed883ce7" - integrity sha512-odLgBfQ5xntFAmMfAmDY2C4EWhW+cSTbvbsRS7seb55DCa3IaxxSHHC9eXrR+hN/BdUT5vqAxdX1PkR996sq9Q== +"@commitlint/config-conventional@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-8.1.0.tgz#ba61fbf0ad4df52da2b5ee3034470371a2cbf039" + integrity sha512-/JY+FNBnrT91qzDVIoV1Buiigvj7Le7ezFw+oRqu0nYREX03k7xnaG/7t7rUSvm7hM6dnLSOlaUsevjgMI9AEw== -"@commitlint/ensure@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-7.5.2.tgz#57bb7dcbf1e9913e27c3b294325d0d68dd14cebf" - integrity sha512-ZMJKHhSJC789chKy0kWp8EWbCpLPy6vKa+fopUVx+tWL7H8AeBbibXlqAnybg+HWNcb/RD7ORROx0IsgrK4IYA== +"@commitlint/ensure@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.1.0.tgz#6c669f85c3005ed15c8141d83cf5312c43001613" + integrity sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ== dependencies: - lodash "4.17.11" + lodash "4.17.14" -"@commitlint/execute-rule@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-7.5.0.tgz#c9cfbab71eb962e1c46e78d76375e32754ab1e38" - integrity sha512-K66aoly8mxSHmBA/Y8bKSPPcCAR4GpJEsvHaLDYOG7GsyChu8NgCD53L8GUqPW8lBCWwnmCiSL+RlOkNHJ0Gag== - dependencies: - babel-runtime "6.26.0" +"@commitlint/execute-rule@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz#e8386bd0836b3dcdd41ebb9d5904bbeb447e4715" + integrity sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg== -"@commitlint/format@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-7.5.0.tgz#57a2b92dc58a3409b2be67c4c8c10bd1b28e9fe8" - integrity sha512-DEeQXfTLUm9kARliCBfw3SlQRAYjK2aXeRAUMs1HPhLA2tjNFFGv6LOpFFNdiu/WV+o1ojcgIvBBjpHaVT+Tvw== +"@commitlint/format@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.1.0.tgz#c3f3ca78bb74cbc1cce1368c0974b0cb8f31b98e" + integrity sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q== dependencies: - babel-runtime "^6.23.0" chalk "^2.0.1" -"@commitlint/is-ignored@^7.5.1": - version "7.5.1" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-7.5.1.tgz#c4f7ffc1c8b4cf9dc3204d22ef8e78ff82536d67" - integrity sha512-8JZCgy6bWSnjOT5cTTiyEAGp+Y4+5CUknhVbyiPxTRbjy6yF0aMKs1gMTfHrNHTKsasgmkCyPQd4C2eOPceuKA== +"@commitlint/is-ignored@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz#c0583fa3c641b2d4898be1443e70e9c467429de2" + integrity sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg== dependencies: - semver "5.6.0" + "@types/semver" "^6.0.1" + semver "6.1.1" -"@commitlint/lint@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-7.5.2.tgz#26cb819c74f8770413c4f6ef1e7abf1b739eda77" - integrity sha512-DY/UfGFDquMno+5c6+tE50rMxpjdQK3CRG+nktgYlVz1UAqeUD+bRc3pvX5HwAsuGvyDrWAjtszHtEDeYJKcjw== +"@commitlint/lint@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.1.0.tgz#ad10f4885c06f14c71de11dcd6bf2ca54a395141" + integrity sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ== dependencies: - "@commitlint/is-ignored" "^7.5.1" - "@commitlint/parse" "^7.5.0" - "@commitlint/rules" "^7.5.2" + "@commitlint/is-ignored" "^8.1.0" + "@commitlint/parse" "^8.1.0" + "@commitlint/rules" "^8.1.0" babel-runtime "^6.23.0" - lodash "4.17.11" + lodash "4.17.14" -"@commitlint/load@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-7.5.0.tgz#2b225b97d631c2235d8b2084bc2fefb4d4d66719" - integrity sha512-fhBER/rzPsteM6zq5qqMiOi+A2bHKCE/0PKmOzYgaqTKcG9c1SsOle9phPemW85to8Gxd2YgUOVLsZkCMltLtA== +"@commitlint/load@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.1.0.tgz#63b72ae5bb9152b8fa5b17c5428053032a9a49c8" + integrity sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg== dependencies: - "@commitlint/execute-rule" "^7.5.0" - "@commitlint/resolve-extends" "^7.5.0" + "@commitlint/execute-rule" "^8.1.0" + "@commitlint/resolve-extends" "^8.1.0" babel-runtime "^6.23.0" - cosmiconfig "^4.0.0" - lodash "4.17.11" - resolve-from "^4.0.0" + chalk "2.4.2" + cosmiconfig "^5.2.0" + lodash "4.17.14" + resolve-from "^5.0.0" -"@commitlint/message@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-7.5.0.tgz#2572fad648c769dd210374c8b95fb37124302bc5" - integrity sha512-5YOhsqy/MgHH7vyDsmmzO6Jr3ygr1pXbCm9NR3XB51wjg55Kd6/6dVlkhS/FmDp99pfwTdHb0TyeDFEjP98waw== +"@commitlint/message@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.1.0.tgz#8fb8046ddaa7e5c846a79da7cdbd15cf1a7770ae" + integrity sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A== -"@commitlint/parse@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-7.5.0.tgz#d9374266493e5229ec61d92316d28e02419c600f" - integrity sha512-hWASM8SBFTBtlFkKrEtD1qW6yTe2BsfoRiMKuYyRCTd+739TUF17og5vgQVuWttbGP0gXaciW44NygS2YjZmfA== +"@commitlint/parse@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.1.0.tgz#833243c6d848e7a7e775a283b38697166ed2fd22" + integrity sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA== dependencies: conventional-changelog-angular "^1.3.3" conventional-commits-parser "^2.1.0" lodash "^4.17.11" -"@commitlint/read@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-7.5.0.tgz#35d563b0f3075da2ce6945978996b16fb4acb0f8" - integrity sha512-uqGFCKZGnBUCTkxoCCJp4MfWUkegXkyT0T0RVM9diyG6uNWPWlMH1509sjLFlyeJKG+cSyYGG/d6T103ScMb4Q== +"@commitlint/read@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.1.0.tgz#effe07c965ba1735a5f7f8b7b19ac4d98c887507" + integrity sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg== dependencies: - "@commitlint/top-level" "^7.5.0" + "@commitlint/top-level" "^8.1.0" "@marionebl/sander" "^0.6.0" babel-runtime "^6.23.0" git-raw-commits "^1.3.0" -"@commitlint/resolve-extends@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-7.5.0.tgz#d95a3058e83ddbaef5e3045835b9a3a1fba3422c" - integrity sha512-FRIyPuqGvGa03OT4VgOHakizcw8YR5rdm77JsZff1rSnpxk6i+025I6qMeHqCIr5FaVIA0kR3FlC+MJFUs165A== +"@commitlint/resolve-extends@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz#ed67f2ee484160ac8e0078bae52f172625157472" + integrity sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw== dependencies: - babel-runtime "6.26.0" + "@types/node" "^12.0.2" import-fresh "^3.0.0" - lodash "4.17.11" - resolve-from "^4.0.0" - resolve-global "^0.1.0" + lodash "4.17.14" + resolve-from "^5.0.0" + resolve-global "^1.0.0" -"@commitlint/rules@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-7.5.2.tgz#da03d754625b2e67c0a6b8b9ab89eae1952a4f2e" - integrity sha512-eDN1UFPcBOjdnlI3syuo7y99SjGH/dUV6S9NvBocAye8ln5dfKiI2shhWochJhl36r/kYWU8Wrvl2NZJL3c52g== +"@commitlint/rules@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.1.0.tgz#009c64a8a23feb4647e5a25057997be62a272c8a" + integrity sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA== dependencies: - "@commitlint/ensure" "^7.5.2" - "@commitlint/message" "^7.5.0" - "@commitlint/to-lines" "^7.5.0" + "@commitlint/ensure" "^8.1.0" + "@commitlint/message" "^8.1.0" + "@commitlint/to-lines" "^8.1.0" babel-runtime "^6.23.0" -"@commitlint/to-lines@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-7.5.0.tgz#a24410d25bb85a5fff3b8d610277b3145f899766" - integrity sha512-ZQ3LxPNuQ/J7q42hkiPWN5fUIjWae85H2HHoBB+/Rw1fo+oehvr4Xyt+Oa9Mx5WbBnev/wXnUFjXgoadv1RZ5A== +"@commitlint/to-lines@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.1.0.tgz#5bf2597f46acacec4b1b3dba832ac8934798b22a" + integrity sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ== -"@commitlint/top-level@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-7.5.0.tgz#01e740167e3d15110794192cd754f49f27d4a16d" - integrity sha512-oTu185GufTYHjTXPHu6k6HL7iuASOvDOtQizZWRSxj0VXuoki6e0HzvGZsRsycDTOn04Q9hVu+PhF83IUwRpeg== +"@commitlint/top-level@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.1.0.tgz#f1950de73a1f76ef5c9e753a6b77402e0755d677" + integrity sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA== dependencies: - find-up "^2.1.0" + find-up "^4.0.0" -"@commitlint/travis-cli@^7.1.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-7.5.2.tgz#f82ca57296eb913b6557124b80eac9773dcbbf1d" - integrity sha512-kbkn8TIjRtGWcKOJBM/fbT9yRPjbLTybetRH5mkAQdX9ratkV9+N3akaOSmv5eemNfHsOM1cdrWkcjZbSqZV2A== +"@commitlint/travis-cli@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-8.1.0.tgz#0c8dc099644cd2da8bd3e55ac9cc3055f1906504" + integrity sha512-HSeinF08sstSTXDIPvTx5evAd4U49NLF1n0eAXu9rzyHA+ELc6gVSiW3HnIdNx83WkTV+nuQIPQGXqXYx9vleA== dependencies: - "@commitlint/cli" "^7.5.2" + "@commitlint/cli" "^8.1.0" babel-runtime "6.26.0" execa "0.9.0" -"@iamstarkov/listr-update-renderer@0.4.1": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@iamstarkov/listr-update-renderer/-/listr-update-renderer-0.4.1.tgz#d7c48092a2dcf90fd672b6c8b458649cb350c77e" - integrity sha512-IJyxQWsYDEkf8C8QthBn5N8tIUR9V9je6j3sMIpAkonaadjbvxmRC6RAhpa3RKxndhNnU2M6iNbtJwd7usQYIA== +"@evocateur/libnpmaccess@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" + integrity sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg== dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" + "@evocateur/npm-registry-fetch" "^4.0.0" + aproba "^2.0.0" + figgy-pudding "^3.5.1" + get-stream "^4.0.0" + npm-package-arg "^6.1.0" + +"@evocateur/libnpmpublish@^1.2.0": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz#55df09d2dca136afba9c88c759ca272198db9f1a" + integrity sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg== + dependencies: + "@evocateur/npm-registry-fetch" "^4.0.0" + aproba "^2.0.0" + figgy-pudding "^3.5.1" + get-stream "^4.0.0" + lodash.clonedeep "^4.5.0" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + semver "^5.5.1" + ssri "^6.0.1" + +"@evocateur/npm-registry-fetch@^3.9.1": + version "3.9.2" + resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-3.9.2.tgz#4e23b8b6c812c34828520ce42b31fcdb927c77a3" + integrity sha512-lz4cWdC32z6iI05YT9y79YuJtp4IXUu9lAP5JA/Z/difUXJRLAKlemboY64ELa8BKDav/ktjeCKUUJL8jxNTig== + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^5.1.1" + make-fetch-happen "^4.0.2" + npm-package-arg "^6.1.0" + safe-buffer "^5.1.2" + +"@evocateur/npm-registry-fetch@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz#8c4c38766d8d32d3200fcb0a83f064b57365ed66" + integrity sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g== + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^5.1.1" + make-fetch-happen "^5.0.0" + npm-package-arg "^6.1.0" + safe-buffer "^5.1.2" + +"@evocateur/pacote@^9.6.0": + version "9.6.3" + resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.3.tgz#bcd7adbd3c2ef303aa89bd24166f06dd9c080d89" + integrity sha512-ExqNqcbdHQprEgKnY/uQz7WRtyHRbQxRl4JnVkSkmtF8qffRrF9K+piZKNLNSkRMOT/3H0e3IP44QVCHaXMWOQ== + dependencies: + "@evocateur/npm-registry-fetch" "^4.0.0" + bluebird "^3.5.3" + cacache "^12.0.0" + figgy-pudding "^3.5.1" + get-stream "^4.1.0" + glob "^7.1.4" + lru-cache "^5.1.1" + make-fetch-happen "^5.0.0" + minimatch "^3.0.4" + minipass "^2.3.5" + mississippi "^3.0.0" + mkdirp "^0.5.1" + normalize-package-data "^2.5.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.4.4" + npm-pick-manifest "^2.2.3" + osenv "^0.1.5" + promise-inflight "^1.0.1" + promise-retry "^1.1.1" + protoduck "^5.0.1" + rimraf "^2.6.3" + safe-buffer "^5.2.0" + semver "^5.7.0" + ssri "^6.0.1" + tar "^4.4.10" + unique-filename "^1.1.1" + which "^1.3.1" "@jest/console@^24.7.1": version "24.7.1" @@ -314,32 +391,32 @@ chalk "^2.0.1" slash "^2.0.0" -"@jest/core@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.7.1.tgz#6707f50db238d0c5988860680e2e414df0032024" - integrity sha512-ivlZ8HX/FOASfHcb5DJpSPFps8ydfUYzLZfgFFqjkLijYysnIEOieg72YRhO4ZUB32xu40hsSMmaw+IGYeKONA== +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== dependencies: "@jest/console" "^24.7.1" - "@jest/reporters" "^24.7.1" - "@jest/test-result" "^24.7.1" - "@jest/transform" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" graceful-fs "^4.1.15" - jest-changed-files "^24.7.0" - jest-config "^24.7.1" - jest-haste-map "^24.7.1" - jest-message-util "^24.7.1" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" jest-regex-util "^24.3.0" - jest-resolve-dependencies "^24.7.1" - jest-runner "^24.7.1" - jest-runtime "^24.7.1" - jest-snapshot "^24.7.1" - jest-util "^24.7.1" - jest-validate "^24.7.0" - jest-watcher "^24.7.1" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" micromatch "^3.1.10" p-each-series "^1.0.0" pirates "^4.0.1" @@ -347,45 +424,46 @@ rimraf "^2.5.4" strip-ansi "^5.0.0" -"@jest/environment@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.7.1.tgz#9b9196bc737561f67ac07817d4c5ece772e33135" - integrity sha512-wmcTTYc4/KqA+U5h1zQd5FXXynfa7VGP2NfF+c6QeGJ7c+2nStgh65RQWNX62SC716dTtqheTRrZl0j+54oGHw== - dependencies: - "@jest/fake-timers" "^24.7.1" - "@jest/transform" "^24.7.1" - "@jest/types" "^24.7.0" - jest-mock "^24.7.0" - -"@jest/fake-timers@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.7.1.tgz#56e5d09bdec09ee81050eaff2794b26c71d19db2" - integrity sha512-4vSQJDKfR2jScOe12L9282uiwuwQv9Lk7mgrCSZHA9evB9efB/qx8i0KJxsAKtp8fgJYBJdYY7ZU6u3F4/pyjA== - dependencies: - "@jest/types" "^24.7.0" - jest-message-util "^24.7.1" - jest-mock "^24.7.0" - -"@jest/reporters@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.7.1.tgz#38ac0b096cd691bbbe3051ddc25988d42e37773a" - integrity sha512-bO+WYNwHLNhrjB9EbPL4kX/mCCG4ZhhfWmO3m4FSpbgr7N83MFejayz30kKjgqr7smLyeaRFCBQMbXpUgnhAJw== - dependencies: - "@jest/environment" "^24.7.1" - "@jest/test-result" "^24.7.1" - "@jest/transform" "^24.7.1" - "@jest/types" "^24.7.0" +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.2" - istanbul-api "^2.1.1" istanbul-lib-coverage "^2.0.2" istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" istanbul-lib-source-maps "^3.0.1" - jest-haste-map "^24.7.1" - jest-resolve "^24.7.1" - jest-runtime "^24.7.1" - jest-util "^24.7.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" jest-worker "^24.6.0" node-notifier "^5.2.1" slash "^2.0.0" @@ -401,96 +479,96 @@ graceful-fs "^4.1.15" source-map "^0.6.0" -"@jest/test-result@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.7.1.tgz#19eacdb29a114300aed24db651e5d975f08b6bbe" - integrity sha512-3U7wITxstdEc2HMfBX7Yx3JZgiNBubwDqQMh+BXmZXHa3G13YWF3p6cK+5g0hGkN3iufg/vGPl3hLxQXD74Npg== +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== dependencies: "@jest/console" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" "@types/istanbul-lib-coverage" "^2.0.0" -"@jest/test-sequencer@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.7.1.tgz#9c18e428e1ad945fa74f6233a9d35745ca0e63e0" - integrity sha512-84HQkCpVZI/G1zq53gHJvSmhUer4aMYp9tTaffW28Ih5OxfCg8hGr3nTSbL1OhVDRrFZwvF+/R9gY6JRkDUpUA== +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== dependencies: - "@jest/test-result" "^24.7.1" - jest-haste-map "^24.7.1" - jest-runner "^24.7.1" - jest-runtime "^24.7.1" + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" -"@jest/transform@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.7.1.tgz#872318f125bcfab2de11f53b465ab1aa780789c2" - integrity sha512-EsOUqP9ULuJ66IkZQhI5LufCHlTbi7hrcllRMUEV/tOgqBVQi93+9qEvkX0n8mYpVXQ8VjwmICeRgg58mrtIEw== +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" babel-plugin-istanbul "^5.1.0" chalk "^2.0.1" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.15" - jest-haste-map "^24.7.1" + jest-haste-map "^24.8.0" jest-regex-util "^24.3.0" - jest-util "^24.7.1" + jest-util "^24.8.0" micromatch "^3.1.10" realpath-native "^1.1.0" slash "^2.0.0" source-map "^0.6.1" write-file-atomic "2.4.1" -"@jest/types@^24.7.0": - version "24.7.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.7.0.tgz#c4ec8d1828cdf23234d9b4ee31f5482a3f04f48b" - integrity sha512-ipJUa2rFWiKoBqMKP63Myb6h9+iT3FHRTF2M8OR6irxWzItisa8i4dcSg14IbvmXUnBlHBlUQPYUHWyX3UPpYA== +"@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" -"@lerna/add@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.13.3.tgz#f4c1674839780e458f0426d4f7b6d0a77b9a2ae9" - integrity sha512-T3/Lsbo9ZFq+vL3ssaHxA8oKikZAPTJTGFe4CRuQgWCDd/M61+51jeWsngdaHpwzSSRDRjxg8fJTG10y10pnfA== +"@lerna/add@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.15.0.tgz#10be562f43cde59b60f299083d54ac39520ec60a" + integrity sha512-+KrG4GFy/6FISZ+DwWf5Fj5YB4ESa4VTnSn/ujf3VEda6dxngHPN629j+TcPbsdOxUYVah+HuZbC/B8NnkrKpQ== dependencies: - "@lerna/bootstrap" "3.13.3" - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" + "@evocateur/pacote" "^9.6.0" + "@lerna/bootstrap" "3.15.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/npm-conf" "3.13.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" npm-package-arg "^6.1.0" p-map "^1.2.0" - pacote "^9.5.0" semver "^5.5.0" -"@lerna/batch-packages@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.13.0.tgz#697fde5be28822af9d9dca2f750250b90a89a000" - integrity sha512-TgLBTZ7ZlqilGnzJ3xh1KdAHcySfHytgNRTdG9YomfriTU6kVfp1HrXxKJYVGs7ClPUNt2CTFEOkw0tMBronjw== +"@lerna/batch-packages@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.14.0.tgz#0208663bab3ddbf57956b370aaec4c9ebee6c800" + integrity sha512-RlBkQVNTqk1qvn6PFWiWNiskllUHh6tXbTVm43mZRNd+vhAyvrQC8RWJxH0ECVvnFAt9rSNGRIVbEJ31WnNQLg== dependencies: - "@lerna/package-graph" "3.13.0" - "@lerna/validation-error" "3.13.0" + "@lerna/package-graph" "3.14.0" npmlog "^4.1.2" -"@lerna/bootstrap@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.13.3.tgz#a0e5e466de5c100b49d558d39139204fc4db5c95" - integrity sha512-2XzijnLHRZOVQh8pwS7+5GR3cG4uh+EiLrWOishCq2TVzkqgjaS3GGBoef7KMCXfWHoLqAZRr/jEdLqfETLVqg== - dependencies: - "@lerna/batch-packages" "3.13.0" - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" - "@lerna/has-npm-version" "3.13.3" - "@lerna/npm-install" "3.13.3" - "@lerna/package-graph" "3.13.0" +"@lerna/bootstrap@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.15.0.tgz#f53e0bbbbfb8367e609a06378409bfc673ff2930" + integrity sha512-4AxsPKKbgj2Ju03qDddQTpOHvpqnwd0yaiEU/aCcWv/4tDTe79NqUne2Z3+P2WZY0Zzb8+nUKcskwYBMTeq+Mw== + dependencies: + "@lerna/batch-packages" "3.14.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/has-npm-version" "3.14.2" + "@lerna/npm-install" "3.14.2" + "@lerna/package-graph" "3.14.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.13.3" - "@lerna/run-lifecycle" "3.13.0" + "@lerna/rimraf-dir" "3.14.2" + "@lerna/run-lifecycle" "3.14.0" "@lerna/run-parallel-batches" "3.13.0" - "@lerna/symlink-binary" "3.13.0" - "@lerna/symlink-dependencies" "3.13.0" + "@lerna/symlink-binary" "3.14.2" + "@lerna/symlink-dependencies" "3.14.2" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^3.2.0" @@ -504,44 +582,45 @@ read-package-tree "^5.1.6" semver "^5.5.0" -"@lerna/changed@3.13.4": - version "3.13.4" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.13.4.tgz#c69d8a079999e49611dd58987f08437baee81ad4" - integrity sha512-9lfOyRVObasw6L/z7yCSfsEl1QKy0Eamb8t2Krg1deIoAt+cE3JXOdGGC1MhOSli+7f/U9LyLXjJzIOs/pc9fw== +"@lerna/changed@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.15.0.tgz#20db9d992d697e4288c260aa38b989dcb93f4b40" + integrity sha512-Hns1ssI9T9xOTGVc7PT2jUaqzsSkxV3hV/Y7iFO0uKTk+fduyTwGTHU9A/ybQ/xi/9iaJbvaXyjxKiGoEnzmhg== dependencies: - "@lerna/collect-updates" "3.13.3" - "@lerna/command" "3.13.3" - "@lerna/listable" "3.13.0" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/listable" "3.14.0" "@lerna/output" "3.13.0" - "@lerna/version" "3.13.4" + "@lerna/version" "3.15.0" -"@lerna/check-working-tree@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.13.3.tgz#836a3ffd4413a29aca92ccca4a115e4f97109992" - integrity sha512-LoGZvTkne+V1WpVdCTU0XNzFKsQa2AiAFKksGRT0v8NQj6VAPp0jfVYDayTqwaWt2Ne0OGKOFE79Y5LStOuhaQ== +"@lerna/check-working-tree@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.14.2.tgz#5ce007722180a69643a8456766ed8a91fc7e9ae1" + integrity sha512-7safqxM/MYoAoxZxulUDtIJIbnBIgo0PB/FHytueG+9VaX7GMnDte2Bt1EKa0dz2sAyQdmQ3Q8ZXpf/6JDjaeg== dependencies: - "@lerna/describe-ref" "3.13.3" + "@lerna/collect-uncommitted" "3.14.2" + "@lerna/describe-ref" "3.14.2" "@lerna/validation-error" "3.13.0" -"@lerna/child-process@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.13.3.tgz#6c084ee5cca9fc9e04d6bf4fc3f743ed26ff190c" - integrity sha512-3/e2uCLnbU+bydDnDwyadpOmuzazS01EcnOleAnuj9235CU2U97DH6OyoG1EW/fU59x11J+HjIqovh5vBaMQjQ== +"@lerna/child-process@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.14.2.tgz#950240cba83f7dfe25247cfa6c9cebf30b7d94f6" + integrity sha512-xnq+W5yQb6RkwI0p16ZQnrn6HkloH/MWTw4lGE1nKsBLAUbmSU5oTE93W1nrG0X3IMF/xWc9UYvNdUGMWvZZ4w== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.13.3.tgz#5673a1238e0712d31711e7e4e8cb9641891daaea" - integrity sha512-xmNauF1PpmDaKdtA2yuRc23Tru4q7UMO6yB1a/TTwxYPYYsAWG/CBK65bV26J7x4RlZtEv06ztYGMa9zh34UXA== +"@lerna/clean@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.15.0.tgz#a94da50908a80ba443a0a682706aca79ac2ecf27" + integrity sha512-D1BN7BnJk6YjrSR7E7RiCmWiFVWDo3L+OSe6zDq6rNNYexPBtSi2JOCeF/Dibi3jd2luVu0zkVpUtuEEdPiD+A== dependencies: - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.13.3" + "@lerna/rimraf-dir" "3.14.2" p-map "^1.2.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" @@ -556,25 +635,35 @@ npmlog "^4.1.2" yargs "^12.0.1" -"@lerna/collect-updates@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.13.3.tgz#616648da59f0aff4a8e60257795cc46ca6921edd" - integrity sha512-sTpALOAxli/ZS+Mjq6fbmjU9YXqFJ2E4FrE1Ijl4wPC5stXEosg2u0Z1uPY+zVKdM+mOIhLxPVdx83rUgRS+Cg== +"@lerna/collect-uncommitted@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.14.2.tgz#b5ed00d800bea26bb0d18404432b051eee8d030e" + integrity sha512-4EkQu4jIOdNL2BMzy/N0ydHB8+Z6syu6xiiKXOoFl0WoWU9H1jEJCX4TH7CmVxXL1+jcs8FIS2pfQz4oew99Eg== + dependencies: + "@lerna/child-process" "3.14.2" + chalk "^2.3.1" + figgy-pudding "^3.5.1" + npmlog "^4.1.2" + +"@lerna/collect-updates@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.14.2.tgz#396201f6568ec5916bf2c11e7a29b0931fcd3e5b" + integrity sha512-+zSQ2ZovH8Uc0do5dR+sk8VvRJc6Xl+ZnJJGESIl17KSpEw/lVjcOyt6f3BP+WHn+iSOjMWcGvUVA601FIEdZw== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/describe-ref" "3.13.3" + "@lerna/child-process" "3.14.2" + "@lerna/describe-ref" "3.14.2" minimatch "^3.0.4" npmlog "^4.1.2" slash "^1.0.0" -"@lerna/command@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.13.3.tgz#5b20b3f507224573551039e0460bc36c39f7e9d1" - integrity sha512-WHFIQCubJV0T8gSLRNr6exZUxTswrh+iAtJCb86SE0Sa+auMPklE8af7w2Yck5GJfewmxSjke3yrjNxQrstx7w== +"@lerna/command@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.15.0.tgz#e1dc1319054f1cf0b135aa0c5730f3335641a0ca" + integrity sha512-dZqr4rKFN+veuXakIQ1DcGUpzBgcWKaYFNN4O6/skOdVQaEfGefzo1sZET+q7k/BkypxkhXHXpv5UqqSuL/EHQ== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/package-graph" "3.13.0" - "@lerna/project" "3.13.1" + "@lerna/child-process" "3.14.2" + "@lerna/package-graph" "3.14.0" + "@lerna/project" "3.15.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" dedent "^0.7.0" @@ -583,10 +672,10 @@ lodash "^4.17.5" npmlog "^4.1.2" -"@lerna/conventional-commits@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.13.0.tgz#877aa225ca34cca61c31ea02a5a6296af74e1144" - integrity sha512-BeAgcNXuocmLhPxnmKU2Vy8YkPd/Uo+vu2i/p3JGsUldzrPC8iF3IDxH7fuXpEFN2Nfogu7KHachd4tchtOppA== +"@lerna/conventional-commits@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.14.0.tgz#24f643550dc29d4f1249cc26d0eb453d7a1c513d" + integrity sha512-hGZ2qQZ9uEGf2eeIiIpEodSs9Qkkf/2uYEtNT7QN1RYISPUh6/lKGBssc5dpbCF64aEuxmemWLdlDf1ogG6++w== dependencies: "@lerna/validation-error" "3.13.0" conventional-changelog-angular "^5.0.3" @@ -599,22 +688,23 @@ pify "^3.0.0" semver "^5.5.0" -"@lerna/create-symlink@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.13.0.tgz#e01133082fe040779712c960683cb3a272b67809" - integrity sha512-PTvg3jAAJSAtLFoZDsuTMv1wTOC3XYIdtg54k7uxIHsP8Ztpt+vlilY/Cni0THAqEMHvfiToel76Xdta4TU21Q== +"@lerna/create-symlink@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.14.0.tgz#f40ae06e8cebe70c694368ebf9a4af5ab380fbea" + integrity sha512-Kw51HYOOi6UfCKncqkgEU1k/SYueSBXgkNL91FR8HAZH7EPSRTEtp9mnJo568g0+Hog5C+3cOaWySwhHpRG29A== dependencies: cmd-shim "^2.0.2" fs-extra "^7.0.0" npmlog "^4.1.2" -"@lerna/create@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.13.3.tgz#6ded142c54b7f3cea86413c3637b067027b7f55d" - integrity sha512-4M5xT1AyUMwt1gCDph4BfW3e6fZmt0KjTa3FoXkUotf/w/eqTsc2IQ+ULz2+gOFQmtuNbqIZEOK3J4P9ArJJ/A== +"@lerna/create@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.15.0.tgz#27bfadcbdf71d34226aa82432293f5290f7ab1aa" + integrity sha512-doXGt0HTwTQl8GkC2tOrraA/5OWbz35hJqi7Dsl3Fl0bAxiv9XmF3LykHFJ+YTDHfGpdoJ8tKu66f/VKP16G0w== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.13.3" + "@evocateur/pacote" "^9.6.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/npm-conf" "3.13.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" @@ -624,7 +714,6 @@ init-package-json "^1.10.3" npm-package-arg "^6.1.0" p-reduce "^1.0.0" - pacote "^9.5.0" pify "^3.0.0" semver "^5.5.0" slash "^1.0.0" @@ -632,42 +721,42 @@ validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" -"@lerna/describe-ref@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.13.3.tgz#13318513613f6a407d37fc5dc025ec2cfb705606" - integrity sha512-5KcLTvjdS4gU5evW8ESbZ0BF44NM5HrP3dQNtWnOUSKJRgsES8Gj0lq9AlB2+YglZfjEftFT03uOYOxnKto4Uw== +"@lerna/describe-ref@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.14.2.tgz#edc3c973f5ca9728d23358c4f4d3b55a21f65be5" + integrity sha512-qa5pzDRK2oBQXNjyRmRnN7E8a78NMYfQjjlRFB0KNHMsT6mCiL9+8kIS39sSE2NqT8p7xVNo2r2KAS8R/m3CoQ== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" npmlog "^4.1.2" -"@lerna/diff@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.13.3.tgz#883cb3a83a956dbfc2c17bc9a156468a5d3fae17" - integrity sha512-/DRS2keYbnKaAC+5AkDyZRGkP/kT7v1GlUS0JGZeiRDPQ1H6PzhX09EgE5X6nj0Ytrm0sUasDeN++CDVvgaI+A== +"@lerna/diff@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.15.0.tgz#573d6f58f6809d16752dcfab74c5e286b6678371" + integrity sha512-N1Pr0M554Bt+DlVoD+DXWGh92gcq6G9icn8sH5GSqfwi0XCpPNJ2i1BNEZpUQ6ulLWOMa1YHR4PypPxecRGBjA== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.13.3" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" -"@lerna/exec@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.13.3.tgz#5d2eda3f6e584f2f15b115e8a4b5bc960ba5de85" - integrity sha512-c0bD4XqM96CTPV8+lvkxzE7mkxiFyv/WNM4H01YvvbFAJzk+S4Y7cBtRkIYFTfkFZW3FLo8pEgtG1ONtIdM+tg== +"@lerna/exec@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.15.0.tgz#b31510f47255367eb0d3e4a4f7b6ef8f7e41b985" + integrity sha512-YuXPd64TNG9wbb3lRvyMARQbdlbMZ1bJZ+GCm0enivnIWUyg0qtBDcfPY2dWpIgOif04zx+K/gmOX4lCaGM4UQ== dependencies: - "@lerna/batch-packages" "3.13.0" - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" - "@lerna/run-parallel-batches" "3.13.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/run-topologically" "3.14.0" "@lerna/validation-error" "3.13.0" + p-map "^1.2.0" -"@lerna/filter-options@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.13.3.tgz#aa42a4ab78837b8a6c4278ba871d27e92d77c54f" - integrity sha512-DbtQX4eRgrBz1wCFWRP99JBD7ODykYme9ykEK79+RrKph40znhJQRlLg4idogj6IsUEzwo1OHjihCzSfnVo6Cg== +"@lerna/filter-options@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.14.2.tgz#7ba91cb54ff3fd9f4650ad8d7c40bc1075e44c2d" + integrity sha512-Ct8oYvRttbYB9JalngHhirb8o9ZVyLm5a9MpXNevXoHiu6j0vNhI19BQCwNnrL6wZvEHJnzPuUl/jO23tWxemg== dependencies: - "@lerna/collect-updates" "3.13.3" + "@lerna/collect-updates" "3.14.2" "@lerna/filter-packages" "3.13.0" dedent "^0.7.0" @@ -696,37 +785,46 @@ ssri "^6.0.1" tar "^4.4.8" -"@lerna/github-client@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.13.3.tgz#bcf9b4ff40bdd104cb40cd257322f052b41bb9ce" - integrity sha512-fcJkjab4kX0zcLLSa/DCUNvU3v8wmy2c1lhdIbL7s7gABmDcV0QZq93LhnEee3VkC9UpnJ6GKG4EkD7eIifBnA== +"@lerna/github-client@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.14.2.tgz#a743792b51cd9bdfb785186e429568827a6372eb" + integrity sha512-+2Xh7t4qVmXiXE2utPnh5T7YwSltG74JP7c+EiooRY5+3zjh9MpPOcTKxVY3xKclzpsyXMohk2KpTF4tzA5rrg== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@octokit/plugin-enterprise-rest" "^2.1.1" "@octokit/rest" "^16.16.0" git-url-parse "^11.1.2" npmlog "^4.1.2" +"@lerna/gitlab-client@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz#91f4ec8c697b5ac57f7f25bd50fe659d24aa96a6" + integrity sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q== + dependencies: + node-fetch "^2.5.0" + npmlog "^4.1.2" + whatwg-url "^7.0.0" + "@lerna/global-options@3.13.0": version "3.13.0" resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== -"@lerna/has-npm-version@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.13.3.tgz#167e3f602a2fb58f84f93cf5df39705ca6432a2d" - integrity sha512-mQzoghRw4dBg0R9FFfHrj0TH0glvXyzdEZmYZ8Isvx5BSuEEwpsryoywuZSdppcvLu8o7NAdU5Tac8cJ/mT52w== +"@lerna/has-npm-version@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.14.2.tgz#ac17f7c68e92114b8332b95ae6cffec9c0d67a7b" + integrity sha512-cG+z5bB8JPd5f+nT2eLN2LmKg06O11AxlnUxgw2W7cLyc7cnsmMSp/rxt2JBMwW2r4Yn+CLLJIRwJZ2Es8jFSw== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" semver "^5.5.0" -"@lerna/import@3.13.4": - version "3.13.4" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.13.4.tgz#e9a1831b8fed33f3cbeab3b84c722c9371a2eaf7" - integrity sha512-dn6eNuPEljWsifBEzJ9B6NoaLwl/Zvof7PBUPA4hRyRlqG5sXRn6F9DnusMTovvSarbicmTURbOokYuotVWQQA== +"@lerna/import@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.15.0.tgz#47f2da52059a96bb08a4c09e18d985258fce9ce1" + integrity sha512-4GKQgeTXBTwMbZNkYyPdQIVA41HIISD7D6XRNrDaG0falUfvoPsknijQPCBmGqeh66u1Fcn2+4lkL3OCTj2FMg== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.13.3" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" @@ -734,44 +832,44 @@ fs-extra "^7.0.0" p-map-series "^1.0.0" -"@lerna/init@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.13.3.tgz#ebd522fee9b9d7d3b2dacb0261eaddb4826851ff" - integrity sha512-bK/mp0sF6jT0N+c+xrbMCqN4xRoiZCXQzlYsyACxPK99KH/mpHv7hViZlTYUGlYcymtew6ZC770miv5A9wF9hA== +"@lerna/init@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.15.0.tgz#bda36de44c365972f87cbd287fe85b6fb7bb1070" + integrity sha512-VOqH6kFbFtfUbXxhSqXKY6bjnVp9nLuLRI6x9tVHOANX2LmSlXm17OUGBnNt+eM4uJLuiUsAR8nTlpCiz//lPQ== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.13.3" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" fs-extra "^7.0.0" p-map "^1.2.0" write-json-file "^2.3.0" -"@lerna/link@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.13.3.tgz#11124d4a0c8d0b79752fbda3babedfd62dd57847" - integrity sha512-IHhtdhA0KlIdevCsq6WHkI2rF3lHWHziJs2mlrEWAKniVrFczbELON1KJAgdJS1k3kAP/WeWVqmIYZ2hJDxMvg== +"@lerna/link@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.15.0.tgz#718b4116a8eacb3fc73414ae8d97f8fdaf8125da" + integrity sha512-yKHuifADINobvDOLljBGkVGpVwy6J3mg5p9lQXBdOLXBoIKC8o/UKBR9JvZMFvT/Iy6zn6FPy1v5lz9iU1Ib0Q== dependencies: - "@lerna/command" "3.13.3" - "@lerna/package-graph" "3.13.0" - "@lerna/symlink-dependencies" "3.13.0" + "@lerna/command" "3.15.0" + "@lerna/package-graph" "3.14.0" + "@lerna/symlink-dependencies" "3.14.2" p-map "^1.2.0" slash "^1.0.0" -"@lerna/list@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.13.3.tgz#fa93864d43cadeb4cd540a4e78a52886c57dbe74" - integrity sha512-rLRDsBCkydMq2FL6WY1J/elvnXIjxxRtb72lfKHdvDEqVdquT5Qgt9ci42hwjmcocFwWcFJgF6BZozj5pbc13A== +"@lerna/list@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.15.0.tgz#4e401c1ad990bb12bd38298cb61d21136420ff68" + integrity sha512-8SvxnlfAnbEzQDf2NL0IxWyUuqWTykF9cHt5/f5TOzgESClpaOkDtqwh/UlE8nVTzWMnxnQUPQi3UTKyJD3i3g== dependencies: - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" - "@lerna/listable" "3.13.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/listable" "3.14.0" "@lerna/output" "3.13.0" -"@lerna/listable@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.13.0.tgz#babc18442c590b549cf0966d20d75fea066598d4" - integrity sha512-liYJ/WBUYP4N4MnSVZuLUgfa/jy3BZ02/1Om7xUY09xGVSuNVNEeB8uZUMSC+nHqFHIsMPZ8QK9HnmZb1E/eTA== +"@lerna/listable@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.14.0.tgz#08f4c78e0466568e8e8a57d4ad09537f2bb7bbb9" + integrity sha512-ZK44Mo8xf/N97eQZ236SPSq0ek6+gk4HqHIx05foEMZVV1iIDH4a/nblLsJNjGQVsIdMYFPaqNJ0z+ZQfiJazQ== dependencies: - "@lerna/batch-packages" "3.13.0" + "@lerna/query-graph" "3.14.0" chalk "^2.3.1" columnify "^1.5.4" @@ -793,22 +891,23 @@ config-chain "^1.1.11" pify "^3.0.0" -"@lerna/npm-dist-tag@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.13.0.tgz#49ecbe0e82cbe4ad4a8ea6de112982bf6c4e6cd4" - integrity sha512-mcuhw34JhSRFrbPn0vedbvgBTvveG52bR2lVE3M3tfE8gmR/cKS/EJFO4AUhfRKGCTFn9rjaSEzlFGYV87pemQ== +"@lerna/npm-dist-tag@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.15.0.tgz#262dd1e67a4cf82ae78fadfe02622ebce4add078" + integrity sha512-lnbdwc4Ebs7/EI9fTIgbH3dxXnP+SuCcGhG7P5ZjOqo67SY09sRZGcygEzabpvIwXvKpBF8vCd4xxzjnF2u+PA== dependencies: + "@evocateur/npm-registry-fetch" "^3.9.1" + "@lerna/otplease" "3.14.0" figgy-pudding "^3.5.1" npm-package-arg "^6.1.0" - npm-registry-fetch "^3.9.0" npmlog "^4.1.2" -"@lerna/npm-install@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.13.3.tgz#9b09852732e51c16d2e060ff2fd8bfbbb49cf7ba" - integrity sha512-7Jig9MLpwAfcsdQ5UeanAjndChUjiTjTp50zJ+UZz4CbIBIDhoBehvNMTCL2G6pOEC7sGEg6sAqJINAqred6Tg== +"@lerna/npm-install@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.14.2.tgz#fd22ff432f8b7cbe05bedfd36b0506482f1a4732" + integrity sha512-JYJJRtLETrGpcQZa8Rj16vbye399RqnaXmJlZuZ2twjJ2DYVYtwkfsGEOdvdaKw5KVOEpWcAxBA9OMmKQtCLQw== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^7.0.0" npm-package-arg "^6.1.0" @@ -816,29 +915,38 @@ signal-exit "^3.0.2" write-pkg "^3.1.0" -"@lerna/npm-publish@3.13.2": - version "3.13.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.13.2.tgz#ad713ca6f91a852687d7d0e1bda7f9c66df21768" - integrity sha512-HMucPyEYZfom5tRJL4GsKBRi47yvSS2ynMXYxL3kO0ie+j9J7cb0Ir8NmaAMEd3uJWJVFCPuQarehyfTDZsSxg== +"@lerna/npm-publish@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.15.0.tgz#89126d74ec97186475767b852954a5f55b732a71" + integrity sha512-G7rcNcSGjG0La8eHPXDvCvoNXbwNnP6XJ+GPh3CH5xiR/nikfLOa+Bfm4ytdjVWWxnKfCT4qyMTCoV1rROlqQQ== dependencies: - "@lerna/run-lifecycle" "3.13.0" + "@evocateur/libnpmpublish" "^1.2.0" + "@lerna/otplease" "3.14.0" + "@lerna/run-lifecycle" "3.14.0" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpmpublish "^1.1.1" npm-package-arg "^6.1.0" npmlog "^4.1.2" pify "^3.0.0" read-package-json "^2.0.13" -"@lerna/npm-run-script@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.13.3.tgz#9bb6389ed70cd506905d6b05b6eab336b4266caf" - integrity sha512-qR4o9BFt5hI8Od5/DqLalOJydnKpiQFEeN0h9xZi7MwzuX1Ukwh3X22vqsX4YRbipIelSFtrDzleNVUm5jj0ow== +"@lerna/npm-run-script@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.14.2.tgz#8c518ea9d241a641273e77aad6f6fddc16779c3f" + integrity sha512-LbVFv+nvAoRTYLMrJlJ8RiakHXrLslL7Jp/m1R18vYrB8LYWA3ey+nz5Tel2OELzmjUiemAKZsD9h6i+Re5egg== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" +"@lerna/otplease@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-3.14.0.tgz#b539fd3e7a08452fc0db3b10010ca3cf0e4a73e7" + integrity sha512-rYAWzaYZ81bwnrmTkYWGgcc13bl/6DlG7pjWQWNGAJNLzO5zzj0xmXN5sMFJnNvDpSiS/ZS1sIuPvb4xnwLUkg== + dependencies: + "@lerna/prompt" "3.13.0" + figgy-pudding "^3.5.1" + "@lerna/output@3.13.0": version "3.13.0" resolved "https://registry.yarnpkg.com/@lerna/output/-/output-3.13.0.tgz#3ded7cc908b27a9872228a630d950aedae7a4989" @@ -846,44 +954,53 @@ dependencies: npmlog "^4.1.2" -"@lerna/pack-directory@3.13.1": - version "3.13.1" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.13.1.tgz#5ad4d0945f86a648f565e24d53c1e01bb3a912d1" - integrity sha512-kXnyqrkQbCIZOf1054N88+8h0ItC7tUN5v9ca/aWpx298gsURpxUx/1TIKqijL5TOnHMyIkj0YJmnH/PyBVLKA== +"@lerna/pack-directory@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.14.2.tgz#577b8ebf867c9b636a2e4659a27552ee24d83b9d" + integrity sha512-b3LnJEmIml3sDj94TQT8R+kVyrDlmE7Su0WwcBYZDySXPMSZ38WA2/2Xjy/EWhXlFxp/nUJKyUG78nDrZ/00Uw== dependencies: "@lerna/get-packed" "3.13.0" - "@lerna/package" "3.13.0" - "@lerna/run-lifecycle" "3.13.0" + "@lerna/package" "3.14.2" + "@lerna/run-lifecycle" "3.14.0" figgy-pudding "^3.5.1" npm-packlist "^1.4.1" npmlog "^4.1.2" tar "^4.4.8" temp-write "^3.4.0" -"@lerna/package-graph@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.13.0.tgz#607062f8d2ce22b15f8d4a0623f384736e67f760" - integrity sha512-3mRF1zuqFE1HEFmMMAIggXy+f+9cvHhW/jzaPEVyrPNLKsyfJQtpTNzeI04nfRvbAh+Gd2aNksvaW/w3xGJnnw== +"@lerna/package-graph@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.14.0.tgz#4ccdf446dccedfbbeb4efff3eb720cb6fcb109fc" + integrity sha512-dNpA/64STD5YXhaSlg4gT6Z474WPJVCHoX1ibsVIFu0fVgH609Y69bsdmbvTRdI7r6Dcu4ZfGxdR636RTrH+Eg== dependencies: + "@lerna/prerelease-id-from-version" "3.14.0" "@lerna/validation-error" "3.13.0" npm-package-arg "^6.1.0" + npmlog "^4.1.2" semver "^5.5.0" -"@lerna/package@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.13.0.tgz#4baeebc49a57fc9b31062cc59f5ee38384429fc8" - integrity sha512-kSKO0RJQy093BufCQnkhf1jB4kZnBvL7kK5Ewolhk5gwejN+Jofjd8DGRVUDUJfQ0CkW1o6GbUeZvs8w8VIZDg== +"@lerna/package@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.14.2.tgz#f893cb42e26c869df272dafbe1dd5a3473b0bd4d" + integrity sha512-YR/+CzYdufJYfsUlrfuhTjA35iSZpXK7mVOZmeR9iRWhSaqesm4kq2zfxm9vCpZV2oAQQZOwi4eo5h0rQBtdiw== dependencies: load-json-file "^4.0.0" npm-package-arg "^6.1.0" write-pkg "^3.1.0" -"@lerna/project@3.13.1": - version "3.13.1" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.13.1.tgz#bce890f60187bd950bcf36c04b5260642e295e79" - integrity sha512-/GoCrpsCCTyb9sizk1+pMBrIYchtb+F1uCOn3cjn9yenyG/MfYEnlfrbV5k/UDud0Ei75YBLbmwCbigHkAKazQ== +"@lerna/prerelease-id-from-version@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.14.0.tgz#d5da9c26ac4a0d0ecde09018f06e41ca4dd444c2" + integrity sha512-Ap3Z/dNhqQuSrKmK+JmzYvQYI2vowxHvUVxZJiDVilW8dyNnxkCsYFmkuZytk5sxVz4VeGLNPS2RSsU5eeSS+Q== dependencies: - "@lerna/package" "3.13.0" + semver "^5.5.0" + +"@lerna/project@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.15.0.tgz#733b0993a849dcf5b68fcd0ec11d8f7de38a6999" + integrity sha512-eNGUWiMbQ9kh9kGkomtMnsLypS0rfLqxKgZP2+VnNVtIXjnLv4paeTm+1lkL+naNJUwhnpMk2NSLEeoxT/20QA== + dependencies: + "@lerna/package" "3.14.2" "@lerna/validation-error" "3.13.0" cosmiconfig "^5.1.0" dedent "^0.7.0" @@ -904,40 +1021,39 @@ inquirer "^6.2.0" npmlog "^4.1.2" -"@lerna/publish@3.13.4": - version "3.13.4" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.13.4.tgz#25b678c285110897a7fc5198a35bdfa9db7f9cc1" - integrity sha512-v03pabiPlqCDwX6cVNis1PDdT6/jBgkVb5Nl4e8wcJXevIhZw3ClvtI94gSZu/wdoVFX0RMfc8QBVmaimSO0qg== - dependencies: - "@lerna/batch-packages" "3.13.0" - "@lerna/check-working-tree" "3.13.3" - "@lerna/child-process" "3.13.3" - "@lerna/collect-updates" "3.13.3" - "@lerna/command" "3.13.3" - "@lerna/describe-ref" "3.13.3" +"@lerna/publish@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.15.0.tgz#54f93f8f0820d2d419d0b65df1eb55d8277090c9" + integrity sha512-6tRRBJ8olLSXfrUsR4f7vSfx0cT1oPi6/v06yI3afDSsUX6eQ3ooZh7gMY4RWmd+nM/IJHTUzhlKF6WhTvo+9g== + dependencies: + "@evocateur/libnpmaccess" "^3.1.0" + "@evocateur/npm-registry-fetch" "^3.9.1" + "@evocateur/pacote" "^9.6.0" + "@lerna/check-working-tree" "3.14.2" + "@lerna/child-process" "3.14.2" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/describe-ref" "3.14.2" "@lerna/log-packed" "3.13.0" "@lerna/npm-conf" "3.13.0" - "@lerna/npm-dist-tag" "3.13.0" - "@lerna/npm-publish" "3.13.2" + "@lerna/npm-dist-tag" "3.15.0" + "@lerna/npm-publish" "3.15.0" "@lerna/output" "3.13.0" - "@lerna/pack-directory" "3.13.1" + "@lerna/pack-directory" "3.14.2" + "@lerna/prerelease-id-from-version" "3.14.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/run-lifecycle" "3.13.0" - "@lerna/run-parallel-batches" "3.13.0" + "@lerna/run-lifecycle" "3.14.0" + "@lerna/run-topologically" "3.14.0" "@lerna/validation-error" "3.13.0" - "@lerna/version" "3.13.4" + "@lerna/version" "3.15.0" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpmaccess "^3.0.1" npm-package-arg "^6.1.0" - npm-registry-fetch "^3.9.0" npmlog "^4.1.2" p-finally "^1.0.0" p-map "^1.2.0" p-pipe "^1.2.0" - p-reduce "^1.0.0" - pacote "^9.5.0" semver "^5.5.0" "@lerna/pulse-till-done@3.13.0": @@ -947,6 +1063,14 @@ dependencies: npmlog "^4.1.2" +"@lerna/query-graph@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.14.0.tgz#2abb36f445bd924d0f85ac7aec1445e9ef1e2c6c" + integrity sha512-6YTh3vDMW2hUxHdKeRvx4bosc9lZClKaN+DzC1XKTkwDbWrsjmEzLcemKL6QnyyeuryN2f/eto7P9iSe3z3pQQ== + dependencies: + "@lerna/package-graph" "3.14.0" + figgy-pudding "^3.5.1" + "@lerna/resolve-symlink@3.13.0": version "3.13.0" resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.13.0.tgz#3e6809ef53b63fe914814bfa071cd68012e22fbb" @@ -956,24 +1080,24 @@ npmlog "^4.1.2" read-cmd-shim "^1.0.1" -"@lerna/rimraf-dir@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.13.3.tgz#3a8e71317fde853893ef0262bc9bba6a180b7227" - integrity sha512-d0T1Hxwu3gpYVv73ytSL+/Oy8JitsmvOYUR5ouRSABsmqS7ZZCh5t6FgVDDGVXeuhbw82+vuny1Og6Q0k4ilqw== +"@lerna/rimraf-dir@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.14.2.tgz#103a49882abd85d42285d05cc76869b89f21ffd2" + integrity sha512-eFNkZsy44Bu9v1Hrj5Zk6omzg8O9h/7W6QYK1TTUHeyrjTEwytaNQlqF0lrTLmEvq55sviV42NC/8P3M2cvq8Q== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" -"@lerna/run-lifecycle@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.13.0.tgz#d8835ee83425edee40f687a55f81b502354d3261" - integrity sha512-oyiaL1biZdjpmjh6X/5C4w07wNFyiwXSSHH5GQB4Ay4BPwgq9oNhCcxRoi0UVZlZ1YwzSW8sTwLgj8emkIo3Yg== +"@lerna/run-lifecycle@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.14.0.tgz#0499eca0e7f393faf4e24e6c8737302a9059c22b" + integrity sha512-GUM3L9MzGRSW0WQ8wbLW1+SYStU1OFjW0GBzShhBnFrO4nGRrU7VchsLpcLu0hk2uCzyhsrDKzifEdOdUyMoEQ== dependencies: "@lerna/npm-conf" "3.13.0" figgy-pudding "^3.5.1" - npm-lifecycle "^2.1.0" + npm-lifecycle "^2.1.1" npmlog "^4.1.2" "@lerna/run-parallel-batches@3.13.0": @@ -984,39 +1108,47 @@ p-map "^1.2.0" p-map-series "^1.0.0" -"@lerna/run@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.13.3.tgz#0781c82d225ef6e85e28d3e763f7fc090a376a21" - integrity sha512-ygnLIfIYS6YY1JHWOM4CsdZiY8kTYPsDFOLAwASlRnlAXF9HiMT08GFXLmMHIblZJ8yJhsM2+QgraCB0WdxzOQ== +"@lerna/run-topologically@3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.14.0.tgz#2a560cb657f0ef1565c680b6001b4b01b872dc07" + integrity sha512-y+KBpC1YExFzGynovt9MY4O/bc3RrJaKeuXieiPfKGKxrdtmZe/r33oj/xePTXZq65jnw3SaU3H8S5CrrdkwDg== + dependencies: + "@lerna/query-graph" "3.14.0" + figgy-pudding "^3.5.1" + p-queue "^4.0.0" + +"@lerna/run@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.15.0.tgz#465028b5b561a050bd760924e4a0749de3f43172" + integrity sha512-KQBkzZYoEKmzILKjbjsm1KKVWFBXwAdwzqJWj/lfxxd3V5LRF8STASk8aiw8bSpB0bUL9TU/pbXakRxiNzjDwQ== dependencies: - "@lerna/batch-packages" "3.13.0" - "@lerna/command" "3.13.3" - "@lerna/filter-options" "3.13.3" - "@lerna/npm-run-script" "3.13.3" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/npm-run-script" "3.14.2" "@lerna/output" "3.13.0" - "@lerna/run-parallel-batches" "3.13.0" + "@lerna/run-topologically" "3.14.0" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" p-map "^1.2.0" -"@lerna/symlink-binary@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.13.0.tgz#36a9415d468afcb8105750296902f6f000a9680d" - integrity sha512-obc4Y6jxywkdaCe+DB0uTxYqP0IQ8mFWvN+k/YMbwH4G2h7M7lCBWgPy8e7xw/50+1II9tT2sxgx+jMus1sTJg== +"@lerna/symlink-binary@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.14.2.tgz#a832fdc6c4b1e5aaf9e6ac9c7e6c322746965eb0" + integrity sha512-tqMwuWi6z1da0AFFbleWyu3H9fqayiV50rjj4anFTfayel9jSjlA1xPG+56sGIP6zUUNuUSc9kLh7oRRmlauoA== dependencies: - "@lerna/create-symlink" "3.13.0" - "@lerna/package" "3.13.0" + "@lerna/create-symlink" "3.14.0" + "@lerna/package" "3.14.2" fs-extra "^7.0.0" p-map "^1.2.0" -"@lerna/symlink-dependencies@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.13.0.tgz#76c23ecabda7824db98a0561364f122b457509cf" - integrity sha512-7CyN5WYEPkbPLbqHBIQg/YiimBzb5cIGQB0E9IkLs3+racq2vmUNQZn38LOaazQacAA83seB+zWSxlI6H+eXSg== +"@lerna/symlink-dependencies@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.14.2.tgz#e6b2a9544ff26addc1f4324734595e2f71dfc795" + integrity sha512-Ox7WKXnHZ7IwWlejcCq3n0Hd/yMLv8AwIryhvWxM/RauAge+ML4wg578SsdCyKob8ecgm/R0ytHiU06j81iL1w== dependencies: - "@lerna/create-symlink" "3.13.0" + "@lerna/create-symlink" "3.14.0" "@lerna/resolve-symlink" "3.13.0" - "@lerna/symlink-binary" "3.13.0" + "@lerna/symlink-binary" "3.14.2" fs-extra "^7.0.0" p-finally "^1.0.0" p-map "^1.2.0" @@ -1034,21 +1166,23 @@ dependencies: npmlog "^4.1.2" -"@lerna/version@3.13.4": - version "3.13.4" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.13.4.tgz#ea23b264bebda425ccbfcdcd1de13ef45a390e59" - integrity sha512-pptWUEgN/lUTQZu34+gfH1g4Uhs7TDKRcdZY9A4T9k6RTOwpKC2ceLGiXdeR+ZgQJAey2C4qiE8fo5Z6Rbc6QA== - dependencies: - "@lerna/batch-packages" "3.13.0" - "@lerna/check-working-tree" "3.13.3" - "@lerna/child-process" "3.13.3" - "@lerna/collect-updates" "3.13.3" - "@lerna/command" "3.13.3" - "@lerna/conventional-commits" "3.13.0" - "@lerna/github-client" "3.13.3" +"@lerna/version@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.15.0.tgz#3c65d223d94f211312995266abb07ee6606d5f73" + integrity sha512-vReYX1NMXZ9PwzTZm97wAl/k3bmRnRZhnQi3mq/m49xTnDavq7p4sbUdFpvu8cVZNKnYS02pNIVGHrQw+K8ZCw== + dependencies: + "@lerna/check-working-tree" "3.14.2" + "@lerna/child-process" "3.14.2" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/conventional-commits" "3.14.0" + "@lerna/github-client" "3.14.2" + "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" + "@lerna/prerelease-id-from-version" "3.14.0" "@lerna/prompt" "3.13.0" - "@lerna/run-lifecycle" "3.13.0" + "@lerna/run-lifecycle" "3.14.0" + "@lerna/run-topologically" "3.14.0" "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" @@ -1092,14 +1226,14 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== -"@octokit/endpoint@^4.0.0": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-4.2.2.tgz#4ff11382bad89c7e01030a1e62d5e9d13c2402b0" - integrity sha512-5IZjkUNhx5q0IRN7Juwf5A+Lu2qAso7ULST7C1P2mbGHePuCOk936Stcl/5GdJpB3ovD8M6/Lv3xra6Mn0IKNQ== +"@octokit/endpoint@^5.1.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.0.tgz#7c4a8d74e88176206817bf513b63b1859a84c475" + integrity sha512-D7u80EdZHlHzYl81PgoKXFFIl121eLahKI6WFvuhwE4ih+U+YWrE1fGiH9eybr8l3mGgZ9iITYGBR+7UR5S9QA== dependencies: - deepmerge "3.2.0" + deepmerge "4.0.0" is-plain-object "^3.0.0" - universal-user-agent "^2.0.1" + universal-user-agent "^3.0.0" url-template "^2.0.8" "@octokit/plugin-enterprise-rest@^2.1.1": @@ -1107,34 +1241,44 @@ resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.2.tgz#c0e22067a043e19f96ff9c7832e2a3019f9be75c" integrity sha512-CTZr64jZYhGWNTDGlSJ2mvIlFsm9OEO3LqWn9I/gmoHI4jRBp4kpHoFYNemG4oA75zUAcmbuWblb7jjP877YZw== -"@octokit/request@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-3.0.1.tgz#21e888c6dce80566ec69477360bab79f2f14861f" - integrity sha512-aH61OVkMKMofGW/go2x4mJ44X4U/JF8xsiFFictwkZYtz0psE8OPKpsP2TZBZaJoCg2wmeTyEgqGfY+veg0hGQ== +"@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.0.4.tgz#15e1dc22123ba4a9a4391914d80ec1e5303a23be" + integrity sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig== + dependencies: + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.0.1.tgz#6705c9a883db0ac0f58cee717e806b6575d4a199" + integrity sha512-SHOk/APYpfrzV1RNf7Ux8SZi+vZXhMIB2dBr4TQR6ExMX8R4jcy/0gHw26HLe1dWV7Wxe9WzYyDSEC0XwnoCSQ== dependencies: - "@octokit/endpoint" "^4.0.0" - deprecation "^1.0.1" + "@octokit/endpoint" "^5.1.0" + "@octokit/request-error" "^1.0.1" + deprecation "^2.0.0" is-plain-object "^3.0.0" node-fetch "^2.3.0" once "^1.4.0" - universal-user-agent "^2.0.1" + universal-user-agent "^3.0.0" "@octokit/rest@^16.16.0": - version "16.25.1" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.25.1.tgz#60a3171018dbc4feb23d1bf9805a06aad106d53e" - integrity sha512-a1Byzjj07OMQNUQDP5Ng/rChaI7aq6TNMY1ZFf8+zCVEEtYzCgcmrFG9BDerFbLPPKGQ5TAeRRFyLujUUN1HIg== + version "16.28.4" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.4.tgz#2f8ef08305033bc91256530d6a3c98eada700660" + integrity sha512-ZBsfD46t3VNkwealxm5zloVgQta8d8o4KYBR/hMAZ582IgjmSDKZdkjyv5w37IUCM3tcPZWKUT+kml9pEIC2GA== dependencies: - "@octokit/request" "3.0.1" + "@octokit/request" "^5.0.0" + "@octokit/request-error" "^1.0.2" atob-lite "^2.0.0" - before-after-hook "^1.4.0" + before-after-hook "^2.0.0" btoa-lite "^1.0.0" - deprecation "^1.0.1" + deprecation "^2.0.0" lodash.get "^4.4.2" lodash.set "^4.3.2" lodash.uniq "^4.5.0" octokit-pagination-methods "^1.1.0" once "^1.4.0" - universal-user-agent "^2.0.0" + universal-user-agent "^3.0.0" url-template "^2.0.8" "@samverschueren/stream-to-observable@^0.3.0": @@ -1150,9 +1294,9 @@ integrity sha512-HAdhFeYOZKIkrR2jbonCJxp3I/o2G/kxY+CIx7qX9Kmv5jY+9D7OgmgSLdRqeHacB5RlqE5efj2WIDFL9NXCyg== "@types/babel__core@^7.1.0": - version "7.1.1" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" - integrity sha512-+hjBtgcFPYyCTo0A15+nxrCVJL7aC6Acg87TXd5OW3QhHswdrOLoles+ldL2Uk8q++7yIfl4tURtztccdeeyOw== + version "7.1.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" + integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1176,9 +1320,9 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" - integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== dependencies: "@babel/types" "^7.3.0" @@ -1201,20 +1345,35 @@ "@types/minimatch" "*" "@types/node" "*" -"@types/istanbul-lib-coverage@^2.0.0": +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + "@types/jest-diff@*": version "20.0.1" resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== -"@types/jest@^24.0.6": - version "24.0.12" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.12.tgz#0553dd0a5ac744e7dc4e8700da6d3baedbde3e8f" - integrity sha512-60sjqMhat7i7XntZckcSGV8iREJyXXI6yFHZkSZvCPUeOnEJ/VP1rU/WpEWQ56mvoh8NhC+sfKAuJRTyGtCOow== +"@types/jest@^24.0.15": + version "24.0.15" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.15.tgz#6c42d5af7fe3b44ffff7cc65de7bf741e8fa427f" + integrity sha512-MU1HIvWUme74stAoc3mgAi+aMlgKOudgEvQDIm1v4RkrDudBh1T+NFp5sftpBAdXdx1J0PbdpJ+M2EsSOi1djA== dependencies: "@types/jest-diff" "*" @@ -1245,9 +1404,9 @@ "@types/lodash" "*" "@types/lodash@*": - version "4.14.123" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d" - integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q== + version "4.14.136" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f" + integrity sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA== "@types/marked@^0.6.5": version "0.6.5" @@ -1259,20 +1418,20 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*": - version "11.13.8" - resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.8.tgz#e5d71173c95533be9842b2c798978f095f912aab" - integrity sha512-szA3x/3miL90ZJxUCzx9haNbK5/zmPieGraZEe4WI+3srN0eGLiT22NXeMHmyhNEopn+IrxqMc7wdVwvPl8meg== +"@types/node@*", "@types/node@^12.0.2", "@types/node@^12.6.8": + version "12.6.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" + integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== -"@types/node@^10.12.2": - version "10.14.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.14.6.tgz#9cbfcb62c50947217f4d88d4d274cc40c22625a9" - integrity sha512-Fvm24+u85lGmV4hT5G++aht2C5I4Z4dYlWZIh62FAfFO/TfzXtPpoLI6I7AuBWkIFqZCnhFOoTT7RjjaIL5Fjg== +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/semver@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" - integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== +"@types/semver@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6" + integrity sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg== "@types/stack-utils@^1.0.1": version "1.0.1" @@ -1284,6 +1443,162 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== +"@webassemblyjs/ast@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" + integrity sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ== + dependencies: + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + +"@webassemblyjs/floating-point-hex-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" + integrity sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ== + +"@webassemblyjs/helper-api-error@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" + integrity sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA== + +"@webassemblyjs/helper-buffer@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" + integrity sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q== + +"@webassemblyjs/helper-code-frame@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" + integrity sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ== + dependencies: + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/helper-fsm@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" + integrity sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow== + +"@webassemblyjs/helper-module-context@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" + integrity sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g== + dependencies: + "@webassemblyjs/ast" "1.8.5" + mamacro "^0.0.3" + +"@webassemblyjs/helper-wasm-bytecode@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" + integrity sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ== + +"@webassemblyjs/helper-wasm-section@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" + integrity sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + +"@webassemblyjs/ieee754@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" + integrity sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" + integrity sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" + integrity sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw== + +"@webassemblyjs/wasm-edit@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" + integrity sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/helper-wasm-section" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-opt" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/wasm-gen@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" + integrity sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wasm-opt@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" + integrity sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + +"@webassemblyjs/wasm-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" + integrity sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wast-parser@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" + integrity sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/floating-point-hex-parser" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-code-frame" "1.8.5" + "@webassemblyjs/helper-fsm" "1.8.5" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/wast-printer@1.8.5": + version "1.8.5" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" + integrity sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -1316,21 +1631,28 @@ acorn-jsx@^5.0.0: integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== acorn-walk@^6.0.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" - integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" + integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== acorn@^5.5.3: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.0.7: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" - integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== +acorn@^6.0.1, acorn@^6.0.7, acorn@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" + integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== -agent-base@4, agent-base@^4.1.0, agent-base@~4.2.1: +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" + +agent-base@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== @@ -1344,7 +1666,27 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -ajv@^6.10.0, ajv@^6.5.5, ajv@^6.9.1: +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== + +ajv-keywords@^3.1.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" + integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== + +ajv@^6.1.0, ajv@^6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^6.10.0, ajv@^6.5.5: version "6.10.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== @@ -1354,15 +1696,17 @@ ajv@^6.10.0, ajv@^6.5.5, ajv@^6.9.1: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -all-contributors-cli@^6.0.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.3.1.tgz#0dd12d026f31827035da924e0fe752cec7ed0e3f" - integrity sha512-v0M4HqSMPyoaBZptqd91GUkjUN7IaOBhBLkGVEbuNF/j+PIMN6hnTlI/8rj6P/Ofc6Y4qNtmjktqPmwqajk6DA== +all-contributors-cli@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.8.0.tgz#1b98e9ee60ca3724ef50fb7469b8e85de1ebdec9" + integrity sha512-7xYAmljxgGL4w0XTRBuGTJMqf/xTGhvPyRbIp2InKfn0INo08faCT6gP18iyYMpVPotgAUcaGTeLrewh2IP54Q== dependencies: "@babel/runtime" "^7.2.0" - async "^2.0.0-rc.1" + async "^3.0.1" chalk "^2.3.0" + didyoumean "^1.2.1" inquirer "^6.2.1" + json-fixer "^1.3.1-0" lodash "^4.11.2" pify "^4.0.1" request "^2.72.0" @@ -1413,13 +1757,6 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -append-transform@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" - integrity sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw== - dependencies: - default-require-extensions "^2.0.0" - aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -1439,9 +1776,9 @@ are-we-there-yet@~1.1.2: readable-stream "^2.0.6" arg@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" - integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== + version "4.1.1" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.1.tgz#485f8e7c390ce4c5f78257dbea80d4be11feda4c" + integrity sha512-SlmP3fEA88MBv0PypnXZ8ZfJhwmDeIE3SP71j37AiXQBXYosPV0x6uISAaHYSlSVhmHOVkomen0tbGk6Anlebw== argparse@^1.0.7: version "1.0.10" @@ -1450,6 +1787,14 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +aria-query@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" + integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= + dependencies: + ast-types-flow "0.0.7" + commander "^2.11.0" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -1480,11 +1825,24 @@ array-find-index@^1.0.1: resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= +array-find@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-find/-/array-find-1.0.0.tgz#6c8e286d11ed768327f8e62ecee87353ca3e78b8" + integrity sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg= + array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -1512,6 +1870,15 @@ asap@^2.0.0: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -1524,27 +1891,43 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= +assert@^1.1.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== + dependencies: + object-assign "^4.1.1" + util "0.10.3" + assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-types-flow@0.0.7, ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= + astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@^2.0.0-rc.1, async@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" - integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== - dependencies: - lodash "^4.17.11" +async@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/async/-/async-3.1.0.tgz#42b3b12ae1b74927b5217d8c0016baaf62463772" + integrity sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ== asynckit@^0.4.0: version "0.4.0" @@ -1571,6 +1954,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== +axobject-query@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" + integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== + dependencies: + ast-types-flow "0.0.7" + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -1580,13 +1970,25 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-jest@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.7.1.tgz#73902c9ff15a7dfbdc9994b0b17fcefd96042178" - integrity sha512-GPnLqfk8Mtt0i4OemjWkChi73A3ALs4w2/QbG64uAj8b5mmwzxc7jbJVRZt8NJkxi6FopVHog9S3xX6UJKb2qg== +babel-eslint@^10.0.1: + version "10.0.2" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456" + integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== dependencies: - "@jest/transform" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" babel-preset-jest "^24.6.0" @@ -1639,6 +2041,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1659,22 +2066,30 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -before-after-hook@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.4.0.tgz#2b6bf23dca4f32e628fd2747c10a37c74a4b484d" - integrity sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg== +before-after-hook@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" + integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= - dependencies: - inherits "~2.0.0" +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: + version "3.5.5" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" + integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== -bluebird@^3.5.1, bluebird@^3.5.3: - version "3.5.4" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" - integrity sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw== +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== brace-expansion@^1.1.7: version "1.1.11" @@ -1684,7 +2099,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1: +braces@^2.3.1, braces@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -1700,6 +2115,18 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + browser-process-hrtime@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" @@ -1712,6 +2139,65 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + bs-logger@0.x: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -1720,9 +2206,9 @@ bs-logger@0.x: fast-json-stable-stringify "2.x" bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" - integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + version "2.1.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" + integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== dependencies: node-int64 "^0.4.0" @@ -1736,11 +2222,30 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -1756,22 +2261,42 @@ byte-size@^4.0.3: resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.4.tgz#29d381709f41aae0d89c631f1c81aec88cd40b23" integrity sha512-82RPeneC6nqCdSwCX2hZUz3JPOvN5at/nTEw/CMf05Smu3Hrpo9Psb7LjN+k+XndNArG1EY8L4+BM3aTM4BCvw== -cacache@^11.0.1, cacache@^11.3.2: - version "11.3.2" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" - integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== +cacache@^11.3.2, cacache@^11.3.3: + version "11.3.3" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" + integrity sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA== dependencies: - bluebird "^3.5.3" + bluebird "^3.5.5" chownr "^1.1.1" figgy-pudding "^3.5.1" - glob "^7.1.3" + glob "^7.1.4" graceful-fs "^4.1.15" lru-cache "^5.1.1" mississippi "^3.0.0" mkdirp "^0.5.1" move-concurrently "^1.0.1" promise-inflight "^1.0.1" - rimraf "^2.6.2" + rimraf "^2.6.3" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cacache@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.0.tgz#1ed91cc306312a53ad688b1563ce4c416faec564" + integrity sha512-0baf1FhCp16LhN+xDJsOrSiaPDCTD3JegZptVmLDoEbFcT5aT+BeFGt3wcDU3olCP5tpTCXU5sv0+TsKWT9WGQ== + dependencies: + bluebird "^3.5.5" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.4" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.3" ssri "^6.0.1" unique-filename "^1.1.1" y18n "^4.0.0" @@ -1873,6 +2398,15 @@ chalk@2.3.1: escape-string-regexp "^1.0.5" supports-color "^5.2.0" +chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1884,24 +2418,41 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +chokidar@^2.0.2: + version "2.1.6" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" + integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + version "1.1.2" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" + integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== + +chrome-trace-event@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" + integrity sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ== + dependencies: + tslib "^1.9.0" ci-info@^1.5.0: version "1.6.0" @@ -1913,6 +2464,14 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -1952,6 +2511,15 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" @@ -2004,17 +2572,22 @@ columnify@^1.5.4: wcwidth "^1.0.0" combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" - integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -commander@^2.12.1, commander@^2.14.1, commander@^2.9.0, commander@~2.20.0: +commander@^2.11.0, commander@^2.12.1, commander@^2.20.0, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -2023,11 +2596,6 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" -compare-versions@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.4.0.tgz#e0747df5c9cb7f054d6d3dc3e1dbc444f9e92b26" - integrity sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg== - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -2066,11 +2634,28 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= + dependencies: + date-now "^0.1.4" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + conventional-changelog-angular@^1.3.3: version "1.6.6" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz#b27f2b315c16d0a1f23eb181309d0e6a4698ea0f" @@ -2112,9 +2697,9 @@ conventional-changelog-preset-loader@^2.1.1: integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== conventional-changelog-writer@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.5.tgz#fb9e384bb294e8e8a9f2568a3f4d1e11953d8641" - integrity sha512-g/Myp4MaJ1A+f7Ai+SnVhkcWtaHk6flw0SYN7A+vQ+MTu0+gSovQWs4Pg4NtcNUcIztYQ9YHsoxHP+GGQplI7Q== + version "4.0.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" + integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" @@ -2123,7 +2708,7 @@ conventional-changelog-writer@^4.0.5: json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" - semver "^5.5.0" + semver "^6.0.0" split "^1.0.0" through2 "^3.0.0" @@ -2154,12 +2739,12 @@ conventional-commits-parser@^2.1.0: trim-off-newlines "^1.0.0" conventional-commits-parser@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.2.tgz#1295590dd195f64f53d6f8eb7c41114bb9a60742" - integrity sha512-y5eqgaKR0F6xsBNVSQ/5cI5qIF3MojddSUi1vKIggRkqUTbkqFKH9P5YX/AT1BVZp9DtSzBTIkvjyVLotLsVog== + version "3.0.3" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" + integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== dependencies: JSONStream "^1.0.4" - is-text-path "^1.0.0" + is-text-path "^2.0.0" lodash "^4.2.1" meow "^4.0.0" split2 "^2.0.0" @@ -2205,43 +2790,55 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.4.0, core-js@^2.5.0: - version "2.6.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" - integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A== + version "2.6.9" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" + integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@5.0.6: - version "5.0.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" - integrity sha512-6DWfizHriCrFWURP1/qyhsiFvYdlJzbCzmtFWh744+KyWsJo5+kPzUZZaMRSSItoYc0pxFX7gEO7ZC1/gN/7AQ== +cosmiconfig@^5.1.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== dependencies: + import-fresh "^2.0.0" is-directory "^0.3.1" - js-yaml "^3.9.0" + js-yaml "^3.13.1" parse-json "^4.0.0" -cosmiconfig@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" - integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^4.0.0" - require-from-string "^2.0.1" + bn.js "^4.1.0" + elliptic "^6.0.0" -cosmiconfig@^5.0.7, cosmiconfig@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.0.tgz#45038e4d28a7fe787203aede9c25bca4a08b12c8" - integrity sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g== +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.0" - parse-json "^4.0.0" + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" cross-spawn@^5.0.1: version "5.1.0" @@ -2263,15 +2860,32 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.6" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" - integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== cssstyle@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" - integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== + version "1.4.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" + integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== dependencies: cssom "0.3.x" @@ -2298,6 +2912,11 @@ cz-conventional-changelog@2.1.0: right-pad "^1.0.1" word-wrap "^1.0.3" +damerau-levenshtein@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" + integrity sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA== + dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" @@ -2326,6 +2945,11 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= + dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -2338,14 +2962,14 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.2.0, debug@^2.3.3: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^3.1.0: +debug@^3.1.0, debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -2397,17 +3021,10 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" - integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== - -default-require-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" - integrity sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc= - dependencies: - strip-bom "^3.0.0" +deepmerge@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" + integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww== defaults@^1.0.3: version "1.0.3" @@ -2416,7 +3033,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.2: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -2445,17 +3062,18 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -del@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" - integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU= +del@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" + integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== dependencies: + "@types/glob" "^7.1.1" globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" + is-path-cwd "^2.0.0" + is-path-in-cwd "^2.0.0" + p-map "^2.0.0" + pify "^4.0.1" + rimraf "^2.6.3" delayed-stream@~1.0.0: version "1.0.0" @@ -2467,10 +3085,18 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= -deprecation@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-1.0.1.tgz#2df79b79005752180816b7b6e079cbd80490d711" - integrity sha512-ccVHpE72+tcIKaGMql33x5MAjKQIZrk+3x2GbJ7TeraUCZWHoT+KSZpoC+JQFsUBlSTXUrBaGiF0j6zVTepPLg== +deprecation@^2.0.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" detect-indent@^5.0.0: version "5.0.0" @@ -2495,16 +3121,35 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" +didyoumean@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff" + integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8= + diff-sequences@^24.3.0: version "24.3.0" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== -diff@^3.1.0, diff@^3.2.0: +diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== +diff@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff" + integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q== + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + dir-glob@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" @@ -2513,6 +3158,21 @@ dir-glob@2.0.0: arrify "^1.0.1" path-type "^3.0.0" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" @@ -2520,6 +3180,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -2569,11 +3234,29 @@ elegant-spinner@^1.0.1: resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -emoji-regex@^7.0.1: +elliptic@^6.0.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" + integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emoji-regex@^7.0.1, emoji-regex@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= + encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -2588,11 +3271,36 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +enhanced-resolve@~0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz#4d6e689b3725f86090927ccc86cd9f1635b89e2e" + integrity sha1-TW5omzcl+GCQknzMhs2fFjW4ni4= + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.2.0" + tapable "^0.1.8" + err-code@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -2600,7 +3308,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.5.1: +es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -2622,9 +3330,9 @@ es-to-primitive@^1.2.0: is-symbol "^1.0.2" es6-promise@^4.0.3: - version "4.2.6" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" - integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" @@ -2633,7 +3341,7 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -2650,15 +3358,152 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-plugin-eslint-plugin@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.0.1.tgz#d275434969dbde3da1d4cb7a121dc8d88457c786" - integrity sha512-kJ5TZsRJH/xYstG07v3YeOy/W5SDAEzV+bvvoL0aiG1HtqDmg4mJvNPnn/JngANMmsx8oXlJrIcBTCpJzm+9kg== +eslint-config-kentcdodds@^14.3.2: + version "14.3.4" + resolved "https://registry.yarnpkg.com/eslint-config-kentcdodds/-/eslint-config-kentcdodds-14.3.4.tgz#49cde58dba48d76aec486b3eae65f2142bfa4ca2" + integrity sha512-GTqZZg647k3Duiefkwqj7onCTTyTeKiKP5D9/T3SYofd+eeNTKPntDSqDNL3qMHFwINHluMcFkwd+gOd1QCMHA== + dependencies: + babel-eslint "^10.0.1" + eslint-config-prettier "^6.0.0" + eslint-import-resolver-webpack "^0.11.1" + eslint-plugin-babel "^5.3.0" + eslint-plugin-import "^2.17.1" + eslint-plugin-jest "^22.4.1" + eslint-plugin-jsx-a11y "^6.2.1" + eslint-plugin-react "^7.13.0" + eslint-plugin-react-hooks "^1.6.0" + read-pkg-up "^6.0.0" + semver "^6.1.1" + webpack "^4.33.0" + +eslint-config-prettier@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#f429a53bde9fc7660e6353910fd996d6284d3c25" + integrity sha512-vDrcCFE3+2ixNT5H83g28bO/uYAwibJxerXPj+E7op4qzBCsAV36QfvdAyVOoNxKAH2Os/e01T/2x++V0LPukA== + dependencies: + get-stdin "^6.0.0" + +eslint-import-resolver-node@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-import-resolver-webpack@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.11.1.tgz#fcf1fd57a775f51e18f442915f85dd6ba45d2f26" + integrity sha512-eK3zR7xVQR/MaoBWwGuD+CULYVuqe5QFlDukman71aI6IboCGzggDUohHNfu1ZeBnbHcUHJc0ywWoXUBNB6qdg== + dependencies: + array-find "^1.0.0" + debug "^2.6.8" + enhanced-resolve "~0.9.0" + find-root "^1.1.0" + has "^1.0.1" + interpret "^1.0.0" + lodash "^4.17.4" + node-libs-browser "^1.0.0 || ^2.0.0" + resolve "^1.10.0" + semver "^5.3.0" + +eslint-module-utils@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" + integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== + dependencies: + debug "^2.6.8" + pkg-dir "^2.0.0" + +eslint-plugin-babel@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" + integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== + dependencies: + eslint-rule-composer "^0.3.0" + +eslint-plugin-eslint-comments@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.1.2.tgz#4ef6c488dbe06aa1627fea107b3e5d059fc8a395" + integrity sha512-QexaqrNeteFfRTad96W+Vi4Zj1KFbkHHNMMaHZEYcovKav6gdomyGzaxSDSL3GoIyUOo078wRAdYlu1caiauIQ== + dependencies: + escape-string-regexp "^1.0.5" + ignore "^5.0.5" + +eslint-plugin-eslint-plugin@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.1.0.tgz#a7a00f15a886957d855feacaafee264f039e62d5" + integrity sha512-kT3A/ZJftt28gbl/Cv04qezb/NQ1dwYIbi8lyf806XMxkus7DvOVCLIfTXMrorp322Pnoez7+zabXH29tADIDg== + +eslint-plugin-import@^2.17.1, eslint-plugin-import@^2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" + integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== + dependencies: + array-includes "^3.0.3" + contains-path "^0.1.0" + debug "^2.6.9" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" + read-pkg-up "^2.0.0" + resolve "^1.11.0" + +eslint-plugin-jest@^22.10.0, eslint-plugin-jest@^22.4.1: + version "22.10.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.10.0.tgz#a22be77f4dc692808b88ead0059620bda299a97d" + integrity sha512-iBEWJn60Z5bctcjacymUnOQ3xN3gdvGOy3tDHpalAa99r4+jwH0CvICsIIHBNXNlJxuklkbx+wxr49tXk6M0tg== + +eslint-plugin-jsx-a11y@^6.2.1: + version "6.2.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" + integrity sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg== + dependencies: + "@babel/runtime" "^7.4.5" + aria-query "^3.0.0" + array-includes "^3.0.3" + ast-types-flow "^0.0.7" + axobject-query "^2.0.2" + damerau-levenshtein "^1.0.4" + emoji-regex "^7.0.2" + has "^1.0.3" + jsx-ast-utils "^2.2.1" + +eslint-plugin-react-hooks@^1.6.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.1.tgz#3c66a5515ea3e0a221ffc5d4e75c971c217b1a4c" + integrity sha512-wHhmGJyVuijnYIJXZJHDUF2WM+rJYTjulUTqF9k61d3BTk8etydz+M4dXUVH7M76ZRS85rqBTCx0Es/lLsrjnA== + +eslint-plugin-react@^7.13.0: + version "7.14.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz#94c193cc77a899ac0ecbb2766fbef88685b7ecc1" + integrity sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA== + dependencies: + array-includes "^3.0.3" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.1.0" + object.entries "^1.1.0" + object.fromentries "^2.0.0" + object.values "^1.1.0" + prop-types "^15.7.2" + resolve "^1.10.1" + +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-plugin-jest@^22.2.2: - version "22.5.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.5.1.tgz#a31dfe9f9513c6af7c17ece4c65535a1370f060b" - integrity sha512-c3WjZR/HBoi4GedJRwo2OGHa8Pzo1EbSVwQ2HFzJ+4t2OoYM7Alx646EH/aaxZ+9eGcPiq0FT0UGkRuFFx2FHg== +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" eslint-scope@^4.0.0, eslint-scope@^4.0.3: version "4.0.3" @@ -2668,10 +3513,12 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" - integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== +eslint-utils@^1.3.1, eslint-utils@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" + integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + dependencies: + eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: version "1.0.0" @@ -2763,6 +3610,24 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= +eventemitter3@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + +events@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + exec-sh@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" @@ -2794,6 +3659,21 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.3.tgz#4b84301b33042cfb622771e886ed0b10e5634642" + integrity sha512-iM124nlyGSrXmuyZF1EMe83ESY2chIYVyDRZKgmcDynid2Q2v/+GuE7gNMl6Sy9Niwf4MC0DDxagOxeMPjuLsw== + dependencies: + cross-spawn "^6.0.5" + get-stream "^5.0.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^3.0.0" + onetime "^5.1.0" + p-finally "^2.0.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -2812,16 +3692,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.7.1.tgz#d91defbab4e627470a152feaf35b3c31aa1c7c14" - integrity sha512-mGfvMTPduksV3xoI0xur56pQsg2vJjNf5+a+bXOjqCkiCBbmCayrBbHS/75y9K430cfqyocPr2ZjiNiRx4SRKw== +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" ansi-styles "^3.2.0" - jest-get-type "^24.3.0" - jest-matcher-utils "^24.7.0" - jest-message-util "^24.7.1" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" jest-regex-util "^24.3.0" extend-shallow@^2.0.1: @@ -2845,9 +3725,9 @@ extend@~3.0.2: integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== external-editor@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" @@ -2883,9 +3763,9 @@ fast-deep-equal@^2.0.1: integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-glob@^2.0.2: - version "2.2.6" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.6.tgz#a5d5b697ec8deda468d85a74035290a025a95295" - integrity sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w== + version "2.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" + integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== dependencies: "@mrmlnc/readdir-enhanced" "^2.2.1" "@nodelib/fs.stat" "^1.1.2" @@ -2938,14 +3818,6 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" -fileset@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" - integrity sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA= - dependencies: - glob "^7.0.3" - minimatch "^3.0.3" - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -2956,10 +3828,26 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-cache-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== + dependencies: + commondir "^1.0.1" + make-dir "^2.0.0" + pkg-dir "^3.0.0" + +find-root@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" + integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== find-up@^1.0.0: version "1.1.2" @@ -2983,6 +3871,14 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" @@ -2993,9 +3889,9 @@ flat-cache@^2.0.1: write "1.0.3" flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== flush-write-stream@^1.0.0: version "1.1.1" @@ -3049,9 +3945,9 @@ fs-extra@^7.0.0: universalify "^0.1.0" fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + version "1.2.6" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" + integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== dependencies: minipass "^2.2.1" @@ -3078,16 +3974,6 @@ fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" -fstream@^1.0.0, fstream@^1.0.2: - version "1.0.12" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" - integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -3098,15 +3984,6 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -g-status@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/g-status/-/g-status-2.0.2.tgz#270fd32119e8fc9496f066fe5fe88e0a6bc78b97" - integrity sha512-kQoE9qH+T1AHKgSSD0Hkv98bobE90ILQcXAF4wvGgsr7uFqNvwmh8j+Lq3l0RVt3E3HjSbv2B9biEGcEtpHLCA== - dependencies: - arrify "^1.0.1" - matcher "^1.0.0" - simple-git "^1.85.0" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -3157,10 +4034,10 @@ get-port@^3.2.0: resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= -get-stdin@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - integrity sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g= +get-stdin@7.0.0, get-stdin@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" + integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== get-stdin@^4.0.1: version "4.0.1" @@ -3184,6 +4061,13 @@ get-stream@^4.0.0, get-stream@^4.1.0: dependencies: pump "^3.0.0" +get-stream@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + dependencies: + pump "^3.0.0" + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" @@ -3269,31 +4153,7 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.1.1, glob@^7.1.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== @@ -3305,7 +4165,7 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^0.1.0: +global-dirs@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= @@ -3342,9 +4202,9 @@ globby@^8.0.1: slash "^1.0.0" graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== growly@^1.3.0: version "1.3.0" @@ -3435,6 +4295,31 @@ has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -3469,12 +4354,17 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + version "2.2.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" + integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== dependencies: - agent-base "^4.1.0" + agent-base "^4.3.0" debug "^3.1.0" humanize-ms@^1.2.1: @@ -3484,21 +4374,21 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-1.3.1.tgz#26823e399300388ca2afff11cfa8a86b0033fae0" - integrity sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg== +husky@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.0.tgz#de63821a7049dc412b1afd753c259e2f6e227562" + integrity sha512-lKMEn7bRK+7f5eWPNGclDVciYNQt0GIkAQmhKl+uHP1qFzoN0h92kmH9HZ8PCwyVA2EQPD8KHf0FYWqnTxau+Q== dependencies: - cosmiconfig "^5.0.7" + cosmiconfig "^5.2.1" execa "^1.0.0" - find-up "^3.0.0" - get-stdin "^6.0.0" + get-stdin "^7.0.0" is-ci "^2.0.0" - pkg-dir "^3.0.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^4.2.0" please-upgrade-node "^3.1.1" - read-pkg "^4.0.1" + read-pkg "^5.1.1" run-node "^1.0.0" - slash "^2.0.0" + slash "^3.0.0" iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" @@ -3507,6 +4397,11 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== + iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" @@ -3529,6 +4424,11 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.0.5: + version "5.1.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.2.tgz#e28e584d43ad7e92f96995019cc43b9e1ac49558" + integrity sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -3538,9 +4438,9 @@ import-fresh@^2.0.0: resolve-from "^3.0.0" import-fresh@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" - integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -3586,7 +4486,17 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= @@ -3611,9 +4521,9 @@ init-package-json@^1.10.3: validate-npm-package-name "^3.0.0" inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.2.2: - version "6.3.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.3.1.tgz#7a413b5e7950811013a3db491c61d1f3b776e8e7" - integrity sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA== + version "6.5.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" + integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" @@ -3621,7 +4531,7 @@ inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.2.2: cli-width "^2.0.0" external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.11" + lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" rxjs "^6.4.0" @@ -3629,6 +4539,11 @@ inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.2.2: strip-ansi "^5.1.0" through "^2.3.6" +interpret@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -3665,6 +4580,13 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -3793,6 +4715,11 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -3805,31 +4732,31 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= +is-path-cwd@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== +is-path-in-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" + integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== dependencies: - is-path-inside "^1.0.0" + is-path-inside "^2.1.0" -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= +is-path-inside@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" + integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== dependencies: - path-is-inside "^1.0.1" + path-is-inside "^1.0.2" is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -3872,6 +4799,11 @@ is-stream@^1.0.1, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -3886,6 +4818,13 @@ is-text-path@^1.0.0: dependencies: text-extensions "^1.0.0" +is-text-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" + integrity sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw== + dependencies: + text-extensions "^2.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -3906,7 +4845,7 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -3946,37 +4885,11 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-api@^2.1.1: - version "2.1.7" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-2.1.7.tgz#82786b79f3b93d481349c7aa1e2c2b4eeb48c8a8" - integrity sha512-LYTOa2UrYFyJ/aSczZi/6lBykVMjCCvUmT64gOe+jPZFy4w6FYfPGqFT2IiQ2BxVHHDOvCD7qrIXb0EOh4uGWw== - dependencies: - async "^2.6.2" - compare-versions "^3.4.0" - fileset "^2.0.3" - istanbul-lib-coverage "^2.0.5" - istanbul-lib-hook "^2.0.7" - istanbul-lib-instrument "^3.3.0" - istanbul-lib-report "^2.0.8" - istanbul-lib-source-maps "^3.0.6" - istanbul-reports "^2.2.5" - js-yaml "^3.13.1" - make-dir "^2.1.0" - minimatch "^3.0.4" - once "^1.4.0" - istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== -istanbul-lib-hook@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz#c95695f383d4f8f60df1f04252a9550e15b5b133" - integrity sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA== - dependencies: - append-transform "^1.0.0" - istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" @@ -3990,7 +4903,7 @@ istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: istanbul-lib-coverage "^2.0.5" semver "^6.0.0" -istanbul-lib-report@^2.0.8: +istanbul-lib-report@^2.0.4: version "2.0.8" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== @@ -3999,7 +4912,7 @@ istanbul-lib-report@^2.0.8: make-dir "^2.1.0" supports-color "^6.1.0" -istanbul-lib-source-maps@^3.0.1, istanbul-lib-source-maps@^3.0.6: +istanbul-lib-source-maps@^3.0.1: version "3.0.6" resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== @@ -4010,73 +4923,73 @@ istanbul-lib-source-maps@^3.0.1, istanbul-lib-source-maps@^3.0.6: rimraf "^2.6.3" source-map "^0.6.1" -istanbul-reports@^2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.5.tgz#7fd354847124b46861365ac41165a4dfe5f67ea5" - integrity sha512-ilCSjE6f7elNIRxnSnIhnOpXdf3ryUT7Zkl+TaADItM638SWXjfNW40cujZCIjex4g4DTkzIy9kzwkaLruB50Q== +istanbul-reports@^2.1.1: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== dependencies: handlebars "^4.1.2" -jest-changed-files@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.7.0.tgz#39d723a11b16ed7b373ac83adc76a69464b0c4fa" - integrity sha512-33BgewurnwSfJrW7T5/ZAXGE44o7swLslwh8aUckzq2e17/2Os1V0QU506ZNik3hjs8MgnEMKNkcud442NCDTw== +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.3.0: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.7.1.tgz#6093a539073b6f4953145abeeb9709cd621044f1" - integrity sha512-32OBoSCVPzcTslGFl6yVCMzB2SqX3IrWwZCY5mZYkb0D2WsogmU3eV2o8z7+gRQa4o4sZPX/k7GU+II7CxM6WQ== +jest-cli@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== dependencies: - "@jest/core" "^24.7.1" - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" chalk "^2.0.1" exit "^0.1.2" import-local "^2.0.0" is-ci "^2.0.0" - jest-config "^24.7.1" - jest-util "^24.7.1" - jest-validate "^24.7.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" prompts "^2.0.1" realpath-native "^1.1.0" yargs "^12.0.2" -jest-config@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.7.1.tgz#6c1dd4db82a89710a3cf66bdba97827c9a1cf052" - integrity sha512-8FlJNLI+X+MU37j7j8RE4DnJkvAghXmBWdArVzypW6WxfGuxiL/CCkzBg0gHtXhD2rxla3IMOSUAHylSKYJ83g== +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.7.1" - "@jest/types" "^24.7.0" - babel-jest "^24.7.1" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.7.1" - jest-environment-node "^24.7.1" - jest-get-type "^24.3.0" - jest-jasmine2 "^24.7.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" jest-regex-util "^24.3.0" - jest-resolve "^24.7.1" - jest-util "^24.7.1" - jest-validate "^24.7.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" micromatch "^3.1.10" - pretty-format "^24.7.0" + pretty-format "^24.8.0" realpath-native "^1.1.0" -jest-diff@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.7.0.tgz#5d862899be46249754806f66e5729c07fcb3580f" - integrity sha512-ULQZ5B1lWpH70O4xsANC4tf4Ko6RrpwhE3PtG6ERjMg1TiYTC2Wp4IntJVGro6a8HG9luYHhhmF4grF0Pltckg== +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== dependencies: chalk "^2.0.1" diff-sequences "^24.3.0" - jest-get-type "^24.3.0" - pretty-format "^24.7.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" jest-docblock@^24.3.0: version "24.3.0" @@ -4085,62 +4998,57 @@ jest-docblock@^24.3.0: dependencies: detect-newline "^2.1.0" -jest-each@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.7.1.tgz#fcc7dda4147c28430ad9fb6dc7211cd17ab54e74" - integrity sha512-4fsS8fEfLa3lfnI1Jw6NxjhyRTgfpuOVTeUZZFyVYqeTa4hPhr2YkToUhouuLTrL2eMGOfpbdMyRx0GQ/VooKA== +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" chalk "^2.0.1" - jest-get-type "^24.3.0" - jest-util "^24.7.1" - pretty-format "^24.7.0" - -jest-environment-jsdom@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.7.1.tgz#a40e004b4458ebeb8a98082df135fd501b9fbbd6" - integrity sha512-Gnhb+RqE2JuQGb3kJsLF8vfqjt3PHKSstq4Xc8ic+ax7QKo4Z0RWGucU3YV+DwKR3T9SYc+3YCUQEJs8r7+Jxg== - dependencies: - "@jest/environment" "^24.7.1" - "@jest/fake-timers" "^24.7.1" - "@jest/types" "^24.7.0" - jest-mock "^24.7.0" - jest-util "^24.7.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" jsdom "^11.5.1" -jest-environment-node@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.7.1.tgz#fa2c047a31522a48038d26ee4f7c8fd9c1ecfe12" - integrity sha512-GJJQt1p9/C6aj6yNZMvovZuxTUd+BEJprETdvTKSb4kHcw4mFj8777USQV0FJoJ4V3djpOwA5eWyPwfq//PFBA== +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== dependencies: - "@jest/environment" "^24.7.1" - "@jest/fake-timers" "^24.7.1" - "@jest/types" "^24.7.0" - jest-mock "^24.7.0" - jest-util "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" -jest-get-type@^22.1.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" - integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== -jest-get-type@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.3.0.tgz#582cfd1a4f91b5cdad1d43d2932f816d543c65da" - integrity sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow== - -jest-haste-map@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.7.1.tgz#772e215cd84080d4bbcb759cfb668ad649a21471" - integrity sha512-g0tWkzjpHD2qa03mTKhlydbmmYiA2KdcJe762SbfFo/7NIMgBWAA0XqQlApPwkWOF7Cxoi/gUqL0i6DIoLpMBw== +jest-haste-map@^24.8.0: + version "24.8.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" + integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" anymatch "^2.0.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" jest-serializer "^24.4.0" - jest-util "^24.7.1" + jest-util "^24.8.0" jest-worker "^24.6.0" micromatch "^3.1.10" sane "^4.0.3" @@ -4148,65 +5056,65 @@ jest-haste-map@^24.7.1: optionalDependencies: fsevents "^1.2.7" -jest-jasmine2@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.7.1.tgz#01398686dabe46553716303993f3be62e5d9d818" - integrity sha512-Y/9AOJDV1XS44wNwCaThq4Pw3gBPiOv/s6NcbOAkVRRUEPu+36L2xoPsqQXsDrxoBerqeyslpn2TpCI8Zr6J2w== +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.7.1" - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.7.1" + expect "^24.8.0" is-generator-fn "^2.0.0" - jest-each "^24.7.1" - jest-matcher-utils "^24.7.0" - jest-message-util "^24.7.1" - jest-runtime "^24.7.1" - jest-snapshot "^24.7.1" - jest-util "^24.7.1" - pretty-format "^24.7.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" throat "^4.0.0" -jest-leak-detector@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.7.0.tgz#323ff93ed69be12e898f5b040952f08a94288ff9" - integrity sha512-zV0qHKZGXtmPVVzT99CVEcHE9XDf+8LwiE0Ob7jjezERiGVljmqKFWpV2IkG+rkFIEUHFEkMiICu7wnoPM/RoQ== +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== dependencies: - pretty-format "^24.7.0" + pretty-format "^24.8.0" -jest-matcher-utils@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.7.0.tgz#bbee1ff37bc8b2e4afcaabc91617c1526af4bcd4" - integrity sha512-158ieSgk3LNXeUhbVJYRXyTPSCqNgVXOp/GT7O94mYd3pk/8+odKTyR1JLtNOQSPzNi8NFYVONtvSWA/e1RDXg== +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== dependencies: chalk "^2.0.1" - jest-diff "^24.7.0" - jest-get-type "^24.3.0" - pretty-format "^24.7.0" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" -jest-message-util@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.7.1.tgz#f1dc3a6c195647096a99d0f1dadbc447ae547018" - integrity sha512-dk0gqVtyqezCHbcbk60CdIf+8UHgD+lmRHifeH3JRcnAqh4nEyPytSc9/L1+cQyxC+ceaeP696N4ATe7L+omcg== +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" "@types/stack-utils" "^1.0.1" chalk "^2.0.1" micromatch "^3.1.10" slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.7.0.tgz#e49ce7262c12d7f5897b0d8af77f6db8e538023b" - integrity sha512-6taW4B4WUcEiT2V9BbOmwyGuwuAFT2G8yghF7nyNW1/2gq5+6aTqSPcS9lS6ArvEkX55vbPAS/Jarx5LSm4Fng== +jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" jest-pnp-resolver@^1.2.1: version "1.2.1" @@ -4218,75 +5126,75 @@ jest-regex-util@^24.3.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== -jest-resolve-dependencies@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.7.1.tgz#cf93bbef26999488a96a2b2012f9fe7375aa378f" - integrity sha512-2Eyh5LJB2liNzfk4eo7bD1ZyBbqEJIyyrFtZG555cSWW9xVHxII2NuOkSl1yUYTAYCAmM2f2aIT5A7HzNmubyg== +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" jest-regex-util "^24.3.0" - jest-snapshot "^24.7.1" + jest-snapshot "^24.8.0" -jest-resolve@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.7.1.tgz#e4150198299298380a75a9fd55043fa3b9b17fde" - integrity sha512-Bgrc+/UUZpGJ4323sQyj85hV9d+ANyPNu6XfRDUcyFNX1QrZpSoM0kE4Mb2vZMAYTJZsBFzYe8X1UaOkOELSbw== +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" browser-resolve "^1.11.3" chalk "^2.0.1" jest-pnp-resolver "^1.2.1" realpath-native "^1.1.0" -jest-runner@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.7.1.tgz#41c8a02a06aa23ea82d8bffd69d7fa98d32f85bf" - integrity sha512-aNFc9liWU/xt+G9pobdKZ4qTeG/wnJrJna3VqunziDNsWT3EBpmxXZRBMKCsNMyfy+A/XHiV+tsMLufdsNdgCw== +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== dependencies: "@jest/console" "^24.7.1" - "@jest/environment" "^24.7.1" - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.7.1" + jest-config "^24.8.0" jest-docblock "^24.3.0" - jest-haste-map "^24.7.1" - jest-jasmine2 "^24.7.1" - jest-leak-detector "^24.7.0" - jest-message-util "^24.7.1" - jest-resolve "^24.7.1" - jest-runtime "^24.7.1" - jest-util "^24.7.1" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" jest-worker "^24.6.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.7.1.tgz#2ffd70b22dd03a5988c0ab9465c85cdf5d25c597" - integrity sha512-0VAbyBy7tll3R+82IPJpf6QZkokzXPIS71aDeqh+WzPRXRCNz6StQ45otFariPdJ4FmXpDiArdhZrzNAC3sj6A== +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== dependencies: "@jest/console" "^24.7.1" - "@jest/environment" "^24.7.1" + "@jest/environment" "^24.8.0" "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" "@types/yargs" "^12.0.2" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.7.1" - jest-haste-map "^24.7.1" - jest-message-util "^24.7.1" - jest-mock "^24.7.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" jest-regex-util "^24.3.0" - jest-resolve "^24.7.1" - jest-snapshot "^24.7.1" - jest-util "^24.7.1" - jest-validate "^24.7.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" @@ -4297,34 +5205,34 @@ jest-serializer@^24.4.0: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== -jest-snapshot@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.7.1.tgz#bd5a35f74aedff070975e9e9c90024f082099568" - integrity sha512-8Xk5O4p+JsZZn4RCNUS3pxA+ORKpEKepE+a5ejIKrId9CwrVN0NY+vkqEkXqlstA5NMBkNahXkR/4qEBy0t5yA== +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" chalk "^2.0.1" - expect "^24.7.1" - jest-diff "^24.7.0" - jest-matcher-utils "^24.7.0" - jest-message-util "^24.7.1" - jest-resolve "^24.7.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.7.0" + pretty-format "^24.8.0" semver "^5.5.0" -jest-util@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.7.1.tgz#b4043df57b32a23be27c75a2763d8faf242038ff" - integrity sha512-/KilOue2n2rZ5AnEBYoxOXkeTu6vi7cjgQ8MXEkih0oeAXT6JkS3fr7/j8+engCjciOU1Nq5loMSKe0A1oeX0A== +jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== dependencies: "@jest/console" "^24.7.1" - "@jest/fake-timers" "^24.7.1" + "@jest/fake-timers" "^24.8.0" "@jest/source-map" "^24.3.0" - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" callsites "^3.0.0" chalk "^2.0.1" graceful-fs "^4.1.15" @@ -4333,39 +5241,29 @@ jest-util@^24.7.1: slash "^2.0.0" source-map "^0.6.0" -jest-validate@^23.5.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" - integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.6.0" - -jest-validate@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.7.0.tgz#70007076f338528ee1b1c8a8258b1b0bb982508d" - integrity sha512-cgai/gts9B2chz1rqVdmLhzYxQbgQurh1PEQSvSgPZ8KGa1AqXsqC45W5wKEwzxKrWqypuQrQxnF4+G9VejJJA== +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" camelcase "^5.0.0" chalk "^2.0.1" - jest-get-type "^24.3.0" + jest-get-type "^24.8.0" leven "^2.1.0" - pretty-format "^24.7.0" + pretty-format "^24.8.0" -jest-watcher@^24.7.1: - version "24.7.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.7.1.tgz#e161363d7f3f4e1ef3d389b7b3a0aad247b673f5" - integrity sha512-Wd6TepHLRHVKLNPacEsBwlp9raeBIO+01xrN24Dek4ggTS8HHnOzYSFnvp+6MtkkJ3KfMzy220KTi95e2rRkrw== +jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== dependencies: - "@jest/test-result" "^24.7.1" - "@jest/types" "^24.7.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" "@types/yargs" "^12.0.9" ansi-escapes "^3.0.0" chalk "^2.0.1" - jest-util "^24.7.1" + jest-util "^24.8.0" string-length "^2.0.0" jest-worker@^24.6.0: @@ -4376,13 +5274,13 @@ jest-worker@^24.6.0: merge-stream "^1.0.1" supports-color "^6.1.0" -jest@24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.3.0.tgz#e16620880d9ce36b3f9341cd4d2808f85b8f16fd" - integrity sha512-c1EFvnRkTClSj9qcAF3r0UHCf5bpxdGs4+cKJwp53tct6S/ZhSk3NGjjMGBHxm41+6wnJSBl48u6nzIFxoNs9g== +jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" + integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg== dependencies: import-local "^2.0.0" - jest-cli "^24.3.0" + jest-cli "^24.8.0" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -4394,7 +5292,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.9.0: +js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -4444,7 +5342,17 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: +json-fixer@^1.3.1-0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/json-fixer/-/json-fixer-1.3.1.tgz#22189c66699801475114aacf54de0ec61e53e95b" + integrity sha512-cXDbm60QRRn/3h+uPmVdgt2rBP4VPTQo4OZO+ptw4iZIpT9REfgj/I7/0YVplpEFWph/WGNjto7TPgou2uyfOw== + dependencies: + "@babel/runtime" "^7.4.5" + chalk "^2.4.2" + eslint-config-kentcdodds "^14.3.2" + pegjs "^0.10.0" + +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== @@ -4476,6 +5384,13 @@ json5@2.x, json5@^2.1.0: dependencies: minimist "^1.2.0" +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -4498,6 +5413,14 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb" + integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ== + dependencies: + array-includes "^3.0.3" + object.assign "^4.1.0" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -4539,26 +5462,26 @@ left-pad@^1.3.0: resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== -lerna@^3.10.5: - version "3.13.4" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.13.4.tgz#03026c11c5643f341fda42e4fb1882e2df35e6cb" - integrity sha512-qTp22nlpcgVrJGZuD7oHnFbTk72j2USFimc2Pj4kC0/rXmcU2xPtCiyuxLl8y6/6Lj5g9kwEuvKDZtSXujjX/A== +lerna@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.15.0.tgz#b044dba8138d7a1a8dd48ac1d80e7541bdde0d1f" + integrity sha512-kRIQ3bgzkmew5/WZQ0C9WjH0IUf3ZmTNnBwTHfXgLkVY7td0lbwMQFD7zehflUn0zG4ou54o/gn+IfjF0ti/5A== dependencies: - "@lerna/add" "3.13.3" - "@lerna/bootstrap" "3.13.3" - "@lerna/changed" "3.13.4" - "@lerna/clean" "3.13.3" + "@lerna/add" "3.15.0" + "@lerna/bootstrap" "3.15.0" + "@lerna/changed" "3.15.0" + "@lerna/clean" "3.15.0" "@lerna/cli" "3.13.0" - "@lerna/create" "3.13.3" - "@lerna/diff" "3.13.3" - "@lerna/exec" "3.13.3" - "@lerna/import" "3.13.4" - "@lerna/init" "3.13.3" - "@lerna/link" "3.13.3" - "@lerna/list" "3.13.3" - "@lerna/publish" "3.13.4" - "@lerna/run" "3.13.3" - "@lerna/version" "3.13.4" + "@lerna/create" "3.15.0" + "@lerna/diff" "3.15.0" + "@lerna/exec" "3.15.0" + "@lerna/import" "3.15.0" + "@lerna/init" "3.15.0" + "@lerna/link" "3.15.0" + "@lerna/list" "3.15.0" + "@lerna/publish" "3.15.0" + "@lerna/run" "3.15.0" + "@lerna/version" "3.15.0" import-local "^1.0.0" npmlog "^4.1.2" @@ -4575,61 +5498,29 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libnpmaccess@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-3.0.1.tgz#5b3a9de621f293d425191aa2e779102f84167fa8" - integrity sha512-RlZ7PNarCBt+XbnP7R6PoVgOq9t+kou5rvhaInoNibhPO7eMlRfS0B8yjatgn2yaHIwWNyoJDolC/6Lc5L/IQA== - dependencies: - aproba "^2.0.0" - get-stream "^4.0.0" - npm-package-arg "^6.1.0" - npm-registry-fetch "^3.8.0" - -libnpmpublish@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-1.1.1.tgz#ff0c6bb0b4ad2bda2ad1f5fba6760a4af37125f0" - integrity sha512-nefbvJd/wY38zdt+b9SHL6171vqBrMtZ56Gsgfd0duEKb/pB8rDT4/ObUQLrHz1tOfht1flt2zM+UGaemzAG5g== - dependencies: - aproba "^2.0.0" - figgy-pudding "^3.5.1" - get-stream "^4.0.0" - lodash.clonedeep "^4.5.0" - normalize-package-data "^2.4.0" - npm-package-arg "^6.1.0" - npm-registry-fetch "^3.8.0" - semver "^5.5.1" - ssri "^6.0.1" +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -lint-staged@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.0.tgz#dbc3ae2565366d8f20efb9f9799d076da64863f2" - integrity sha512-yfSkyJy7EuVsaoxtUSEhrD81spdJOe/gMTGea3XaV7HyoRhTb9Gdlp6/JppRZERvKSEYXP9bjcmq6CA5oL2lYQ== +lint-staged@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.2.0.tgz#155e5723dffdaa55d252c47bab05a2962c1e9781" + integrity sha512-K/CQWcxYunc8lGMNTFvtI4+ybJcHW3K4Ghudz2OrJhIWdW/i1WWu9rGiVj4yJ0+D/xh8a08kp5slt89VZC9Eqg== dependencies: - "@iamstarkov/listr-update-renderer" "0.4.1" - chalk "^2.3.1" - commander "^2.14.1" - cosmiconfig "5.0.6" - debug "^3.1.0" + chalk "^2.4.2" + commander "^2.20.0" + cosmiconfig "^5.2.1" + debug "^4.1.1" dedent "^0.7.0" - del "^3.0.0" - execa "^1.0.0" - find-parent-dir "^0.3.0" - g-status "^2.0.2" - is-glob "^4.0.0" - is-windows "^1.0.2" - jest-validate "^23.5.0" - listr "^0.14.2" - lodash "^4.17.5" - log-symbols "^2.2.0" - micromatch "^3.1.8" - npm-which "^3.0.1" - p-map "^1.1.1" - path-is-inside "^1.0.2" - pify "^3.0.0" - please-upgrade-node "^3.0.2" - staged-git-files "1.1.2" - string-argv "^0.0.2" - stringify-object "^3.2.2" + del "^4.1.1" + execa "^2.0.1" + listr "^0.14.3" + log-symbols "^3.0.0" + micromatch "^4.0.2" + please-upgrade-node "^3.1.1" + string-argv "^0.3.0" + stringify-object "^3.3.0" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -4660,7 +5551,7 @@ listr-verbose-renderer@^0.5.0: date-fns "^1.27.2" figures "^2.0.0" -listr@^0.14.2: +listr@^0.14.3: version "0.14.3" resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== @@ -4686,6 +5577,16 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -4696,6 +5597,20 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" +loader-runner@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== + +loader-utils@^1.1.0, loader-utils@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -4712,6 +5627,13 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -4782,10 +5704,10 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.11, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.5, lodash@^4.2.1: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@4.17.14, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== log-symbols@^1.0.2: version "1.0.2" @@ -4794,12 +5716,12 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== +log-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== dependencies: - chalk "^2.0.1" + chalk "^2.4.2" log-update@^2.3.0: version "2.3.0" @@ -4815,7 +5737,7 @@ longest@^1.0.1: resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= -loose-envify@^1.0.0: +loose-envify@^1.0.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -4830,7 +5752,7 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lru-cache@^4.0.1, lru-cache@^4.1.2, lru-cache@^4.1.3: +lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -4846,9 +5768,9 @@ lru-cache@^5.1.1: yallist "^3.0.2" macos-release@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.2.0.tgz#ab58d55dd4714f0a05ad4b0e90f4370fef5cdea8" - integrity sha512-iV2IDxZaX8dIcM7fG6cI46uNmHUxHE4yN+Z8tKHAW1TBPMZDIKHf/3L+YnOuj/FK9il14UaVdHmiQ1tsi90ltA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" + integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== make-dir@^1.0.0: version "1.3.0" @@ -4857,7 +5779,7 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" -make-dir@^2.1.0: +make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== @@ -4870,17 +5792,34 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== -make-fetch-happen@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" - integrity sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ== +make-fetch-happen@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.2.tgz#2d156b11696fb32bffbafe1ac1bc085dd6c78a79" + integrity sha512-YMJrAjHSb/BordlsDEcVcPyTbiJKkzqMf48N8dAJZT9Zjctrkb6Yg4TY9Sq2AwSIQJFn5qBBKVTYt3vP5FMIHA== + dependencies: + agentkeepalive "^3.4.1" + cacache "^11.3.3" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + lru-cache "^5.1.1" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^4.0.0" + ssri "^6.0.0" + +make-fetch-happen@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz#a8e3fe41d3415dd656fe7b8e8172e1fb4458b38d" + integrity sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA== dependencies: agentkeepalive "^3.4.1" - cacache "^11.0.1" + cacache "^12.0.0" http-cache-semantics "^3.8.1" http-proxy-agent "^2.1.0" https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" + lru-cache "^5.1.1" mississippi "^3.0.0" node-fetch-npm "^2.0.2" promise-retry "^1.1.1" @@ -4894,6 +5833,11 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" +mamacro@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" + integrity sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA== + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -4923,17 +5867,19 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -marked@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.6.2.tgz#c574be8b545a8b48641456ca1dbe0e37b6dccc1a" - integrity sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA== +marked@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" + integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== -matcher@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2" - integrity sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg== +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: - escape-string-regexp "^1.0.4" + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" mem@^4.0.0: version "4.3.0" @@ -4944,6 +5890,19 @@ mem@^4.0.0: mimic-fn "^2.0.0" p-is-promise "^2.0.0" +memory-fs@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" + integrity sha1-8rslNovBIeORwlIN6Slpyu4KApA= + +memory-fs@^0.4.0, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + meow@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" @@ -4997,6 +5956,11 @@ merge-stream@^1.0.1: dependencies: readable-stream "^2.0.1" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + merge2@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" @@ -5021,6 +5985,22 @@ micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + mime-db@1.40.0: version "1.40.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" @@ -5038,12 +6018,22 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.0.0: +mimic-fn@^2.0.0, mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -minimatch@^3.0.0, minimatch@^3.0.3, minimatch@^3.0.4: +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.0, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -5073,7 +6063,7 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.4, minipass@^2.3.5: +minipass@^2.2.1, minipass@^2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== @@ -5081,7 +6071,7 @@ minipass@^2.2.1, minipass@^2.3.4, minipass@^2.3.5: safe-buffer "^5.1.2" yallist "^3.0.0" -minizlib@^1.1.1: +minizlib@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== @@ -5105,14 +6095,14 @@ mississippi@^3.0.0: through2 "^2.0.0" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -5142,9 +6132,9 @@ ms@2.0.0: integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.0.0, ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== multimatch@^2.1.0: version "2.1.0" @@ -5167,9 +6157,9 @@ mute-stream@~0.0.4: integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== nan@^2.12.1: - version "2.13.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" - integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== nanomatch@^1.2.9: version "1.2.13" @@ -5194,18 +6184,18 @@ natural-compare@^1.4.0: integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388" - integrity sha512-CaLXV3W8Vnbps8ZANqDGz7j4x7Yj1LW4TWF/TQuDfj7Cfx4nAPTvw98qgTevtto1oHDrh3pQkaODbqupXlsWTg== + version "2.4.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== dependencies: - debug "^4.1.0" + debug "^3.2.6" iconv-lite "^0.4.4" sax "^1.2.4" -neo-async@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" - integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== +neo-async@^2.5.0, neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== nice-try@^1.0.4: version "1.0.5" @@ -5229,17 +6219,16 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" -node-fetch@^2.3.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.5.0.tgz#8028c49fc1191bba56a07adc6e2a954644a48501" - integrity sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw== +node-fetch@^2.3.0, node-fetch@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-gyp@^3.8.0: - version "3.8.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" - integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA== +node-gyp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-4.0.0.tgz#972654af4e5dd0cd2a19081b4b46fe0442ba6f45" + integrity sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA== dependencies: - fstream "^1.0.0" glob "^7.0.3" graceful-fs "^4.1.2" mkdirp "^0.5.0" @@ -5249,7 +6238,7 @@ node-gyp@^3.8.0: request "^2.87.0" rimraf "2" semver "~5.3.0" - tar "^2.0.0" + tar "^4.4.8" which "1" node-int64@^0.4.0: @@ -5257,6 +6246,35 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= +"node-libs-browser@^1.0.0 || ^2.0.0", node-libs-browser@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" + integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^3.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.1" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.11.0" + vm-browserify "^1.0.1" + node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" @@ -5304,7 +6322,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0: +normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -5321,6 +6339,11 @@ normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + normalize-url@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" @@ -5331,14 +6354,14 @@ npm-bundled@^1.0.1: resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== -npm-lifecycle@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.0.tgz#1eda2eedb82db929e3a0c50341ab0aad140ed569" - integrity sha512-QbBfLlGBKsktwBZLj6AviHC6Q9Y3R/AY4a2PYSIRhSKSS0/CxRyD/PfxEX6tPeOCXQgMSNdwGeECacstgptc+g== +npm-lifecycle@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.1.tgz#0027c09646f0fd346c5c93377bdaba59c6748fdf" + integrity sha512-+Vg6I60Z75V/09pdcH5iUo/99Q/vop35PaI99elvxk56azSVVsdsSsS/sXqKDNwbRRNN1qSxkcO45ZOu0yOWew== dependencies: byline "^5.0.0" - graceful-fs "^4.1.11" - node-gyp "^3.8.0" + graceful-fs "^4.1.15" + node-gyp "^4.0.0" resolve-from "^4.0.0" slide "^1.1.6" uid-number "0.0.6" @@ -5355,21 +6378,14 @@ npm-lifecycle@^2.1.0: semver "^5.5.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.12, npm-packlist@^1.1.6, npm-packlist@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== +npm-packlist@^1.1.6, npm-packlist@^1.4.1, npm-packlist@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" + integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" -npm-path@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" - integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== - dependencies: - which "^1.2.10" - npm-pick-manifest@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz#32111d2a9562638bb2c8f2bf27f7f3092c8fae40" @@ -5379,18 +6395,6 @@ npm-pick-manifest@^2.2.3: npm-package-arg "^6.0.0" semver "^5.4.1" -npm-registry-fetch@^3.8.0, npm-registry-fetch@^3.9.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.9.0.tgz#44d841780e2833f06accb34488f8c7450d1a6856" - integrity sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw== - dependencies: - JSONStream "^1.3.4" - bluebird "^3.5.1" - figgy-pudding "^3.4.1" - lru-cache "^4.1.3" - make-fetch-happen "^4.0.1" - npm-package-arg "^6.1.0" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -5398,14 +6402,12 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-which@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" - integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= +npm-run-path@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-3.1.0.tgz#7f91be317f6a466efed3c9f2980ad8a4ee8b0fa5" + integrity sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg== dependencies: - commander "^2.9.0" - npm-path "^2.0.2" - which "^1.2.10" + path-key "^3.0.0" "npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.2, npmlog@^4.1.2: version "4.1.2" @@ -5432,7 +6434,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -5446,7 +6448,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.12: +object-keys@^1.0.11, object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -5458,6 +6460,36 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.entries@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" + integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +object.fromentries@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" + integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.11.0" + function-bind "^1.1.1" + has "^1.0.1" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -5473,6 +6505,16 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + octokit-pagination-methods@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" @@ -5492,6 +6534,18 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + +opencollective-postinstall@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" + integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -5512,12 +6566,17 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -os-locale@^3.0.0, os-locale@^3.1.0: +os-locale@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== @@ -5564,6 +6623,11 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +p-finally@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" + integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== + p-is-promise@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" @@ -5576,7 +6640,7 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== @@ -5597,6 +6661,13 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" @@ -5604,7 +6675,7 @@ p-map-series@^1.0.0: dependencies: p-reduce "^1.0.0" -p-map@^1.1.1, p-map@^1.2.0: +p-map@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== @@ -5619,60 +6690,39 @@ p-pipe@^1.2.0: resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" integrity sha1-SxoROZoRUgpneQ7loMHViB1r7+k= -p-reduce@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" - integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -p-waterfall@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-waterfall/-/p-waterfall-1.0.0.tgz#7ed94b3ceb3332782353af6aae11aa9fc235bb00" - integrity sha1-ftlLPOszMngjU69qrhGqn8I1uwA= +p-queue@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-4.0.0.tgz#ed0eee8798927ed6f2c2f5f5b77fdb2061a5d346" + integrity sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg== dependencies: - p-reduce "^1.0.0" + eventemitter3 "^3.1.0" -pacote@^9.5.0: - version "9.5.0" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.5.0.tgz#85f3013a3f6dd51c108b0ccabd3de8102ddfaeda" - integrity sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg== - dependencies: - bluebird "^3.5.3" - cacache "^11.3.2" - figgy-pudding "^3.5.1" - get-stream "^4.1.0" - glob "^7.1.3" - lru-cache "^5.1.1" - make-fetch-happen "^4.0.1" - minimatch "^3.0.4" - minipass "^2.3.5" - mississippi "^3.0.0" - mkdirp "^0.5.1" - normalize-package-data "^2.4.0" - npm-package-arg "^6.1.0" - npm-packlist "^1.1.12" - npm-pick-manifest "^2.2.3" - npm-registry-fetch "^3.8.0" - osenv "^0.1.5" - promise-inflight "^1.0.1" - promise-retry "^1.1.1" - protoduck "^5.0.1" - rimraf "^2.6.2" - safe-buffer "^5.1.2" - semver "^5.6.0" - ssri "^6.0.1" - tar "^4.4.8" - unique-filename "^1.1.1" - which "^1.3.1" +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +p-waterfall@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-waterfall/-/p-waterfall-1.0.0.tgz#7ed94b3ceb3332782353af6aae11aa9fc235bb00" + integrity sha1-ftlLPOszMngjU69qrhGqn8I1uwA= + dependencies: + p-reduce "^1.0.0" + +pako@~1.0.5: + version "1.0.10" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== parallel-transform@^1.1.0: version "1.1.0" @@ -5690,6 +6740,18 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-asn1@^5.0.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -5710,6 +6772,16 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" + parse-path@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.1.tgz#0ec769704949778cb3b8eda5e994c32073a1adff" @@ -5738,6 +6810,11 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= +path-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" + integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -5755,12 +6832,17 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -5770,6 +6852,11 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" + integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -5784,6 +6871,13 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -5791,11 +6885,32 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pegjs@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/pegjs/-/pegjs-0.10.0.tgz#cf8bafae6eddff4b5a7efb185269eaaf4610ddbd" + integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picomatch@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" + integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5844,7 +6959,14 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +please-upgrade-node@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== @@ -5866,33 +6988,30 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@^1.17.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.0.tgz#53b303676eed22cc14a9f0cec09b477b3026c008" - integrity sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw== - -pretty-format@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" - integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" +prettier@^1.18.2: + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== -pretty-format@^24.7.0: - version "24.7.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.7.0.tgz#d23106bc2edcd776079c2daa5da02bcb12ed0c10" - integrity sha512-apen5cjf/U4dj7tHetpC7UEFCvtAgnNZnBDkfPv3fokzIqyOJckAG9OlAPC1BlFALnqT/lGB2tl9EJjlK6eCsA== +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== dependencies: - "@jest/types" "^24.7.0" + "@jest/types" "^24.8.0" ansi-regex "^4.0.0" ansi-styles "^3.2.0" react-is "^16.8.4" process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= progress@^2.0.0: version "2.0.3" @@ -5913,9 +7032,9 @@ promise-retry@^1.1.1: retry "^0.10.0" prompts@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" - integrity sha512-HTzM3UWp/99A0gk51gAegwo1QRYA7xjcZufMNe33rCclFszUYAuHe1fIN/3ZmiHeGPkUsNaRyQm1hHOfM0PKxA== + version "2.1.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" + integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== dependencies: kleur "^3.0.2" sisteransi "^1.0.0" @@ -5927,6 +7046,15 @@ promzard@^0.3.0: dependencies: read "1" +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -5944,15 +7072,32 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24, psl@^1.1.28: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" + integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" pump@^2.0.0: version "2.0.1" @@ -5979,7 +7124,12 @@ pumpify@^1.3.3: inherits "^2.0.3" pump "^2.0.0" -punycode@^1.4.1: +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= + +punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= @@ -5999,11 +7149,36 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -6014,7 +7189,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.8.4: +react-is@^16.8.1, react-is@^16.8.4: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== @@ -6039,15 +7214,13 @@ read-cmd-shim@^1.0.1: graceful-fs "^4.1.2" read-package-tree@^5.1.6: - version "5.2.2" - resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.2.tgz#4b6a0ef2d943c1ea36a578214c9a7f6b7424f7a8" - integrity sha512-rW3XWUUkhdKmN2JKB4FL563YAgtINifso5KShykufR03nJ5loGFlkUMe1g/yxmqX073SoYYTsgXu7XdDinKZuA== + version "5.3.1" + resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" + integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== dependencies: - debuglog "^1.0.1" - dezalgo "^1.0.0" - once "^1.3.0" read-package-json "^2.0.0" readdir-scoped-modules "^1.0.0" + util-promisify "^2.1.0" read-pkg-up@^1.0.1: version "1.0.1" @@ -6057,6 +7230,14 @@ read-pkg-up@^1.0.1: find-up "^1.0.0" read-pkg "^1.0.0" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" @@ -6073,6 +7254,15 @@ read-pkg-up@^4.0.0: find-up "^3.0.0" read-pkg "^3.0.0" +read-pkg-up@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-6.0.0.tgz#da75ce72762f2fa1f20c5a40d4dd80c77db969e3" + integrity sha512-odtTvLl+EXo1eTsMnoUHRmg/XmXdTkwXVxy4VFE9Kp6cCq7b3l7QMdBndND3eAFzrbSAXC/WCUOQQ9rLjifKZw== + dependencies: + find-up "^4.0.0" + read-pkg "^5.1.1" + type-fest "^0.5.0" + read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -6082,6 +7272,15 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" @@ -6091,14 +7290,15 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -read-pkg@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" - integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= +read-pkg@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: - normalize-package-data "^2.3.2" - parse-json "^4.0.0" - pify "^3.0.0" + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" read@1, read@~1.0.1: version "1.0.7" @@ -6107,7 +7307,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -6121,24 +7321,33 @@ read@1, read@~1.0.1: util-deprecate "~1.0.1" "readable-stream@2 || 3", readable-stream@^3.0.2: - version "3.3.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9" - integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw== + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== dependencies: inherits "^2.0.3" string_decoder "^1.1.1" util-deprecate "^1.0.1" readdir-scoped-modules@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" - integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= + version "1.1.0" + resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" + integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== dependencies: debuglog "^1.0.1" dezalgo "^1.0.0" graceful-fs "^4.1.2" once "^1.3.0" +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" @@ -6259,11 +7468,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" @@ -6281,22 +7485,27 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" -resolve-from@4.0.0, resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve-from@5.0.0, resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= -resolve-global@0.1.0, resolve-global@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-0.1.0.tgz#8fb02cfd5b7db20118e886311f15af95bd15fbd9" - integrity sha1-j7As/Vt9sgEY6IYxHxWvlb0V+9k= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-global@1.0.0, resolve-global@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-1.0.0.tgz#a2a79df4af2ca3f49bf77ef9ddacd322dad19255" + integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== dependencies: - global-dirs "^0.1.0" + global-dirs "^0.1.1" resolve-url@^0.2.1: version "0.2.1" @@ -6308,10 +7517,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.x, resolve@^1.10.0, resolve@^1.3.2: - version "1.10.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" - integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== +resolve@1.x, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" @@ -6338,17 +7547,25 @@ right-pad@^1.0.1: resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" integrity sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA= -rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@2.6.3, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + rsvp@^4.8.4: - version "4.8.4" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" - integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA== + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== run-async@^2.2.0: version "2.3.0" @@ -6370,13 +7587,18 @@ run-queue@^1.0.0, run-queue@^1.0.3: aproba "^1.1.1" rxjs@^6.3.3, rxjs@^6.4.0: - version "6.5.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.1.tgz#f7a005a9386361921b8524f38f54cbf80e5d08f4" - integrity sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg== + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -6413,61 +7635,73 @@ sax@^1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" + semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -semver@5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== - -semver@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +semver@6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== -semver@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" - integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== +semver@^6.0.0, semver@^6.1.1, semver@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= +serialize-javascript@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" + integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA== + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" is-plain-object "^2.0.3" split-string "^3.0.1" +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -6490,17 +7724,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -simple-git@^1.85.0: - version "1.110.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.110.0.tgz#54eb179089d055a7783d32399246cebc9d9933e9" - integrity sha512-UYY0rQkknk0P5eb+KW+03F4TevZ9ou0H+LoGaj7iiVgpnZH4wdj/HTViy/1tNNkmIPcmtxuBqXWiYt2YwlRKOQ== - dependencies: - debug "^4.0.1" - sisteransi@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" - integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + version "1.0.2" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.2.tgz#ec57d64b6f25c4f26c0e2c7dd23f2d7f12f7e418" + integrity sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w== slash@^1.0.0: version "1.0.0" @@ -6512,6 +7739,11 @@ slash@^2.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -6589,6 +7821,11 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== + source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -6600,7 +7837,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6: +source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.12" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== @@ -6645,9 +7882,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" - integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -6702,11 +7939,6 @@ stack-utils@^1.0.1: resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== -staged-git-files@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.2.tgz#4326d33886dc9ecfa29a6193bf511ba90a46454b" - integrity sha512-0Eyrk6uXW6tg9PYkhi/V/J4zHp33aNyi2hOCmhFLqLTIhbgqWn5jlSzI+IU0VqrZq6+DbHcabQl/WP6P3BG0QA== - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -6720,6 +7952,14 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= +stream-browserify@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -6728,15 +7968,26 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= -string-argv@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" - integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= +string-argv@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.0.tgz#0ea99e7257fea5e97a1bfcdfc19cf12d68e6ec6a" + integrity sha512-NGZHq3nkSXVtGZXTBjFru3MNfoZyIzN25T7BmvdgnSC0LCJczAGLLMQLyjywSIaAoqSemgLzBRHOsnrHbt60+Q== string-length@^2.0.0: version "2.0.0" @@ -6763,7 +8014,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0: +string-width@^3.0.0, string-width@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== @@ -6772,7 +8023,7 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string_decoder@^1.1.1: +string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== @@ -6786,7 +8037,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.2.2: +stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== @@ -6809,7 +8060,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0: +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -6833,6 +8084,11 @@ strip-eof@^1.0.0: resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" @@ -6884,41 +8140,42 @@ symbol-observable@^1.1.0: integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" - integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + version "5.4.4" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.4.tgz#6e0f88fdae3692793d1077fd172a4667afe986a6" + integrity sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg== dependencies: - ajv "^6.9.1" - lodash "^4.17.11" + ajv "^6.10.2" + lodash "^4.17.14" slice-ansi "^2.1.0" string-width "^3.0.0" -tar@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" +tapable@^0.1.8: + version "0.1.10" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.1.10.tgz#29c35707c2b70e50d07482b5d202e8ed446dafd4" + integrity sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q= + +tapable@^1.0.0, tapable@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar@^4, tar@^4.4.8: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== +tar@^4, tar@^4.4.10, tar@^4.4.8: + version "4.4.10" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" + integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" + minipass "^2.3.5" + minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" - yallist "^3.0.2" + yallist "^3.0.3" temp-dir@^1.0.0: version "1.0.0" @@ -6937,6 +8194,31 @@ temp-write@^3.4.0: temp-dir "^1.0.0" uuid "^3.0.1" +terser-webpack-plugin@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz#69aa22426299f4b5b3775cbed8cb2c5d419aa1d4" + integrity sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg== + dependencies: + cacache "^11.3.2" + find-cache-dir "^2.0.0" + is-wsl "^1.1.0" + loader-utils "^1.2.3" + schema-utils "^1.0.0" + serialize-javascript "^1.7.0" + source-map "^0.6.1" + terser "^4.0.0" + webpack-sources "^1.3.0" + worker-farm "^1.7.0" + +terser@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.1.2.tgz#b2656c8a506f7ce805a3f300a2ff48db022fa391" + integrity sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + test-exclude@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" @@ -6952,6 +8234,11 @@ text-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== +text-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.0.0.tgz#43eabd1b495482fae4a2bf65e5f56c29f69220f6" + integrity sha512-F91ZqLgvi1E0PdvmxMgp+gcf6q8fMH7mhdwWfzXnl1k+GbpQDmi8l7DzLC5JTASKbwpY3TfxajAUzAXcv2NmsQ== + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -6982,6 +8269,13 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== + dependencies: + setimmediate "^1.0.4" + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -6994,6 +8288,11 @@ tmpl@1.0.x: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -7014,6 +8313,13 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" @@ -7082,26 +8388,26 @@ ts-jest@^24.0.0: semver "^5.5" yargs-parser "10.x" -ts-node@^8.0.1: - version "8.1.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.1.0.tgz#8c4b37036abd448577db22a061fd7a67d47e658e" - integrity sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A== +ts-node@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.3.0.tgz#e4059618411371924a1fb5f3b125915f324efb57" + integrity sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ== dependencies: arg "^4.1.0" - diff "^3.1.0" + diff "^4.0.1" make-error "^1.1.1" source-map-support "^0.5.6" yn "^3.0.0" tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslint@^5.11.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.16.0.tgz#ae61f9c5a98d295b9a4f4553b1b1e831c1984d67" - integrity sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA== +tslint@^5.18.0: + version "5.18.0" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.18.0.tgz#f61a6ddcf372344ac5e41708095bbf043a147ac6" + integrity sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" @@ -7109,7 +8415,7 @@ tslint@^5.11.0: commander "^2.12.1" diff "^3.2.0" glob "^7.1.1" - js-yaml "^3.13.0" + js-yaml "^3.13.1" minimatch "^3.0.4" mkdirp "^0.5.1" resolve "^1.3.2" @@ -7124,13 +8430,18 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" -tsutils@^3.7.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.10.0.tgz#6f1c95c94606e098592b0dff06590cf9659227d6" - integrity sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q== +tsutils@^3.14.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77" + integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw== dependencies: tslib "^1.8.1" +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -7150,6 +8461,16 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-fest@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" + integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== + +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -7166,9 +8487,9 @@ typescript@*: integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== uglify-js@^3.1.4: - version "3.5.10" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.10.tgz#652bef39f86d9dbfd6674407ee05a5e2d372cf2d" - integrity sha512-/GTF0nosyPLbdJBd+AwYiZ+Hu5z8KXWnO0WCGt1BQ/u9Iamhejykqmz5o1OHJ53+VAk6xVxychonnApDjuqGsw== + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== dependencies: commander "~2.20.0" source-map "~0.6.1" @@ -7184,14 +8505,14 @@ umask@^1.1.0: integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unique-filename@^1.1.1: version "1.1.1" @@ -7201,16 +8522,16 @@ unique-filename@^1.1.1: unique-slug "^2.0.0" unique-slug@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" - integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== + version "2.0.2" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" + integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== dependencies: imurmurhash "^0.1.4" -universal-user-agent@^2.0.0, universal-user-agent@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.0.3.tgz#9f6f09f9cc33de867bb720d84c08069b14937c6c" - integrity sha512-eRHEHhChCBHrZsA4WEhdgiOKgdvgrMIHwnwnqD0r5C6AO8kwKcG7qSku3iXdhvHL3YvsS9ZkSGN8h/hIpoFC8g== +universal-user-agent@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-3.0.0.tgz#4cc88d68097bffd7ac42e3b7c903e7481424b4b9" + integrity sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA== dependencies: os-name "^3.0.0" @@ -7227,6 +8548,11 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -7244,6 +8570,14 @@ url-template@^2.0.8: resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -7254,6 +8588,13 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +util-promisify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53" + integrity sha1-PCI2R2xNMsX/PEcAKt18E7moKlM= + dependencies: + object.getownpropertydescriptors "^2.0.3" + util.promisify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" @@ -7262,6 +8603,20 @@ util.promisify@^1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== + dependencies: + inherits "2.0.3" + uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" @@ -7291,6 +8646,11 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vm-browserify@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" + integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== + w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" @@ -7305,6 +8665,15 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" +watchpack@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -7317,6 +8686,43 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +webpack-sources@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@^4.33.0: + version "4.36.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.36.1.tgz#f546fda7a403a76faeaaa7196c50d12370ed18a9" + integrity sha512-Ej01/N9W8DVyhEpeQnbUdGvOECw0L46FxS12cCOs8gSK7bhUlrbHRnWkjiXckGlHjUrmL89kDpTRIkUk6Y+fKg== + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/wasm-edit" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + acorn "^6.2.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chrome-trace-event "^1.0.0" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.0" + json-parse-better-errors "^1.0.2" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + micromatch "^3.1.8" + mkdirp "~0.5.0" + neo-async "^2.5.0" + node-libs-browser "^2.0.0" + schema-utils "^1.0.0" + tapable "^1.1.0" + terser-webpack-plugin "^1.1.0" + watchpack "^1.5.0" + webpack-sources "^1.3.0" + whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" @@ -7357,7 +8763,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1, which@^1.2.10, which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@1, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -7393,6 +8799,13 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +worker-farm@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" + integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw== + dependencies: + errno "~0.1.7" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -7409,6 +8822,15 @@ wrap-ansi@^3.0.1: string-width "^2.1.1" strip-ansi "^4.0.0" +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -7424,9 +8846,9 @@ write-file-atomic@2.4.1: signal-exit "^3.0.2" write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.2.tgz#a7181706dfba17855d221140a9c06e15fcdd87b9" - integrity sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g== + version "2.4.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" + integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== dependencies: graceful-fs "^4.1.11" imurmurhash "^0.1.4" @@ -7471,10 +8893,10 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== -xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" @@ -7486,7 +8908,7 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.2: +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== @@ -7506,10 +8928,10 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.0.0.tgz#3fc44f3e76a8bdb1cc3602e860108602e5ccde8b" - integrity sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw== +yargs-parser@^13.1.1: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" @@ -7533,21 +8955,20 @@ yargs@^12.0.1, yargs@^12.0.2: yargs-parser "^11.1.1" yargs@^13.1.0: - version "13.2.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993" - integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA== + version "13.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" + integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== dependencies: - cliui "^4.0.0" + cliui "^5.0.0" find-up "^3.0.0" get-caller-file "^2.0.1" - os-locale "^3.1.0" require-directory "^2.1.1" require-main-filename "^2.0.0" set-blocking "^2.0.0" string-width "^3.0.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^13.0.0" + yargs-parser "^13.1.1" yn@^3.0.0: version "3.1.0" From 3777b770670440c3e47b451d862e5cb57b79e40d Mon Sep 17 00:00:00 2001 From: Ben Lichtman Date: Sun, 28 Jul 2019 11:15:07 -0700 Subject: [PATCH 21/38] feat(typescript-estree)!: throw error on file not in project when `project` set (#760) BREAKING CHANGE: by default we will now throw when a file is not in the `project` provided --- .prettierignore | 1 + .../tests/fixture-project/1.ts | 1 + .../tests/fixture-project/2.ts | 1 + .../tests/fixture-project/3.ts | 1 + .../tests/fixture-project/4.ts | 1 + .../tests/fixture-project/5.ts | 1 + .../tests/fixture-project/6.ts | 1 + .../tests/fixture-project/tsconfig.json | 1 + .../eslint-plugin-tslint/tests/index.spec.ts | 31 ++++++++---- .../tests/test-project/extra.ts | 1 + packages/eslint-plugin/tests/RuleTester.ts | 25 ++++++++++ packages/eslint-plugin/tests/fixtures/file.ts | 0 .../rules/no-unnecessary-qualifier.test.ts | 1 - packages/parser/README.md | 15 ++++++ packages/parser/tests/lib/parser.ts | 4 +- .../typescript-estree/src/parser-options.ts | 2 + packages/typescript-estree/src/parser.ts | 41 ++++++++++----- .../typescript-estree/src/tsconfig-parser.ts | 10 ++++ .../tests/fixtures/simpleProject/file.ts | 0 .../fixtures/simpleProject/tsconfig.json | 1 + packages/typescript-estree/tests/lib/parse.ts | 26 +++++++--- .../tests/lib/semanticInfo.ts | 50 ++++++++++++------- tests/integration/utils/.eslintrc.js | 5 ++ tests/integration/utils/jsconfig.json | 3 ++ 24 files changed, 173 insertions(+), 50 deletions(-) create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/1.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/2.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/3.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/4.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/5.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/6.ts create mode 100644 packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json create mode 100644 packages/eslint-plugin-tslint/tests/test-project/extra.ts create mode 100644 packages/eslint-plugin/tests/fixtures/file.ts create mode 100644 packages/typescript-estree/tests/fixtures/simpleProject/file.ts create mode 100644 packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json create mode 100644 tests/integration/utils/.eslintrc.js create mode 100644 tests/integration/utils/jsconfig.json diff --git a/.prettierignore b/.prettierignore index 1dd0c3996671..a86a2f04fc90 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ **/tests/fixtures/**/* +**/tests/fixture-project/**/* **/dist **/coverage **/shared-fixtures diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/1.ts b/packages/eslint-plugin-tslint/tests/fixture-project/1.ts new file mode 100644 index 000000000000..0870b5cd2825 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/1.ts @@ -0,0 +1 @@ +var foo = true; diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/2.ts b/packages/eslint-plugin-tslint/tests/fixture-project/2.ts new file mode 100644 index 000000000000..3da535b2cde3 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/2.ts @@ -0,0 +1 @@ +throw 'should be ok because rule is not loaded'; diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/3.ts b/packages/eslint-plugin-tslint/tests/fixture-project/3.ts new file mode 100644 index 000000000000..e71f830c3915 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/3.ts @@ -0,0 +1 @@ +throw 'err'; // no-string-throw diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/4.ts b/packages/eslint-plugin-tslint/tests/fixture-project/4.ts new file mode 100644 index 000000000000..1ca8bbace361 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/4.ts @@ -0,0 +1 @@ +var foo = true // semicolon diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/5.ts b/packages/eslint-plugin-tslint/tests/fixture-project/5.ts new file mode 100644 index 000000000000..2fc07810720c --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/5.ts @@ -0,0 +1 @@ +var foo = true; // fail diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/6.ts b/packages/eslint-plugin-tslint/tests/fixture-project/6.ts new file mode 100644 index 000000000000..e901f01b4874 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/6.ts @@ -0,0 +1 @@ +foo; diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json b/packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/eslint-plugin-tslint/tests/index.spec.ts b/packages/eslint-plugin-tslint/tests/index.spec.ts index 88a3a648b076..0de1046ecf3f 100644 --- a/packages/eslint-plugin-tslint/tests/index.spec.ts +++ b/packages/eslint-plugin-tslint/tests/index.spec.ts @@ -12,7 +12,7 @@ const ruleTester = new TSESLint.RuleTester({ * Project is needed to generate the parserServices * within @typescript-eslint/parser */ - project: './tests/tsconfig.json', + project: './tests/fixture-project/tsconfig.json', }, parser: require.resolve('@typescript-eslint/parser'), }); @@ -47,6 +47,7 @@ ruleTester.run('tslint/config', rule, { { code: 'var foo = true;', options: tslintRulesConfig, + filename: './tests/fixture-project/1.ts', }, { filename: './tests/test-project/file-spec.ts', @@ -62,6 +63,7 @@ ruleTester.run('tslint/config', rule, { { code: 'throw "should be ok because rule is not loaded";', options: tslintRulesConfig, + filename: './tests/fixture-project/2.ts', }, ], @@ -69,6 +71,7 @@ ruleTester.run('tslint/config', rule, { { options: [{ lintFile: './tests/test-project/tslint.json' }], code: 'throw "err" // no-string-throw', + filename: './tests/fixture-project/3.ts', errors: [ { messageId: 'failure', @@ -84,6 +87,7 @@ ruleTester.run('tslint/config', rule, { code: 'var foo = true // semicolon', options: tslintRulesConfig, output: 'var foo = true // semicolon', + filename: './tests/fixture-project/4.ts', errors: [ { messageId: 'failure', @@ -100,6 +104,7 @@ ruleTester.run('tslint/config', rule, { code: 'var foo = true // fail', options: tslintRulesDirectoryConfig, output: 'var foo = true // fail', + filename: './tests/fixture-project/5.ts', errors: [ { messageId: 'failure', @@ -174,26 +179,30 @@ describe('tslint/error', () => { }); }); - it('should not crash if there is no tslint rules specified', () => { + it('should not crash if there are no tslint rules specified', () => { const linter = new TSESLint.Linter(); jest.spyOn(console, 'warn').mockImplementation(); linter.defineRule('tslint/config', rule); linter.defineParser('@typescript-eslint/parser', parser); expect(() => - linter.verify('foo;', { - parserOptions: { - project: `${__dirname}/test-project/tsconfig.json`, - }, - rules: { - 'tslint/config': [2, {}], + linter.verify( + 'foo;', + { + parserOptions: { + project: `${__dirname}/test-project/tsconfig.json`, + }, + rules: { + 'tslint/config': [2, {}], + }, + parser: '@typescript-eslint/parser', }, - parser: '@typescript-eslint/parser', - }), + `${__dirname}/test-project/extra.ts`, + ), ).not.toThrow(); expect(console.warn).toHaveBeenCalledWith( expect.stringContaining( - 'Tried to lint but found no valid, enabled rules for this file type and file path in the resolved configuration.', + `Tried to lint ${__dirname}/test-project/extra.ts but found no valid, enabled rules for this file type and file path in the resolved configuration.`, ), ); jest.resetAllMocks(); diff --git a/packages/eslint-plugin-tslint/tests/test-project/extra.ts b/packages/eslint-plugin-tslint/tests/test-project/extra.ts new file mode 100644 index 000000000000..e901f01b4874 --- /dev/null +++ b/packages/eslint-plugin-tslint/tests/test-project/extra.ts @@ -0,0 +1 @@ +foo; diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 0733e1887cb2..fe3d06d4fc87 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -7,6 +7,8 @@ type RuleTesterConfig = Omit & { parser: typeof parser; }; class RuleTester extends TSESLint.RuleTester { + private filename: string | undefined = undefined; + // as of eslint 6 you have to provide an absolute path to the parser // but that's not as clean to type, this saves us trying to manually enforce // that contributors require.resolve everything @@ -15,6 +17,10 @@ class RuleTester extends TSESLint.RuleTester { ...options, parser: require.resolve(options.parser), }); + + if (options.parserOptions && options.parserOptions.project) { + this.filename = path.join(getFixturesRootDir(), 'file.ts'); + } } // as of eslint 6 you have to provide an absolute path to the parser @@ -26,17 +32,36 @@ class RuleTester extends TSESLint.RuleTester { tests: TSESLint.RunTests, ): void { const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`; + + if (this.filename) { + tests.valid = tests.valid.map(test => { + if (typeof test === 'string') { + return { + code: test, + filename: this.filename, + }; + } + return test; + }); + } + tests.valid.forEach(test => { if (typeof test !== 'string') { if (test.parser === parser) { throw new Error(errorMessage); } + if (!test.filename) { + test.filename = this.filename; + } } }); tests.invalid.forEach(test => { if (test.parser === parser) { throw new Error(errorMessage); } + if (!test.filename) { + test.filename = this.filename; + } }); super.run(name, rule, tests); diff --git a/packages/eslint-plugin/tests/fixtures/file.ts b/packages/eslint-plugin/tests/fixtures/file.ts new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 53a349e552ee..75236704c853 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -199,7 +199,6 @@ import * as Foo from './foo'; declare module './foo' { const x: Foo.T = 3; }`, - filename: path.join(rootPath, 'bar.ts'), errors: [ { messageId, diff --git a/packages/parser/README.md b/packages/parser/README.md index 78d17e6388fb..45c620280f15 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -50,8 +50,23 @@ The following additional configuration options are available by specifying them - **`project`** - default `undefined`. This option allows you to provide a path to your project's `tsconfig.json`. **This setting is required if you want to use rules which require type information**. You may want to use this setting in tandem with the `tsconfigRootDir` option below. + - Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows: + + ```ts + { + "extends": "./tsconfig.json", // path to existing tsconfig + "includes": [ + "src/**/*.ts", + "test/**/*.ts", + // etc + ] + } + ``` + - **`tsconfigRootDir`** - default `undefined`. This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above. +- **`createDefaultProgram`** - default `false`. This option allows you to request that when the `project` setting is specified, files will be allowed when not included in the projects defined by the provided `tsconfig.json` files. However, this may incur significant performance costs, so this option is primarily included for backwards-compatibility. See the **`project`** section for more information. + - **`extraFileExtensions`** - default `undefined`. This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. E.g. a `.vue` file - **`warnOnUnsupportedTypeScriptVersion`** - default `true`. This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index 0a00ef5ad155..782d474afc36 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -50,12 +50,12 @@ describe('parser', () => { jsx: false, }, // ts-estree specific - filePath: 'test/foo', + filePath: 'tests/fixtures/services/isolated-file.src.ts', project: 'tsconfig.json', useJSXTextNode: false, errorOnUnknownASTType: false, errorOnTypeScriptSyntacticAndSemanticIssues: false, - tsconfigRootDir: './', + tsconfigRootDir: 'tests/fixtures/services', extraFileExtensions: ['foo'], }; parseForESLint(code, config); diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index c224b7da5659..77a649f6f309 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -18,6 +18,7 @@ export interface Extra { tsconfigRootDir: string; extraFileExtensions: string[]; preserveNodeMaps?: boolean; + createDefaultProgram: boolean; } export interface TSESTreeOptions { @@ -35,6 +36,7 @@ export interface TSESTreeOptions { tsconfigRootDir?: string; extraFileExtensions?: string[]; preserveNodeMaps?: boolean; + createDefaultProgram?: boolean; } // This lets us use generics to type the return value, and removes the need to diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index aed8f04b8d27..564114d7ccb7 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -58,6 +58,7 @@ function resetExtra(): void { tsconfigRootDir: process.cwd(), extraFileExtensions: [], preserveNodeMaps: undefined, + createDefaultProgram: false, }; } @@ -66,20 +67,27 @@ function resetExtra(): void { * @param options The config object * @returns If found, returns the source file corresponding to the code and the containing program */ -function getASTFromProject(code: string, options: TSESTreeOptions) { - return firstDefined( - calculateProjectParserOptions( - code, - options.filePath || getFileName(options), - extra, - ), +function getASTFromProject( + code: string, + options: TSESTreeOptions, + createDefaultProgram: boolean, +) { + const filePath = options.filePath || getFileName(options); + const astAndProgram = firstDefined( + calculateProjectParserOptions(code, filePath, extra), currentProgram => { - const ast = currentProgram.getSourceFile( - options.filePath || getFileName(options), - ); + const ast = currentProgram.getSourceFile(filePath); return ast && { ast, program: currentProgram }; }, ); + + if (!astAndProgram && !createDefaultProgram) { + throw new Error( + `If "parserOptions.project" has been set for @typescript-eslint/parser, ${filePath} must be included in at least one of the projects provided.`, + ); + } + + return astAndProgram; } /** @@ -161,10 +169,14 @@ function getProgramAndAST( code: string, options: TSESTreeOptions, shouldProvideParserServices: boolean, + createDefaultProgram: boolean, ) { return ( - (shouldProvideParserServices && getASTFromProject(code, options)) || - (shouldProvideParserServices && getASTAndDefaultProject(code, options)) || + (shouldProvideParserServices && + getASTFromProject(code, options, createDefaultProgram)) || + (shouldProvideParserServices && + createDefaultProgram && + getASTAndDefaultProject(code, options)) || createNewProgram(code) ); } @@ -254,6 +266,10 @@ function applyParserOptionsToExtra(options: TSESTreeOptions): void { if (options.preserveNodeMaps === undefined && extra.projects.length > 0) { extra.preserveNodeMaps = true; } + + extra.createDefaultProgram = + typeof options.createDefaultProgram === 'boolean' && + options.createDefaultProgram; } function warnAboutTSVersion(): void { @@ -386,6 +402,7 @@ export function parseAndGenerateServices< code, options, shouldProvideParserServices, + extra.createDefaultProgram, ); /** * Determine whether or not two-way maps of converted AST nodes should be preserved diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 855355fe689b..091990533498 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -30,6 +30,16 @@ const watchCallbackTrackingMap = new Map(); const parsedFilesSeen = new Set(); +/** + * Clear tsconfig caches. + * Primarily used for testing. + */ +export function clearCaches() { + knownWatchProgramMap.clear(); + watchCallbackTrackingMap.clear(); + parsedFilesSeen.clear(); +} + /** * Holds information about the file currently being linted */ diff --git a/packages/typescript-estree/tests/fixtures/simpleProject/file.ts b/packages/typescript-estree/tests/fixtures/simpleProject/file.ts new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json b/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index 3d8dfe222e45..57a4bc057424 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -2,6 +2,9 @@ import * as parser from '../../src/parser'; import * as astConverter from '../../src/ast-converter'; import { TSESTreeOptions } from '../../src/parser-options'; import { createSnapshotTestBlock } from '../../tools/test-utils'; +import { join } from 'path'; + +const FIXTURES_DIR = './tests/fixtures/simpleProject'; describe('parse()', () => { describe('basic functionality', () => { @@ -91,6 +94,7 @@ describe('parse()', () => { tsconfigRootDir: expect.any(String), useJSXTextNode: false, preserveNodeMaps: false, + createDefaultProgram: false, }, false, ); @@ -137,6 +141,12 @@ describe('parse()', () => { tokens: true, range: true, loc: true, + filePath: 'tests/fixtures/simpleProject/file.ts', + }; + const projectConfig: TSESTreeOptions = { + ...baseConfig, + tsconfigRootDir: join(process.cwd(), FIXTURES_DIR), + project: './tsconfig.json', }; it('should not impact the use of parse()', () => { @@ -167,10 +177,10 @@ describe('parse()', () => { expect(noOptionSet.services.esTreeNodeToTSNodeMap).toBeUndefined(); expect(noOptionSet.services.tsNodeToESTreeNodeMap).toBeUndefined(); - const withProjectNoOptionSet = parser.parseAndGenerateServices(code, { - ...baseConfig, - project: './tsconfig.json', - }); + const withProjectNoOptionSet = parser.parseAndGenerateServices( + code, + projectConfig, + ); expect(withProjectNoOptionSet.services.esTreeNodeToTSNodeMap).toEqual( expect.any(WeakMap), @@ -194,9 +204,8 @@ describe('parse()', () => { ); const withProjectOptionSetToTrue = parser.parseAndGenerateServices(code, { - ...baseConfig, + ...projectConfig, preserveNodeMaps: true, - project: './tsconfig.json', }); expect(withProjectOptionSetToTrue.services.esTreeNodeToTSNodeMap).toEqual( @@ -218,7 +227,10 @@ describe('parse()', () => { const withProjectOptionSetToFalse = parser.parseAndGenerateServices( code, - { ...baseConfig, preserveNodeMaps: false, project: './tsconfig.json' }, + { + ...projectConfig, + preserveNodeMaps: false, + }, ); expect( diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 3f0a69b30537..7e5c634db9d3 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -13,6 +13,7 @@ import { ParseAndGenerateServicesResult, } from '../../src/parser'; import { TSESTree } from '../../src/ts-estree'; +import { clearCaches } from '../../src/tsconfig-parser'; const FIXTURES_DIR = './tests/fixtures/semanticInfo'; const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.ts`); @@ -28,11 +29,14 @@ function createOptions(fileName: string): TSESTreeOptions & { cwd?: string } { errorOnUnknownASTType: true, filePath: fileName, tsconfigRootDir: join(process.cwd(), FIXTURES_DIR), - project: './tsconfig.json', + project: `./tsconfig.json`, loggerFn: false, }; } +// ensure tsconfig-parser caches are clean for each test +beforeEach(() => clearCaches()); + describe('semanticInfo', () => { // test all AST snapshots testFiles.forEach(filename => { @@ -193,12 +197,14 @@ describe('semanticInfo', () => { it('non-existent file tests', () => { const parseResult = parseCodeAndGenerateServices( `const x = [parseInt("5")];`, - createOptions(''), + { + ...createOptions(''), + project: undefined, + preserveNodeMaps: true, + }, ); - // get type checker - expect(parseResult).toHaveProperty('services.program.getTypeChecker'); - const checker = parseResult.services.program!.getTypeChecker(); + expect(parseResult.services.program).toBeUndefined(); // get bound name const boundName = (parseResult.ast.body[0] as TSESTree.VariableDeclaration) @@ -210,8 +216,6 @@ describe('semanticInfo', () => { ); expect(tsBoundName).toBeDefined(); - checkNumberArrayType(checker, tsBoundName); - expect(parseResult.services.tsNodeToESTreeNodeMap!.get(tsBoundName)).toBe( boundName, ); @@ -220,18 +224,21 @@ describe('semanticInfo', () => { it('non-existent file should provide parents nodes', () => { const parseResult = parseCodeAndGenerateServices( `function M() { return Base }`, - createOptions(''), + { ...createOptions(''), project: undefined }, ); - // https://github.com/JamesHenry/typescript-estree/issues/77 - expect(parseResult.services.program).toBeDefined(); - expect( - parseResult.services.program!.getSourceFile(''), - ).toBeDefined(); - expect( - parseResult.services.program!.getSourceFile('')!.statements[0] - .parent, - ).toBeDefined(); + expect(parseResult.services.program).toBeUndefined(); + }); + + it(`non-existent file should throw error when project provided`, () => { + expect(() => + parseCodeAndGenerateServices( + `function M() { return Base }`, + createOptions(''), + ), + ).toThrow( + `If "parserOptions.project" has been set for @typescript-eslint/parser, must be included in at least one of the projects provided.`, + ); }); it('non-existent project file', () => { @@ -260,6 +267,15 @@ describe('semanticInfo', () => { parseCodeAndGenerateServices(readFileSync(fileName, 'utf8'), badConfig), ).toThrowErrorMatchingSnapshot(); }); + + it('default program produced with option', () => { + const parseResult = parseCodeAndGenerateServices('var foo = 5;', { + ...createOptions(''), + createDefaultProgram: true, + }); + + expect(parseResult.services.program).toBeDefined(); + }); }); function testIsolatedFile( diff --git a/tests/integration/utils/.eslintrc.js b/tests/integration/utils/.eslintrc.js new file mode 100644 index 000000000000..8ca32766a124 --- /dev/null +++ b/tests/integration/utils/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + parserOptions: { + project: `${__dirname}/jsconfig.json`, + }, +}; diff --git a/tests/integration/utils/jsconfig.json b/tests/integration/utils/jsconfig.json new file mode 100644 index 000000000000..d53d21eadfbb --- /dev/null +++ b/tests/integration/utils/jsconfig.json @@ -0,0 +1,3 @@ +{ + "exclude": [".eslintrc.js"] +} From f953cbdba45c6259664ae0b3ea2d198098d8923d Mon Sep 17 00:00:00 2001 From: James Henry Date: Sun, 28 Jul 2019 15:40:27 -0400 Subject: [PATCH 22/38] test: ensure integration tests can fail, add vue-sfc (#768) --- package.json | 2 +- .../eslint-plugin-tslint/src/rules/config.ts | 2 +- tests/integration/docker-compose.yml | 17 +++++ .../test.js.snap | 1 + .../fixtures/vue-sfc/.eslintrc.yml | 21 +++++++ tests/integration/fixtures/vue-sfc/Dockerfile | 17 +++++ tests/integration/fixtures/vue-sfc/Hello.vue | 36 +++++++++++ .../integration/fixtures/vue-sfc/test.js.snap | 63 +++++++++++++++++++ tests/integration/fixtures/vue-sfc/test.sh | 22 +++++++ .../fixtures/vue-sfc/tsconfig.json | 5 ++ tests/integration/run-all-tests.sh | 11 ++++ 11 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 tests/integration/fixtures/vue-sfc/.eslintrc.yml create mode 100644 tests/integration/fixtures/vue-sfc/Dockerfile create mode 100644 tests/integration/fixtures/vue-sfc/Hello.vue create mode 100644 tests/integration/fixtures/vue-sfc/test.js.snap create mode 100755 tests/integration/fixtures/vue-sfc/test.sh create mode 100644 tests/integration/fixtures/vue-sfc/tsconfig.json create mode 100755 tests/integration/run-all-tests.sh diff --git a/package.json b/package.json index 4e630cb4b1bc..98a6c27fc2df 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "generate-contributors": "yarn ts-node ./tools/generate-contributors.ts && yarn all-contributors generate", "format": "prettier --write \"./**/*.{ts,js,json,md}\"", "format-check": "prettier --list-different \"./**/*.{ts,js,json,md}\"", - "integration-tests": "docker-compose -f tests/integration/docker-compose.yml up", + "integration-tests": "./tests/integration/run-all-tests.sh", "kill-integration-test-containers": "docker-compose -f tests/integration/docker-compose.yml down -v --rmi local", "lint": "eslint . --ext .js,.ts", "lint-fix": "eslint . --ext .js,.ts --fix", diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts index 7152d21f69b6..23ff428111d2 100644 --- a/packages/eslint-plugin-tslint/src/rules/config.ts +++ b/packages/eslint-plugin-tslint/src/rules/config.ts @@ -69,7 +69,7 @@ export default createRule({ }, type: 'problem', messages: { - failure: '{{message}} (tslint:{{ruleName}})`', + failure: '{{message}} (tslint:{{ruleName}})', }, schema: [ { diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml index 086f3e76485d..5d10d7661774 100644 --- a/tests/integration/docker-compose.yml +++ b/tests/integration/docker-compose.yml @@ -19,3 +19,20 @@ services: - /usr/eslint-plugin-tslint/tests # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. - ./fixtures/typescript-and-tslint-plugins-together:/usr/linked + + vue-sfc: + build: ./fixtures/vue-sfc + container_name: "vue-sfc" + volumes: + # Runtime link to the relevant built @typescript-eslint packages and integration test utils, + # but apply an empty volume for the package tests, we don't need those. + - ../../package.json/:/usr/root-package.json + - ./utils/:/usr/utils + - ../../packages/parser/:/usr/parser + - /usr/parser/tests + - ../../packages/typescript-estree/:/usr/typescript-estree + - /usr/typescript-estree/tests + - ../../packages/eslint-plugin/:/usr/eslint-plugin + - /usr/eslint-plugin/tests + # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. + - ./fixtures/vue-sfc:/usr/linked diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap index a4df7d29fe6d..078ddadc167f 100644 --- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap +++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.js.snap @@ -24,6 +24,7 @@ Array [ "endLine": 1, "line": 1, "message": "Missing semicolon (tslint:semicolon)", + "messageId": "failure", "nodeType": null, "ruleId": "@typescript-eslint/tslint/config", "severity": 2, diff --git a/tests/integration/fixtures/vue-sfc/.eslintrc.yml b/tests/integration/fixtures/vue-sfc/.eslintrc.yml new file mode 100644 index 000000000000..f20f5baf1746 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/.eslintrc.yml @@ -0,0 +1,21 @@ +root: true + +parser: 'vue-eslint-parser' + +env: + es6: true + node: true + +parserOptions: + # Local version of @typescript-eslint/parser + parser: '@typescript-eslint/parser' + project: /usr/linked/tsconfig.json + sourceType: module + extraFileExtensions: ['.vue'] + +plugins: +# Local version of @typescript-eslint/eslint-plugin +- '@typescript-eslint' + +rules: + '@typescript-eslint/no-explicit-any': 'error' diff --git a/tests/integration/fixtures/vue-sfc/Dockerfile b/tests/integration/fixtures/vue-sfc/Dockerfile new file mode 100644 index 000000000000..3b281e624c87 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/Dockerfile @@ -0,0 +1,17 @@ +FROM node:carbon + +# Copy the test.sh into the container. Every other file will be linked, rather +# than copied to allow for changes without rebuilds wherever possible +WORKDIR /usr +COPY ./test.sh /usr/ + +# Create file which will be executed by jest +# to assert that the lint output is what we expect +RUN echo "const actualLintOutput = require('./lint-output.json');\n" \ + "\n" \ + "test('it should produce the expected lint ouput', () => {\n" \ + " expect(actualLintOutput).toMatchSnapshot();\n" \ + "});\n" > test.js + +# Run the integration test +CMD [ "./test.sh" ] diff --git a/tests/integration/fixtures/vue-sfc/Hello.vue b/tests/integration/fixtures/vue-sfc/Hello.vue new file mode 100644 index 000000000000..1f5c59ed2dc0 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/Hello.vue @@ -0,0 +1,36 @@ + + + + diff --git a/tests/integration/fixtures/vue-sfc/test.js.snap b/tests/integration/fixtures/vue-sfc/test.js.snap new file mode 100644 index 000000000000..49bd30cc3897 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/test.js.snap @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`it should produce the expected lint ouput 1`] = ` +Array [ + Object { + "errorCount": 1, + "filePath": "/usr/linked/Hello.vue", + "fixableErrorCount": 0, + "fixableWarningCount": 0, + "messages": Array [ + Object { + "column": 29, + "endColumn": 32, + "endLine": 31, + "line": 31, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + }, + ], + "source": " + + + +", + "warningCount": 0, + }, +] +`; diff --git a/tests/integration/fixtures/vue-sfc/test.sh b/tests/integration/fixtures/vue-sfc/test.sh new file mode 100755 index 000000000000..ba89362dcd13 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/test.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Generate the package.json to use +node /usr/utils/generate-package-json.js + +# Install dependencies +npm install + +# Use the local volumes for our own packages +npm install $(npm pack /usr/typescript-estree | tail -1) +npm install $(npm pack /usr/parser | tail -1) +npm install $(npm pack /usr/eslint-plugin | tail -1) + +# Install the latest vue-eslint-parser (this may break us occassionally, but it's probably good to get that feedback early) +npm install vue-eslint-parser@latest + +# Run the linting +# (the "|| true" helps make sure that we run our tests on failed linting runs as well) +npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/**/*.vue || true + +# Run our assertions against the linting output +npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js diff --git a/tests/integration/fixtures/vue-sfc/tsconfig.json b/tests/integration/fixtures/vue-sfc/tsconfig.json new file mode 100644 index 000000000000..86423f3e4aa2 --- /dev/null +++ b/tests/integration/fixtures/vue-sfc/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strict": true + } +} \ No newline at end of file diff --git a/tests/integration/run-all-tests.sh b/tests/integration/run-all-tests.sh new file mode 100755 index 000000000000..5b43af062465 --- /dev/null +++ b/tests/integration/run-all-tests.sh @@ -0,0 +1,11 @@ +# Ensure child script failures are propagated +set -e + +# We run the services serially and in a non-detached state just that we can ensure predictable +# exit codes for all of our integration tests, and we can ensure CI builds pass or fail appropriately + +# typescript-and-tslint-plugins-together +docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit typescript-and-tslint-plugins-together + +# vue-sfc +docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit vue-sfc From 24dac452fe984638cab924788e73e13591cc7e1d Mon Sep 17 00:00:00 2001 From: Tarik Onalan Date: Mon, 29 Jul 2019 08:56:14 -0700 Subject: [PATCH 23/38] docs: fix typo in documentation for explicit-function-return-type (#772) Resolves #769. --- .../eslint-plugin/docs/rules/explicit-function-return-type.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 01755e395409..b1ac9af14ff4 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -142,9 +142,9 @@ let objectPropCast = { declare functionWithArg(arg: () => number); functionWithArg(() => 1); -declare functionWithObjectArg(arg: { meth: () => number }); +declare functionWithObjectArg(arg: { method: () => number }); functionWithObjectArg({ - meth() { + method() { return 1; }, }); From 22e9ae59c9f0becdfe44cdcfb01a2b631daaee51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huy=20Dang=20L=C3=AA-Ng=C3=B4?= Date: Mon, 29 Jul 2019 13:34:56 -0700 Subject: [PATCH 24/38] fix(eslint-plugin): [no-explicit-any] Fix ignoreRestArgs for interfaces (#777) --- .../docs/rules/no-explicit-any.md | 30 +++++++ .../src/rules/no-explicit-any.ts | 4 +- .../tests/rules/no-explicit-any.test.ts | 81 +++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.md b/packages/eslint-plugin/docs/rules/no-explicit-any.md index ccec9e952313..861eb0566e23 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.md +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -128,6 +128,21 @@ const baz1 = function (...args: any[]) {} const baz2 = function (...args: readonly any[]) {} const baz3 = function (...args: Array) {} const baz4 = function (...args: ReadonlyArray) {} + +interface Qux1 { (...args: any[]): void; } +interface Qux2 { (...args: readonly any[]): void; } +interface Qux3 { (...args: Array): void; } +interface Qux4 { (...args: ReadonlyArray): void; } + +function quux1(fn: (...args: any[]) => void): void {} +function quux2(fn: (...args: readonly any[]) => void): void {} +function quux3(fn: (...args: Array) => void): void {} +function quux4(fn: (...args: ReadonlyArray) => void): void {} + +function quuz1(): ((...args: any[]) => void) {} +function quuz2(): ((...args: readonly any[]) => void) {} +function quuz3(): ((...args: Array) => void) {} +function quuz4(): ((...args: ReadonlyArray) => void) {} ``` Examples of **correct** code for the `{ "ignoreRestArgs": true }` option: @@ -149,6 +164,21 @@ const baz1 = function (...args: any[]) {} const baz2 = function (...args: readonly any[]) {} const baz3 = function (...args: Array) {} const baz4 = function (...args: ReadonlyArray) {} + +interface Qux1 { (...args: any[]): void; } +interface Qux2 { (...args: readonly any[]): void; } +interface Qux3 { (...args: Array): void; } +interface Qux4 { (...args: ReadonlyArray): void; } + +function quux1(fn: (...args: any[]) => void): void {} +function quux2(fn: (...args: readonly any[]) => void): void {} +function quux3(fn: (...args: Array) => void): void {} +function quux4(fn: (...args: ReadonlyArray) => void): void {} + +function quuz1(): ((...args: any[]) => void) {} +function quuz2(): ((...args: readonly any[]) => void) {} +function quuz3(): ((...args: Array) => void) {} +function quuz4(): ((...args: ReadonlyArray) => void) {} ``` ## When Not To Use It diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index a84327a0d553..43f81b8607e5 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -51,7 +51,7 @@ export default util.createRule({ /** * Checks if the node is an arrow function, function declaration or function expression * @param node the node to be validated. - * @returns true if the node is an arrow function, function declaration or function expression + * @returns true if the node is an arrow function, function declaration, function expression, function type, or call signature * @private */ function isNodeValidFunction(node: TSESTree.Node): boolean { @@ -59,6 +59,8 @@ export default util.createRule({ AST_NODE_TYPES.ArrowFunctionExpression, AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression, + AST_NODE_TYPES.TSFunctionType, + AST_NODE_TYPES.TSCallSignatureDeclaration, ].includes(node.type); } diff --git a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts index b27cc8111bc0..c5624ba06351 100644 --- a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts +++ b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts @@ -189,6 +189,54 @@ type obj = { code: `const baz4 = (...args: ReadonlyArray) => {}`, options: [{ ignoreRestArgs: true }], }, + { + code: `interface Qux1 { (...args: any[]): void; }`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `interface Qux2 { (...args: readonly any[]): void; }`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `interface Qux3 { (...args: Array): void; }`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `interface Qux4 { (...args: ReadonlyArray): void; }`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quux1(fn: (...args: any[]) => void): void {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quux2(fn: (...args: readonly any[]) => void): void {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quux3(fn: (...args: Array) => void): void {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quux4(fn: (...args: ReadonlyArray) => void): void {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quuz1(): ((...args: any[]) => void) {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quuz2(): ((...args: readonly any[]) => void) {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quuz3(): ((...args: Array) => void) {}`, + options: [{ ignoreRestArgs: true }], + }, + { + code: `function quuz4(): ((...args: ReadonlyArray) => void) {}`, + options: [{ ignoreRestArgs: true }], + }, ], invalid: ([ { @@ -787,6 +835,39 @@ type obj = { }, ], }, + { + code: `interface Qux5 { (...args: any): void; }`, + options: [{ ignoreRestArgs: true }], + errors: [ + { + messageId: 'unexpectedAny', + line: 1, + column: 28, + }, + ], + }, + { + code: `function quux5(fn: (...args: any) => void): void {}`, + options: [{ ignoreRestArgs: true }], + errors: [ + { + messageId: 'unexpectedAny', + line: 1, + column: 30, + }, + ], + }, + { + code: `function quuz5(): ((...args: any) => void) {}`, + options: [{ ignoreRestArgs: true }], + errors: [ + { + messageId: 'unexpectedAny', + line: 1, + column: 30, + }, + ], + }, ] as InvalidTestCase[]).reduce((acc, testCase) => { acc.push(testCase); const options = testCase.options || []; From b731df98cb7a70c2f034ad06f94da63ea9ed06f9 Mon Sep 17 00:00:00 2001 From: Glen Winters Date: Mon, 29 Jul 2019 15:54:49 -0500 Subject: [PATCH 25/38] docs(eslint-plugin): Improve ban-types description (#773) --- packages/eslint-plugin/README.md | 2 +- packages/eslint-plugin/docs/rules/ban-types.md | 5 +++-- packages/eslint-plugin/src/rules/ban-types.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 05916fa1cbdf..a6db1f9ec469 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -127,7 +127,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | | | :thought_balloon: | | [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans “// @ts-ignore” comments from being used | | | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Enforces that types will not to be used | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/camelcase`](./docs/rules/camelcase.md) | Enforce camelCase naming convention | :heavy_check_mark: | | | | [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names | :heavy_check_mark: | | | | [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions. | :heavy_check_mark: | | | diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index dc88b913f2ca..4da27a930418 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -1,6 +1,7 @@ -# Enforces that types will not to be used (ban-types) +# Bans specific types from being used (ban-types) -Bans specific types from being used. Does not ban the corresponding runtime objects from being used. +This rule bans specific types and can suggest alternatives. It does not ban the +corresponding runtime objects from being used. ## Rule Details diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index 1a38bf66f287..bd3d8bf1b93e 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -46,7 +46,7 @@ export default util.createRule({ meta: { type: 'suggestion', docs: { - description: 'Enforces that types will not to be used', + description: 'Bans specific types from being used', category: 'Best Practices', recommended: 'error', }, From 73f8c791e82aee0d5d8f5f8a7a6287126e597769 Mon Sep 17 00:00:00 2001 From: cherryblossom000 <31467609+cherryblossom000@users.noreply.github.com> Date: Wed, 31 Jul 2019 01:29:41 +1000 Subject: [PATCH 26/38] docs(prefer-readonly): add rule name to title (#779) The "(prefer-readonly)" part wasn't in the title. --- packages/eslint-plugin/docs/rules/prefer-readonly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index b3f0a5420109..f75a3c349cbe 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -1,4 +1,4 @@ -# require never-modified private members be marked as `readonly` +# require never-modified private members be marked as `readonly` (prefer-readonly) This rule enforces that private members are marked as `readonly` if they're never modified outside of the constructor. From 84916e6713d05ffccc208149b623c86004098435 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Thu, 1 Aug 2019 17:39:47 -0700 Subject: [PATCH 27/38] fix(eslint-plugin): [typedef] support default value for parameter (#785) --- packages/eslint-plugin/src/rules/typedef.ts | 19 ++++++-- .../eslint-plugin/tests/rules/typedef.test.ts | 46 ++++++++++++++++++- 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 5e0465e0e231..e47ccad9522a 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -69,10 +69,21 @@ export default util.createRule<[Options], MessageIds>({ function checkParameters(params: TSESTree.Parameter[]) { for (const param of params) { - if ( - param.type !== AST_NODE_TYPES.TSParameterProperty && - !param.typeAnnotation - ) { + let annotationNode: TSESTree.Node | undefined; + + switch (param.type) { + case AST_NODE_TYPES.AssignmentPattern: + annotationNode = param.left; + break; + case AST_NODE_TYPES.TSParameterProperty: + annotationNode = param.parameter; + break; + default: + annotationNode = param; + break; + } + + if (annotationNode !== undefined && !annotationNode.typeAnnotation) { report(param, getNodeName(param)); } } diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts index 8c281fe5e395..49d98e2654f5 100644 --- a/packages/eslint-plugin/tests/rules/typedef.test.ts +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -101,13 +101,21 @@ ruleTester.run('typedef', rule, { }, ], }, - // Parameters + // Function parameters `function receivesNumber(a: number): void { }`, `function receivesStrings(a: string, b: string): void { }`, `function receivesNumber([a]: [number]): void { }`, `function receivesNumbers([a, b]: number[]): void { }`, `function receivesString({ a }: { a: string }): void { }`, `function receivesStrings({ a, b }: { [i: string ]: string }): void { }`, + `function receivesNumber(a: number = 123): void { }`, + // Method parameters + `class Test { + public method(x: number): number { return x; } + }`, + `class Test { + public method(x: number = 123): number { return x; } + }`, // Property declarations `type Test = { member: number; @@ -291,7 +299,7 @@ ruleTester.run('typedef', rule, { }, ], }, - // Parameters + // Function parameters { code: `function receivesNumber(a): void { }`, errors: [ @@ -350,6 +358,40 @@ ruleTester.run('typedef', rule, { }, ], }, + // Method parameters + { + code: `class Test { + public method(x): number { return x; } + }`, + errors: [ + { + column: 23, + messageId: 'expectedTypedefNamed', + }, + ], + }, + { + code: `class Test { + public method(x = 123): number { return x; } + }`, + errors: [ + { + column: 23, + messageId: 'expectedTypedef', + }, + ], + }, + { + code: `class Test { + public constructor(public x) { } + }`, + errors: [ + { + column: 28, + messageId: 'expectedTypedef', + }, + ], + }, // Property declarations { code: `type Test = { From 39e41b56ca26047cc1a1fdf7330e0bee928dc720 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Thu, 1 Aug 2019 17:57:04 -0700 Subject: [PATCH 28/38] fix(eslint-plugin): [typedef] support "for..in", "for..of" (#787) --- packages/eslint-plugin/src/rules/typedef.ts | 27 ++++++++++++++++++- .../eslint-plugin/tests/rules/typedef.test.ts | 25 +++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index e47ccad9522a..3c535467f2ce 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -142,7 +142,32 @@ export default util.createRule<[Options], MessageIds>({ options[OptionKeys.VariableDeclaration] && !node.id.typeAnnotation ) { - report(node, getNodeName(node.id)); + // Are we inside a context that does not allow type annotations? + let typeAnnotationRequired = true; + + let current: TSESTree.Node | undefined = node.parent; + while (current) { + switch (current.type) { + case AST_NODE_TYPES.VariableDeclaration: + // Keep looking upwards + current = current.parent; + break; + case AST_NODE_TYPES.ForOfStatement: + case AST_NODE_TYPES.ForInStatement: + // Stop traversing and don't report an error + typeAnnotationRequired = false; + current = undefined; + break; + default: + // Stop traversing + current = undefined; + break; + } + } + + if (typeAnnotationRequired) { + report(node, getNodeName(node.id)); + } } }, }; diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts index 49d98e2654f5..b1a7b08bcf09 100644 --- a/packages/eslint-plugin/tests/rules/typedef.test.ts +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -198,6 +198,31 @@ ruleTester.run('typedef', rule, { }, ], }, + // Contexts where TypeScript doesn't allow annotations + { + code: `for (x of [1, 2, 3]) { }`, + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `for (const x in {}) { }`, + options: [ + { + variableDeclaration: true, + }, + ], + }, + { + code: `try { } catch (e) { }`, + options: [ + { + variableDeclaration: true, + }, + ], + }, ], invalid: [ // Array destructuring From 3c902a1d98e75af4b9b59398dfb5c24b6d74ca96 Mon Sep 17 00:00:00 2001 From: Niles Date: Thu, 8 Aug 2019 10:40:04 -0500 Subject: [PATCH 29/38] fix(eslint-plugin): add `Literal` to `RuleListener` types (#824) --- packages/experimental-utils/src/ts-eslint/Rule.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index 0175309d752f..89ac7b532885 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -270,6 +270,7 @@ interface RuleListener { JSXSpreadChild?: RuleFunction; JSXText?: RuleFunction; LabeledStatement?: RuleFunction; + Literal?: RuleFunction; LogicalExpression?: RuleFunction; MemberExpression?: RuleFunction; MetaProperty?: RuleFunction; From 42b3013ab846669fd730628f5cb0b043cfedabba Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 9 Aug 2019 17:19:19 +0100 Subject: [PATCH 30/38] chore: misc package.json updates related to v2 (#832) --- package.json | 2 +- packages/eslint-plugin-tslint/package.json | 2 +- packages/eslint-plugin/package.json | 4 ++-- packages/experimental-utils/package.json | 2 +- packages/parser/package.json | 2 +- packages/typescript-estree/package.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 98a6c27fc2df..d0c730ff1b4f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ ] }, "engines": { - "node": ">=6.14.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "devDependencies": { "@commitlint/cli": "^8.1.0", diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index bed7e2fd46f4..bf40809b2db4 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -11,7 +11,7 @@ "tslint" ], "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "repository": { "type": "git", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 991831222811..516ee6b4f98f 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -9,7 +9,7 @@ "typescript" ], "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "files": [ "dist", @@ -54,7 +54,7 @@ "typescript": "*" }, "peerDependencies": { - "@typescript-eslint/parser": "^1.9.0", + "@typescript-eslint/parser": "^2.0.0-alpha.0", "eslint": "^5.0.0 || ^6.0.0" } } diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 5cbedf3e6cb3..4574f3129d10 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -8,7 +8,7 @@ "estree" ], "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "files": [ "dist", diff --git a/packages/parser/package.json b/packages/parser/package.json index c11e9cb790aa..bc3f3cf29b07 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -9,7 +9,7 @@ "LICENSE" ], "engines": { - "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "repository": { "type": "git", diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index fabdc79810cc..e0a0e6618820 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -10,7 +10,7 @@ "LICENSE" ], "engines": { - "node": ">=6.14.0" + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" }, "repository": { "type": "git", From ebbcc010c546b5777c14f0b33ead851b620184e0 Mon Sep 17 00:00:00 2001 From: Torleif Berger Date: Sat, 10 Aug 2019 02:32:16 +0200 Subject: [PATCH 31/38] fix(eslint-plugin): [efrt] flag default export w/allowExpressions (#831) BREAKING: the rule didn't previously flag default exports with this option --- .../rules/explicit-function-return-type.md | 20 +++++------ .../rules/explicit-function-return-type.ts | 3 +- .../explicit-function-return-type.test.ts | 33 +++++++++++++++++++ 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index b1ac9af14ff4..f31d6f42b8ba 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -84,6 +84,10 @@ Examples of **incorrect** code for this rule with `{ allowExpressions: true }`: ```ts function test() {} + +const fn = () => {}; + +export default () => {}; ``` Examples of **correct** code for this rule with `{ allowExpressions: true }`: @@ -155,24 +159,20 @@ functionWithObjectArg({ Examples of **incorrect** code for this rule with `{ allowHigherOrderFunctions: true }`: ```ts -var arrowFn = (x: number) => (y: number) => x + y; +var arrowFn = () => () => {}; -function fn(x: number) { - return function(y: number) { - return x + y; - }; +function fn() { + return function() {}; } ``` Examples of **correct** code for this rule with `{ allowHigherOrderFunctions: true }`: ```ts -var arrowFn = (x: number) => (y: number): number => x + y; +var arrowFn = () => (): void => {}; -function fn(x: number) { - return function(y: number): number { - return x + y; - }; +function fn() { + return function(): void {}; } ``` diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index b431fe7675ce..44ea2d03c8e2 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -256,7 +256,8 @@ export default util.createRule({ if ( options.allowExpressions && node.parent.type !== AST_NODE_TYPES.VariableDeclarator && - node.parent.type !== AST_NODE_TYPES.MethodDefinition + node.parent.type !== AST_NODE_TYPES.MethodDefinition && + node.parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration ) { return; } diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index 72d64d2abe06..32f23792591e 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -90,6 +90,15 @@ class Test { }, ], }, + { + filename: 'test.ts', + code: `export default (): void => {}`, + options: [ + { + allowExpressions: true, + }, + ], + }, { filename: 'test.ts', code: ` @@ -417,6 +426,30 @@ function test() { }, ], }, + { + filename: 'test.ts', + code: 'export default () => {};', + options: [{ allowExpressions: true }], + errors: [ + { + messageId: 'missingReturnType', + line: 1, + column: 16, + }, + ], + }, + { + filename: 'test.ts', + code: 'export default function() {};', + options: [{ allowExpressions: true }], + errors: [ + { + messageId: 'missingReturnType', + line: 1, + column: 16, + }, + ], + }, { filename: 'test.ts', code: "var arrowFn = () => 'test';", From de6cc1d51a7b908ab2a731c5ce3c1d537062645f Mon Sep 17 00:00:00 2001 From: Ken <2770219+ken0x0a@users.noreply.github.com> Date: Tue, 13 Aug 2019 00:59:14 +0900 Subject: [PATCH 32/38] docs(eslint-plugin): [no-useless-constructor] add example setup (#837) --- .../eslint-plugin/docs/rules/no-useless-constructor.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index 821f6a5d1052..0aa1f4a5c984 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -71,6 +71,16 @@ class A extends B { } ``` +## Rule Changes + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "no-useless-constructor": "off", + "@typescript-eslint/no-useless-constructor": "error", +} +``` + ## When Not To Use It If you don't want to be notified about unnecessary constructors, you can safely disable this rule. From 428567d7cc0985b1da754f092289212df3fe1bda Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 13 Aug 2019 02:50:38 -0700 Subject: [PATCH 33/38] feat(eslint-plugin)!: change recommended config (#729) BREAKING CHANGE: recommended config changes are considered breaking --- .eslintrc.js | 25 +++-------- .prettierrc => .prettierrc.json | 0 .../eslint-plugin-tslint/src/custom-linter.ts | 4 +- packages/eslint-plugin/README.md | 38 ++++++++-------- .../docs/rules/no-inferrable-types.md | 4 +- packages/eslint-plugin/package.json | 2 + packages/eslint-plugin/src/configs/all.json | 2 + packages/eslint-plugin/src/configs/base.json | 8 +--- .../src/configs/recommended.json | 32 +++++++++----- .../eslint-plugin/src/rules/array-type.ts | 7 +-- .../eslint-plugin/src/rules/await-thenable.ts | 4 +- .../eslint-plugin/src/rules/ban-ts-ignore.ts | 2 +- packages/eslint-plugin/src/rules/ban-types.ts | 5 ++- packages/eslint-plugin/src/rules/camelcase.ts | 2 +- .../src/rules/class-name-casing.ts | 4 +- .../src/rules/consistent-type-assertions.ts | 10 ++--- .../src/rules/consistent-type-definitions.ts | 5 ++- .../rules/explicit-function-return-type.ts | 4 +- .../rules/explicit-member-accessibility.ts | 9 ++-- .../src/rules/generic-type-naming.ts | 3 +- .../indent-new-do-not-use/OffsetStorage.ts | 12 +++-- .../src/rules/indent-new-do-not-use/index.ts | 15 +++---- packages/eslint-plugin/src/rules/indent.ts | 3 +- .../src/rules/interface-name-prefix.ts | 5 ++- .../src/rules/member-ordering.ts | 8 ++-- .../src/rules/no-empty-function.ts | 8 ++-- .../src/rules/no-empty-interface.ts | 2 +- .../src/rules/no-explicit-any.ts | 5 ++- .../src/rules/no-extra-parens.ts | 8 ++-- .../src/rules/no-extraneous-class.ts | 2 +- .../src/rules/no-floating-promises.ts | 2 +- .../src/rules/no-for-in-array.ts | 4 +- .../src/rules/no-inferrable-types.ts | 16 ++++--- .../src/rules/no-magic-numbers.ts | 2 +- .../eslint-plugin/src/rules/no-misused-new.ts | 8 ++-- .../src/rules/no-misused-promises.ts | 19 +++++--- .../eslint-plugin/src/rules/no-namespace.ts | 2 +- .../src/rules/no-non-null-assertion.ts | 4 +- .../src/rules/no-parameter-properties.ts | 5 ++- .../src/rules/no-require-imports.ts | 6 ++- .../eslint-plugin/src/rules/no-this-alias.ts | 6 +-- .../eslint-plugin/src/rules/no-type-alias.ts | 5 ++- .../src/rules/no-unnecessary-qualifier.ts | 2 +- .../rules/no-unnecessary-type-arguments.ts | 4 +- .../rules/no-unnecessary-type-assertion.ts | 4 +- .../src/rules/no-use-before-define.ts | 2 +- .../src/rules/no-useless-constructor.ts | 2 +- .../src/rules/no-var-requires.ts | 2 +- .../eslint-plugin/src/rules/prefer-for-of.ts | 2 +- .../src/rules/prefer-function-type.ts | 11 +++-- .../src/rules/prefer-includes.ts | 2 +- .../src/rules/prefer-namespace-keyword.ts | 2 +- .../src/rules/prefer-readonly.ts | 38 ++++++++-------- .../src/rules/prefer-regexp-exec.ts | 4 +- .../rules/prefer-string-starts-ends-with.ts | 2 +- .../src/rules/promise-function-async.ts | 12 +++-- .../src/rules/require-array-sort-compare.ts | 2 +- .../eslint-plugin/src/rules/require-await.ts | 8 ++-- .../src/rules/restrict-plus-operands.ts | 2 +- packages/eslint-plugin/src/rules/semi.ts | 3 +- .../src/rules/triple-slash-reference.ts | 10 ++--- .../src/rules/type-annotation-spacing.ts | 4 +- packages/eslint-plugin/src/rules/typedef.ts | 22 +++++----- .../eslint-plugin/src/rules/unbound-method.ts | 6 +-- .../src/rules/unified-signatures.ts | 21 ++++----- packages/eslint-plugin/src/util/misc.ts | 4 +- packages/eslint-plugin/src/util/types.ts | 7 ++- packages/eslint-plugin/tests/RuleTester.ts | 2 +- .../eslint-plugin/tests/rules/indent/utils.ts | 3 +- .../tests/rules/no-this-alias.test.ts | 10 +++++ .../tests/rules/no-unused-vars.test.ts | 8 ++-- .../eslint-plugin/tools/generate-configs.ts | 44 ++++++++++++++----- .../tools/validate-configs/checkConfigAll.ts | 4 +- .../checkConfigRecommended.ts | 4 +- .../validate-docs/validate-table-structure.ts | 3 +- .../src/eslint-utils/RuleCreator.ts | 2 +- .../src/eslint-utils/deepMerge.ts | 5 ++- packages/parser/src/analyze-scope.ts | 18 ++++---- packages/parser/src/parser.ts | 7 ++- packages/parser/src/scope/scope-manager.ts | 6 ++- packages/parser/src/simple-traverse.ts | 4 +- packages/parser/tests/lib/basics.ts | 2 +- packages/parser/tests/lib/jsx.ts | 2 +- packages/parser/tests/tools/scope-analysis.ts | 21 +++++---- packages/parser/tests/tools/test-utils.ts | 17 +++---- .../typescript-estree/src/ast-converter.ts | 5 ++- packages/typescript-estree/src/convert.ts | 17 ++++--- packages/typescript-estree/src/node-utils.ts | 11 ++++- packages/typescript-estree/src/parser.ts | 22 +++++++--- .../typescript-estree/src/tsconfig-parser.ts | 25 +++++++---- .../tests/ast-alignment/fixtures-to-test.ts | 4 +- .../tests/ast-alignment/parse.ts | 19 +++++--- .../tests/ast-alignment/utils.ts | 10 ++--- .../typescript-estree/tests/lib/convert.ts | 8 ++-- packages/typescript-estree/tests/lib/jsx.ts | 7 +-- .../tests/lib/semanticInfo.ts | 4 +- .../typescript-estree/tools/test-utils.ts | 10 ++--- .../utils/jest-snapshot-resolver.js | 1 + tools/generate-contributors.ts | 4 +- yarn.lock | 7 ++- 100 files changed, 470 insertions(+), 341 deletions(-) rename .prettierrc => .prettierrc.json (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 45426c37acf6..32a476969d3a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,23 +21,12 @@ module.exports = { // our plugin :D // - '@typescript-eslint/ban-ts-ignore': 'error', - '@typescript-eslint/consistent-type-definitions': 'error', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-member-accessibility': 'off', - '@typescript-eslint/indent': 'off', - '@typescript-eslint/no-explicit-any': 'warn', - '@typescript-eslint/no-inferrable-types': 'error', - '@typescript-eslint/no-misused-promises': 'error', + '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], + '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-object-literal-type-assertion': 'off', - '@typescript-eslint/no-parameter-properties': 'off', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/prefer-includes': 'error', - '@typescript-eslint/prefer-regexp-exec': 'error', - '@typescript-eslint/prefer-string-starts-ends-with': 'error', + '@typescript-eslint/unbound-method': 'off', // // eslint base @@ -110,12 +99,12 @@ module.exports = { 'import/no-mutable-exports': 'error', // Prevent importing the default as if it were named 'import/no-named-default': 'error', - // Prohibit named exports // we want everything to be a named export - 'import/no-named-export': 'off', + // Prohibit named exports + 'import/no-named-export': 'off', // we want everything to be a named export // Forbid a module from importing itself 'import/no-self-import': 'error', - // Require modules with a single export to use a default export // we want everything to be named - 'import/prefer-default-export': 'off', + // Require modules with a single export to use a default export + 'import/prefer-default-export': 'off', // we want everything to be named }, parserOptions: { sourceType: 'module', diff --git a/.prettierrc b/.prettierrc.json similarity index 100% rename from .prettierrc rename to .prettierrc.json diff --git a/packages/eslint-plugin-tslint/src/custom-linter.ts b/packages/eslint-plugin-tslint/src/custom-linter.ts index 5de914e5f8f9..eb8527b99d71 100644 --- a/packages/eslint-plugin-tslint/src/custom-linter.ts +++ b/packages/eslint-plugin-tslint/src/custom-linter.ts @@ -1,5 +1,5 @@ import { ILinterOptions, Linter, LintResult } from 'tslint'; -import { Program } from 'typescript'; +import { Program, SourceFile } from 'typescript'; // We need to access the program, but Linter has private program already // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -14,7 +14,7 @@ export class CustomLinter extends TSLintLinter { return super.getResult(); } - getSourceFile(fileName: string) { + getSourceFile(fileName: string): SourceFile | undefined { return this.program.getSourceFile(fileName); } } diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index a6db1f9ec469..516f9c48daef 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -124,65 +124,65 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | | [`@typescript-eslint/adjacent-overload-signatures`](./docs/rules/adjacent-overload-signatures.md) | Require that member overloads be consecutive | :heavy_check_mark: | | | -| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | | | :thought_balloon: | -| [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans “// @ts-ignore” comments from being used | | | | -| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/array-type`](./docs/rules/array-type.md) | Requires using either `T[]` or `Array` for arrays | | :wrench: | | +| [`@typescript-eslint/await-thenable`](./docs/rules/await-thenable.md) | Disallows awaiting a value that is not a Thenable | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/ban-ts-ignore`](./docs/rules/ban-ts-ignore.md) | Bans “// @ts-ignore” comments from being used | :heavy_check_mark: | | | +| [`@typescript-eslint/ban-types`](./docs/rules/ban-types.md) | Bans specific types from being used | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/camelcase`](./docs/rules/camelcase.md) | Enforce camelCase naming convention | :heavy_check_mark: | | | | [`@typescript-eslint/class-name-casing`](./docs/rules/class-name-casing.md) | Require PascalCased class and interface names | :heavy_check_mark: | | | | [`@typescript-eslint/consistent-type-assertions`](./docs/rules/consistent-type-assertions.md) | Enforces consistent usage of type assertions. | :heavy_check_mark: | | | | [`@typescript-eslint/consistent-type-definitions`](./docs/rules/consistent-type-definitions.md) | Consistent with type definition either `interface` or `type` | | :wrench: | | | [`@typescript-eslint/explicit-function-return-type`](./docs/rules/explicit-function-return-type.md) | Require explicit return types on functions and class methods | :heavy_check_mark: | | | -| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | :heavy_check_mark: | | | +| [`@typescript-eslint/explicit-member-accessibility`](./docs/rules/explicit-member-accessibility.md) | Require explicit accessibility modifiers on class properties and methods | | | | | [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | | [`@typescript-eslint/generic-type-naming`](./docs/rules/generic-type-naming.md) | Enforces naming of generic type variables | | | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/interface-name-prefix`](./docs/rules/interface-name-prefix.md) | Require that interface names be prefixed with `I` | :heavy_check_mark: | | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/interface-name-prefix`](./docs/rules/interface-name-prefix.md) | Require that interface names should or should not prefixed with `I` | :heavy_check_mark: | | | | [`@typescript-eslint/member-delimiter-style`](./docs/rules/member-delimiter-style.md) | Require a specific member delimiter style for interfaces and type literals | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/member-naming`](./docs/rules/member-naming.md) | Enforces naming conventions for class members by visibility | | | | | [`@typescript-eslint/member-ordering`](./docs/rules/member-ordering.md) | Require a consistent member declaration order | | | | | [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | | [`@typescript-eslint/no-empty-interface`](./docs/rules/no-empty-interface.md) | Disallow the declaration of empty interfaces | :heavy_check_mark: | | | | [`@typescript-eslint/no-explicit-any`](./docs/rules/no-explicit-any.md) | Disallow usage of the `any` type | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | | [`@typescript-eslint/no-extraneous-class`](./docs/rules/no-extraneous-class.md) | Forbids the use of classes as namespaces | | | | | [`@typescript-eslint/no-floating-promises`](./docs/rules/no-floating-promises.md) | Requires Promise-like values to be handled appropriately. | | | :thought_balloon: | -| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | | | :thought_balloon: | +| [`@typescript-eslint/no-for-in-array`](./docs/rules/no-for-in-array.md) | Disallow iterating over an array with a for-in loop | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-inferrable-types`](./docs/rules/no-inferrable-types.md) | Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallows magic numbers | | | | | [`@typescript-eslint/no-misused-new`](./docs/rules/no-misused-new.md) | Enforce valid definition of `new` and `constructor` | :heavy_check_mark: | | | -| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using promises in places not designed to handle them | | | :thought_balloon: | +| [`@typescript-eslint/no-misused-promises`](./docs/rules/no-misused-promises.md) | Avoid using promises in places not designed to handle them | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/no-namespace`](./docs/rules/no-namespace.md) | Disallow the use of custom TypeScript modules and namespaces | :heavy_check_mark: | | | | [`@typescript-eslint/no-non-null-assertion`](./docs/rules/no-non-null-assertion.md) | Disallows non-null assertions using the `!` postfix operator | :heavy_check_mark: | | | -| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | :heavy_check_mark: | | | +| [`@typescript-eslint/no-parameter-properties`](./docs/rules/no-parameter-properties.md) | Disallow the use of parameter properties in class constructors | | | | | [`@typescript-eslint/no-require-imports`](./docs/rules/no-require-imports.md) | Disallows invocation of `require()` | | | | -| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | | | | +| [`@typescript-eslint/no-this-alias`](./docs/rules/no-this-alias.md) | Disallow aliasing `this` | :heavy_check_mark: | | | | [`@typescript-eslint/no-type-alias`](./docs/rules/no-type-alias.md) | Disallow the use of type aliases | | | | | [`@typescript-eslint/no-unnecessary-qualifier`](./docs/rules/no-unnecessary-qualifier.md) | Warns when a namespace qualifier is unnecessary | | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unnecessary-type-arguments`](./docs/rules/no-unnecessary-type-arguments.md) | Warns if an explicitly specified type argument is the default for that type parameter | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-unnecessary-type-assertion`](./docs/rules/no-unnecessary-type-assertion.md) | Warns if a type assertion does not change the type of an expression | :heavy_check_mark: | :wrench: | :thought_balloon: | | [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | | [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | :heavy_check_mark: | | | | [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | | [`@typescript-eslint/no-var-requires`](./docs/rules/no-var-requires.md) | Disallows the use of require statements except in import statements | :heavy_check_mark: | | | | [`@typescript-eslint/prefer-for-of`](./docs/rules/prefer-for-of.md) | Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated | | | | | [`@typescript-eslint/prefer-function-type`](./docs/rules/prefer-function-type.md) | Use function types instead of interfaces with call signatures | | :wrench: | | -| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-includes`](./docs/rules/prefer-includes.md) | Enforce `includes` method over `indexOf` method | :heavy_check_mark: | :wrench: | :thought_balloon: | | [`@typescript-eslint/prefer-namespace-keyword`](./docs/rules/prefer-namespace-keyword.md) | Require the use of the `namespace` keyword instead of the `module` keyword to declare custom TypeScript modules | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/prefer-readonly`](./docs/rules/prefer-readonly.md) | Requires that private members are marked as `readonly` if they're never modified outside of the constructor | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Prefer RegExp#exec() over String#match() if no global flag is provided | | | :thought_balloon: | -| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/prefer-regexp-exec`](./docs/rules/prefer-regexp-exec.md) | Prefer RegExp#exec() over String#match() if no global flag is provided | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/prefer-string-starts-ends-with`](./docs/rules/prefer-string-starts-ends-with.md) | Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings | :heavy_check_mark: | :wrench: | :thought_balloon: | | [`@typescript-eslint/promise-function-async`](./docs/rules/promise-function-async.md) | Requires any function or method that returns a Promise to be marked async | | | :thought_balloon: | | [`@typescript-eslint/require-array-sort-compare`](./docs/rules/require-array-sort-compare.md) | Enforce giving `compare` argument to `Array#sort` | | | :thought_balloon: | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | | | :thought_balloon: | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | | [`@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 | | | :thought_balloon: | | [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | | [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | | :thought_balloon: | -| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | | | | +| [`@typescript-eslint/triple-slash-reference`](./docs/rules/triple-slash-reference.md) | Sets preference level for triple slash directives versus ES6-style import declarations | :heavy_check_mark: | | | | [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | :heavy_check_mark: | :wrench: | | | [`@typescript-eslint/typedef`](./docs/rules/typedef.md) | Requires type annotations to exist | | | | -| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | | | :thought_balloon: | +| [`@typescript-eslint/unbound-method`](./docs/rules/unbound-method.md) | Enforces unbound methods are called with their expected scope | :heavy_check_mark: | | :thought_balloon: | | [`@typescript-eslint/unified-signatures`](./docs/rules/unified-signatures.md) | Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter | | | | diff --git a/packages/eslint-plugin/docs/rules/no-inferrable-types.md b/packages/eslint-plugin/docs/rules/no-inferrable-types.md index 9dbabe276c3d..7dd159b02e5a 100644 --- a/packages/eslint-plugin/docs/rules/no-inferrable-types.md +++ b/packages/eslint-plugin/docs/rules/no-inferrable-types.md @@ -24,8 +24,8 @@ The default options are: ```JSON { - "ignoreParameters": true, - "ignoreProperties": true, + "ignoreParameters": false, + "ignoreProperties": false, } ``` diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 516ee6b4f98f..14b417ac5c73 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -49,8 +49,10 @@ "devDependencies": { "@types/json-schema": "^7.0.3", "@types/marked": "^0.6.5", + "@types/prettier": "^1.18.0", "chalk": "^2.4.2", "marked": "^0.7.0", + "prettier": "*", "typescript": "*" }, "peerDependencies": { diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 0c17ccb04266..30a7cafafb56 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -24,6 +24,7 @@ "@typescript-eslint/member-ordering": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", + "no-empty-function": "off", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "error", @@ -62,6 +63,7 @@ "@typescript-eslint/prefer-string-starts-ends-with": "error", "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/require-array-sort-compare": "error", + "require-await": "off", "@typescript-eslint/require-await": "error", "@typescript-eslint/restrict-plus-operands": "error", "semi": "off", diff --git a/packages/eslint-plugin/src/configs/base.json b/packages/eslint-plugin/src/configs/base.json index 6f56100a6ae7..9580ed622cfc 100644 --- a/packages/eslint-plugin/src/configs/base.json +++ b/packages/eslint-plugin/src/configs/base.json @@ -1,9 +1,5 @@ { "parser": "@typescript-eslint/parser", - "parserOptions": { - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ] + "parserOptions": { "sourceType": "module" }, + "plugins": ["@typescript-eslint"] } diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 121b85bf17a6..95d18847686e 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -1,38 +1,48 @@ { "extends": "./configs/base.json", "rules": { - "no-var": "error", - "prefer-const": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-ignore": "error", "@typescript-eslint/ban-types": "error", "camelcase": "off", "@typescript-eslint/camelcase": "error", "@typescript-eslint/class-name-casing": "error", "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/explicit-member-accessibility": "error", - "indent": "off", - "@typescript-eslint/indent": "error", "@typescript-eslint/interface-name-prefix": "error", "@typescript-eslint/member-delimiter-style": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", + "no-empty-function": "off", + "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-for-in-array": "error", "@typescript-eslint/no-inferrable-types": "error", "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-misused-promises": "error", "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": "error", - "@typescript-eslint/no-parameter-properties": "error", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-this-alias": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "warn", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-includes": "error", "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/type-annotation-spacing": "error" + "@typescript-eslint/prefer-regexp-exec": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "require-await": "off", + "@typescript-eslint/require-await": "error", + "@typescript-eslint/triple-slash-reference": "error", + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unbound-method": "error", + "no-var": "error", + "prefer-const": "error", + "prefer-rest-params": "error", + "prefer-spread": "error" } } diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 8fe28bc32177..b9977618c40c 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -94,7 +94,8 @@ export default util.createRule({ docs: { description: 'Requires using either `T[]` or `Array` for arrays', category: 'Stylistic Issues', - recommended: 'error', + // too opinionated to be recommended + recommended: false, }, fixable: 'code', messages: { @@ -168,7 +169,7 @@ export default util.createRule({ } return { - TSArrayType(node: TSESTree.TSArrayType) { + TSArrayType(node): void { if ( isArrayOption || (isArraySimpleOption && isSimpleType(node.elementType)) @@ -241,7 +242,7 @@ export default util.createRule({ }); }, - TSTypeReference(node: TSESTree.TSTypeReference) { + TSTypeReference(node): void { if ( isGenericOption || node.typeName.type !== AST_NODE_TYPES.Identifier diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 7a5db98db9c4..304321001f7b 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -9,7 +9,7 @@ export default util.createRule({ docs: { description: 'Disallows awaiting a value that is not a Thenable', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.', @@ -24,7 +24,7 @@ export default util.createRule({ const checker = parserServices.program.getTypeChecker(); return { - AwaitExpression(node) { + AwaitExpression(node): void { const originalNode = parserServices.esTreeNodeToTSNodeMap.get< ts.AwaitExpression >(node); diff --git a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts index 87af895627d2..7d7a32e6cfc9 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-ignore.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-ignore.ts @@ -7,7 +7,7 @@ export default util.createRule({ docs: { description: 'Bans “// @ts-ignore” comments from being used', category: 'Best Practices', - recommended: false, + recommended: 'error', }, schema: [], messages: { diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index bd3d8bf1b93e..a8c2cec6c06e 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -25,7 +25,7 @@ function stringifyTypeName( function getCustomMessage( bannedType: null | string | { message?: string; fixWith?: string }, -) { +): string { if (bannedType === null) { return ''; } @@ -108,7 +108,7 @@ export default util.createRule({ ], create(context, [{ types: bannedTypes }]) { return { - TSTypeReference({ typeName }) { + TSTypeReference({ typeName }): void { const name = stringifyTypeName(typeName, context.getSourceCode()); if (name in bannedTypes) { @@ -124,6 +124,7 @@ export default util.createRule({ name: name, customMessage, }, + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type fix: fixWith ? fixer => fixer.replaceText(typeName, fixWith) : null, }); } diff --git a/packages/eslint-plugin/src/rules/camelcase.ts b/packages/eslint-plugin/src/rules/camelcase.ts index ffa5a62ed894..4bb614cba9d7 100644 --- a/packages/eslint-plugin/src/rules/camelcase.ts +++ b/packages/eslint-plugin/src/rules/camelcase.ts @@ -90,7 +90,7 @@ export default util.createRule({ } return { - Identifier(node) { + Identifier(node): void { /* * Leading and trailing underscores are commonly used to flag * private/protected identifiers, strip them diff --git a/packages/eslint-plugin/src/rules/class-name-casing.ts b/packages/eslint-plugin/src/rules/class-name-casing.ts index 1c76edd118b7..cb238f87ac7b 100644 --- a/packages/eslint-plugin/src/rules/class-name-casing.ts +++ b/packages/eslint-plugin/src/rules/class-name-casing.ts @@ -64,7 +64,7 @@ export default util.createRule({ | TSESTree.ClassDeclaration | TSESTree.TSInterfaceDeclaration | TSESTree.ClassExpression, - ) { + ): void { // class expressions (i.e. export default class {}) are OK if (node.id && !isPascalCase(node.id.name)) { report(node, node.id); @@ -72,7 +72,7 @@ export default util.createRule({ }, "VariableDeclarator[init.type='ClassExpression']"( node: TSESTree.VariableDeclarator, - ) { + ): void { if ( node.id.type === AST_NODE_TYPES.ArrayPattern || node.id.type === AST_NODE_TYPES.ObjectPattern diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts index 6380f9f00035..a5f87250da03 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -77,7 +77,7 @@ export default util.createRule({ function reportIncorrectAssertionType( node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression, - ) { + ): void { const messageId = options.assertionStyle; context.report({ node, @@ -89,7 +89,7 @@ export default util.createRule({ }); } - function checkType(node: TSESTree.TypeNode) { + function checkType(node: TSESTree.TypeNode): boolean { switch (node.type) { case AST_NODE_TYPES.TSAnyKeyword: case AST_NODE_TYPES.TSUnknownKeyword: @@ -107,7 +107,7 @@ export default util.createRule({ function checkExpression( node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression, - ) { + ): void { if ( options.assertionStyle === 'never' || options.objectLiteralTypeAssertions === 'allow' || @@ -137,7 +137,7 @@ export default util.createRule({ } return { - TSTypeAssertion(node) { + TSTypeAssertion(node): void { if (options.assertionStyle !== 'angle-bracket') { reportIncorrectAssertionType(node); return; @@ -145,7 +145,7 @@ export default util.createRule({ checkExpression(node); }, - TSAsExpression(node) { + TSAsExpression(node): void { if (options.assertionStyle !== 'as') { reportIncorrectAssertionType(node); return; diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index 01fa92dd3d07..cf9e851c81cf 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -9,6 +9,7 @@ export default util.createRule({ description: 'Consistent with type definition either `interface` or `type`', category: 'Stylistic Issues', + // too opinionated to be recommended recommended: false, }, messages: { @@ -29,7 +30,7 @@ export default util.createRule({ return { "TSTypeAliasDeclaration[typeAnnotation.type='TSTypeLiteral']"( node: TSESTree.TSTypeAliasDeclaration, - ) { + ): void { if (option === 'interface') { context.report({ node: node.id, @@ -63,7 +64,7 @@ export default util.createRule({ }); } }, - TSInterfaceDeclaration(node) { + TSInterfaceDeclaration(node): void { if (option === 'type') { context.report({ node: node.id, diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 44ea2d03c8e2..67692c20fc03 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -47,8 +47,8 @@ export default util.createRule({ defaultOptions: [ { allowExpressions: false, - allowTypedFunctionExpressions: false, - allowHigherOrderFunctions: false, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, }, ], create(context, [options]) { diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 8d2b590ffad8..21a5a8cda189 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -33,8 +33,9 @@ export default util.createRule({ docs: { description: 'Require explicit accessibility modifiers on class properties and methods', - category: 'Best Practices', - recommended: 'error', + category: 'Stylistic Issues', + // too opinionated to be recommended + recommended: false, }, messages: { missingAccessibility: @@ -82,7 +83,7 @@ export default util.createRule({ nodeType: string, node: TSESTree.Node, nodeName: string, - ) { + ): void { context.report({ node: node, messageId: messageId, @@ -179,7 +180,7 @@ export default util.createRule({ */ function checkParameterPropertyAccessibilityModifier( node: TSESTree.TSParameterProperty, - ) { + ): void { const nodeType = 'parameter property'; // HAS to be an identifier or assignment or TSC will throw if ( diff --git a/packages/eslint-plugin/src/rules/generic-type-naming.ts b/packages/eslint-plugin/src/rules/generic-type-naming.ts index 784a2fc3b0cf..95516174448f 100644 --- a/packages/eslint-plugin/src/rules/generic-type-naming.ts +++ b/packages/eslint-plugin/src/rules/generic-type-naming.ts @@ -10,6 +10,7 @@ export default util.createRule({ docs: { description: 'Enforces naming of generic type variables', category: 'Stylistic Issues', + // too opinionated to be recommended recommended: false, }, messages: { @@ -30,7 +31,7 @@ export default util.createRule({ const regex = new RegExp(rule!); return { - TSTypeParameter(node) { + TSTypeParameter(node): void { const name = node.name.name; if (name && !regex.test(name)) { diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts index 475e3c35d7b0..082ca05129d2 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts @@ -2,7 +2,11 @@ // License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE import { TSESTree } from '@typescript-eslint/experimental-utils'; -import { BinarySearchTree, TokenOrComment } from './BinarySearchTree'; +import { + BinarySearchTree, + TokenOrComment, + TreeValue, +} from './BinarySearchTree'; import { TokenInfo } from './TokenInfo'; /** @@ -34,7 +38,7 @@ export class OffsetStorage { this.ignoredTokens = new WeakSet(); } - private getOffsetDescriptor(token: TokenOrComment) { + private getOffsetDescriptor(token: TokenOrComment): TreeValue { return this.tree.findLe(token.range[0]).value; } @@ -151,8 +155,8 @@ export class OffsetStorage { public setDesiredOffsets( range: [number, number], fromToken: TokenOrComment | null, - offset: number = 0, - force: boolean = false, + offset = 0, + force = false, ): void { /* * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts index 3549da45d74d..56909f15fa7e 100644 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts @@ -25,15 +25,13 @@ import { OffsetStorage } from './OffsetStorage'; import { TokenInfo } from './TokenInfo'; import { createRule, ExcludeKeys, RequireKeys } from '../../util'; -function createGlobalLinebreakMatcher() { - return /\r\n|[\r\n\u2028\u2029]/gu; -} +const GLOBAL_LINEBREAK_REGEX = /\r\n|[\r\n\u2028\u2029]/gu; +const WHITESPACE_REGEX = /\s*$/u; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -const WHITESPACE_REGEX = /\s*$/u; const KNOWN_NODES = new Set([ AST_NODE_TYPES.AssignmentExpression, AST_NODE_TYPES.AssignmentPattern, @@ -440,7 +438,7 @@ export default createRule({ expectedAmount: number, actualSpaces: number, actualTabs: number, - ) { + ): { expected: string; actual: string | number } { const expectedStatement = `${expectedAmount} ${indentType}${ expectedAmount === 1 ? '' : 's' }`; // e.g. "2 tabs" @@ -568,9 +566,7 @@ export default createRule({ */ function countTrailingLinebreaks(str: string): number { const trailingWhitespace = WHITESPACE_REGEX.exec(str)![0]; - const linebreakMatches = createGlobalLinebreakMatcher().exec( - trailingWhitespace, - ); + const linebreakMatches = GLOBAL_LINEBREAK_REGEX.exec(trailingWhitespace); return linebreakMatches === null ? 0 : linebreakMatches.length; } @@ -587,7 +583,7 @@ export default createRule({ startToken: TSESTree.Token, endToken: TSESTree.Token, offset: number | string, - ) { + ): void { /** * Gets the first token of a given element, including surrounding parentheses. * @param element A node in the `elements` list @@ -1589,6 +1585,7 @@ export default createRule({ const listener = baseOffsetListeners[key] as TSESLint.RuleFunction< TSESTree.Node >; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type acc[key] = node => listenerCallQueue.push({ listener, node }); return acc; diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 76d1edf1cdbb..aca492d4b4da 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -90,7 +90,8 @@ export default util.createRule({ docs: { description: 'Enforce consistent indentation', category: 'Stylistic Issues', - recommended: 'error', + // too opinionated to be recommended + recommended: false, }, fixable: 'whitespace', schema: baseRule.meta.schema, diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index 1af78f79a53c..119765522213 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -8,8 +8,11 @@ export default util.createRule({ meta: { type: 'suggestion', docs: { - description: 'Require that interface names be prefixed with `I`', + description: + 'Require that interface names should or should not prefixed with `I`', category: 'Stylistic Issues', + // this will always be recommended as there's no reason to use this convention + // https://github.com/typescript-eslint/typescript-eslint/issues/374 recommended: 'error', }, messages: { diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index d2becd1655fa..72020afc6008 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -364,28 +364,28 @@ export default util.createRule({ } return { - ClassDeclaration(node) { + ClassDeclaration(node): void { validateMembersOrder( node.body.body, options.classes || options.default!, true, ); }, - ClassExpression(node) { + ClassExpression(node): void { validateMembersOrder( node.body.body, options.classExpressions || options.default!, true, ); }, - TSInterfaceDeclaration(node) { + TSInterfaceDeclaration(node): void { validateMembersOrder( node.body.body, options.interfaces || options.default!, false, ); }, - TSTypeLiteral(node) { + TSTypeLiteral(node): void { validateMembersOrder( node.members, options.typeLiterals || options.default!, diff --git a/packages/eslint-plugin/src/rules/no-empty-function.ts b/packages/eslint-plugin/src/rules/no-empty-function.ts index d64568a874f6..31aa5d8bb630 100644 --- a/packages/eslint-plugin/src/rules/no-empty-function.ts +++ b/packages/eslint-plugin/src/rules/no-empty-function.ts @@ -15,7 +15,7 @@ export default util.createRule({ docs: { description: 'Disallow empty functions', category: 'Best Practices', - recommended: false, + recommended: 'error', }, schema: baseRule.meta.schema, messages: baseRule.meta.messages, @@ -81,7 +81,7 @@ export default util.createRule({ */ function isConciseConstructor( node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, - ) { + ): boolean { // Check TypeScript specific nodes return ( isConstructor(node) && isBodyEmpty(node) && hasParameterProperties(node) @@ -89,12 +89,12 @@ export default util.createRule({ } return { - FunctionDeclaration(node: TSESTree.FunctionDeclaration) { + FunctionDeclaration(node): void { if (!isConciseConstructor(node)) { rules.FunctionDeclaration(node); } }, - FunctionExpression(node: TSESTree.FunctionExpression) { + FunctionExpression(node): void { if (!isConciseConstructor(node)) { rules.FunctionExpression(node); } diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index 4d2a0a5a4882..55fbdb5337e3 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -40,7 +40,7 @@ export default util.createRule({ ], create(context, [{ allowSingleExtends }]) { return { - TSInterfaceDeclaration(node) { + TSInterfaceDeclaration(node): void { if (node.body.body.length !== 0) { // interface contains members --> Nothing to report return; diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index 43f81b8607e5..249265a7683c 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -167,7 +167,7 @@ export default util.createRule({ } return { - TSAnyKeyword(node) { + TSAnyKeyword(node): void { if (ignoreRestArgs && isNodeDescendantOfRestElementInFunction(node)) { return; } @@ -175,7 +175,8 @@ export default util.createRule({ let fix: TSESLint.ReportFixFunction | null = null; if (fixToUnknown) { - fix = fixer => fixer.replaceText(node, 'unknown'); + fix = (fixer => + fixer.replaceText(node, 'unknown')) as TSESLint.ReportFixFunction; } context.report({ diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 28e69478d7e5..7b8d091807c3 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -31,7 +31,7 @@ export default util.createRule({ function binaryExp( node: TSESTree.BinaryExpression | TSESTree.LogicalExpression, - ) { + ): void { const rule = rules.BinaryExpression as (n: typeof node) => void; // makes the rule think it should skip the left or right @@ -56,7 +56,9 @@ export default util.createRule({ return rule(node); } - function callExp(node: TSESTree.CallExpression | TSESTree.NewExpression) { + function callExp( + node: TSESTree.CallExpression | TSESTree.NewExpression, + ): void { const rule = rules.CallExpression as (n: typeof node) => void; if (node.callee.type === AST_NODE_TYPES.TSAsExpression) { @@ -74,7 +76,7 @@ export default util.createRule({ } function unaryUpdateExpression( node: TSESTree.UnaryExpression | TSESTree.UpdateExpression, - ) { + ): void { const rule = rules.UnaryExpression as (n: typeof node) => void; if (node.argument.type === AST_NODE_TYPES.TSAsExpression) { diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index 846416866f25..4756b5928f33 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -54,7 +54,7 @@ export default util.createRule({ ], create(context, [{ allowConstructorOnly, allowEmpty, allowStaticOnly }]) { return { - ClassBody(node) { + ClassBody(node): void { const parent = node.parent as | TSESTree.ClassDeclaration | TSESTree.ClassExpression diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 04d6664525c8..5bc2f75adaa4 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -24,7 +24,7 @@ export default util.createRule({ const checker = parserServices.program.getTypeChecker(); return { - ExpressionStatement(node) { + ExpressionStatement(node): void { const { expression } = parserServices.esTreeNodeToTSNodeMap.get< ts.ExpressionStatement >(node); diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index 970c621887e6..03171e7fdf71 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -7,7 +7,7 @@ export default util.createRule({ docs: { description: 'Disallow iterating over an array with a for-in loop', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { forInViolation: @@ -19,7 +19,7 @@ export default util.createRule({ defaultOptions: [], create(context) { return { - ForInStatement(node) { + ForInStatement(node): void { const parserServices = util.getParserServices(context); const checker = parserServices.program.getTypeChecker(); const originalNode = parserServices.esTreeNodeToTSNodeMap.get< diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index f3b44e512fa7..40fc6a60c7eb 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -44,24 +44,30 @@ export default util.createRule({ }, defaultOptions: [ { - ignoreParameters: true, - ignoreProperties: true, + ignoreParameters: false, + ignoreProperties: false, }, ], create(context, [{ ignoreParameters, ignoreProperties }]) { - function isFunctionCall(init: TSESTree.Expression, callName: string) { + function isFunctionCall( + init: TSESTree.Expression, + callName: string, + ): boolean { return ( init.type === AST_NODE_TYPES.CallExpression && init.callee.type === AST_NODE_TYPES.Identifier && init.callee.name === callName ); } - function isLiteral(init: TSESTree.Expression, typeName: string) { + function isLiteral(init: TSESTree.Expression, typeName: string): boolean { return ( init.type === AST_NODE_TYPES.Literal && typeof init.value === typeName ); } - function isIdentifier(init: TSESTree.Expression, ...names: string[]) { + function isIdentifier( + init: TSESTree.Expression, + ...names: string[] + ): boolean { return ( init.type === AST_NODE_TYPES.Identifier && names.includes(init.name) ); diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 8a50fa87c390..005bae9eb0ae 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -150,7 +150,7 @@ export default util.createRule({ } return { - Literal(node) { + Literal(node): void { // Check if the node is a TypeScript enum declaration if (options.ignoreEnums && isParentTSEnumDeclaration(node)) { return; diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts index aa9d0cb366cf..67d00b131f0e 100644 --- a/packages/eslint-plugin/src/rules/no-misused-new.ts +++ b/packages/eslint-plugin/src/rules/no-misused-new.ts @@ -16,7 +16,7 @@ export default util.createRule({ schema: [], messages: { errorMessageInterface: 'Interfaces cannot be constructed, only classes.', - errorMessageClass: 'Class cannon have method named `new`.', + errorMessageClass: 'Class cannot have method named `new`.', }, }, defaultOptions: [], @@ -69,7 +69,7 @@ export default util.createRule({ return { 'TSInterfaceBody > TSConstructSignatureDeclaration'( node: TSESTree.TSConstructSignatureDeclaration, - ) { + ): void { if ( isMatchingParentType( node.parent!.parent as TSESTree.TSInterfaceDeclaration, @@ -85,7 +85,7 @@ export default util.createRule({ }, "TSMethodSignature[key.name='constructor']"( node: TSESTree.TSMethodSignature, - ) { + ): void { context.report({ node, messageId: 'errorMessageInterface', @@ -93,7 +93,7 @@ export default util.createRule({ }, "ClassBody > MethodDefinition[key.name='new']"( node: TSESTree.MethodDefinition, - ) { + ): void { if (node.value.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { if ( node.parent && diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index b36046352d7d..6d06ef8807a2 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -17,7 +17,7 @@ export default util.createRule({ docs: { description: 'Avoid using promises in places not designed to handle them', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { voidReturn: @@ -73,13 +73,15 @@ export default util.createRule({ NewExpression: checkArguments, }; - function checkTestConditional(node: { test: TSESTree.Expression | null }) { + function checkTestConditional(node: { + test: TSESTree.Expression | null; + }): void { if (node.test) { checkConditional(node.test); } } - function checkConditional(node: TSESTree.Expression) { + function checkConditional(node: TSESTree.Expression): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); if (isAlwaysThenable(checker, tsNode)) { context.report({ @@ -91,7 +93,7 @@ export default util.createRule({ function checkArguments( node: TSESTree.CallExpression | TSESTree.NewExpression, - ) { + ): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get< ts.CallExpression | ts.NewExpression >(node); @@ -126,7 +128,7 @@ export default util.createRule({ // alternates in a union) to be thenable. Otherwise, you might be trying to // check if something is defined or undefined and get caught because one of the // branches is thenable. -function isAlwaysThenable(checker: ts.TypeChecker, node: ts.Node) { +function isAlwaysThenable(checker: ts.TypeChecker, node: ts.Node): boolean { const type = checker.getTypeAtLocation(node); for (const subType of tsutils.unionTypeParts(checker.getApparentType(type))) { @@ -195,7 +197,7 @@ function isFunctionParam( function voidFunctionParams( checker: ts.TypeChecker, node: ts.CallExpression | ts.NewExpression, -) { +): Set { const voidReturnIndices = new Set(); const thenableReturnIndices = new Set(); const type = checker.getTypeAtLocation(node.expression); @@ -237,7 +239,10 @@ function voidFunctionParams( } // Returns true if the expression is a function that returns a thenable -function returnsThenable(checker: ts.TypeChecker, node: ts.Expression) { +function returnsThenable( + checker: ts.TypeChecker, + node: ts.Expression, +): boolean { const type = checker.getApparentType(checker.getTypeAtLocation(node)); for (const subType of tsutils.unionTypeParts(type)) { diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index ca68fcf647b5..3698b4f941bd 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -53,7 +53,7 @@ export default util.createRule({ return { "TSModuleDeclaration[global!=true][id.type='Identifier']"( node: TSESTree.TSModuleDeclaration, - ) { + ): void { if ( (node.parent && node.parent.type === AST_NODE_TYPES.TSModuleDeclaration) || diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index 6ed336e4d2d3..4e888c58bb64 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -8,7 +8,7 @@ export default util.createRule({ description: 'Disallows non-null assertions using the `!` postfix operator', category: 'Stylistic Issues', - recommended: 'error', + recommended: 'warn', }, messages: { noNonNull: 'Forbidden non-null assertion.', @@ -18,7 +18,7 @@ export default util.createRule({ defaultOptions: [], create(context) { return { - TSNonNullExpression(node) { + TSNonNullExpression(node): void { context.report({ node, messageId: 'noNonNull', diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index a7727a33602b..9b6bb31e6541 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -27,7 +27,8 @@ export default util.createRule({ description: 'Disallow the use of parameter properties in class constructors', category: 'Stylistic Issues', - recommended: 'error', + // too opinionated to be recommended + recommended: false, }, messages: { noParamProp: @@ -81,7 +82,7 @@ export default util.createRule({ } return { - TSParameterProperty(node) { + TSParameterProperty(node): void { const modifiers = getModifiers(node); if (!allows.includes(modifiers)) { diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts index afb0b4a38480..91d81e0d8c53 100644 --- a/packages/eslint-plugin/src/rules/no-require-imports.ts +++ b/packages/eslint-plugin/src/rules/no-require-imports.ts @@ -18,13 +18,15 @@ export default util.createRule({ defaultOptions: [], create(context) { return { - 'CallExpression > Identifier[name="require"]'(node: TSESTree.Identifier) { + 'CallExpression > Identifier[name="require"]'( + node: TSESTree.Identifier, + ): void { context.report({ node: node.parent!, messageId: 'noRequireImports', }); }, - TSExternalModuleReference(node) { + TSExternalModuleReference(node): void { context.report({ node, messageId: 'noRequireImports', diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index e156cbd24e2f..8865fad2c3fb 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -19,7 +19,7 @@ export default util.createRule({ docs: { description: 'Disallow aliasing `this`', category: 'Best Practices', - recommended: false, + recommended: 'error', }, schema: [ { @@ -46,7 +46,7 @@ export default util.createRule({ }, defaultOptions: [ { - allowDestructuring: false, + allowDestructuring: true, allowedNames: [], }, ], @@ -54,7 +54,7 @@ export default util.createRule({ return { "VariableDeclarator[init.type='ThisExpression']"( node: TSESTree.VariableDeclarator, - ) { + ): void { const { id } = node; if (allowDestructuring && id.type !== AST_NODE_TYPES.Identifier) { diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index f260d124133f..1648b89f0dfa 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -44,6 +44,7 @@ export default util.createRule({ docs: { description: 'Disallow the use of type aliases', category: 'Stylistic Issues', + // too opinionated to be recommended recommended: false, }, messages: { @@ -188,7 +189,7 @@ export default util.createRule({ */ function validateTypeAliases( type: TypeWithLabel, - isTopLevel: boolean = false, + isTopLevel = false, ): void { if (type.node.type === AST_NODE_TYPES.TSFunctionType) { // callback @@ -268,7 +269,7 @@ export default util.createRule({ } return { - TSTypeAliasDeclaration(node) { + TSTypeAliasDeclaration(node): void { const types = getTypes(node.typeAnnotation); if (types.length === 1) { // is a top level type annotation diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index 23a98cb9bef5..64f58848d79b 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -132,7 +132,7 @@ export default util.createRule({ namespacesInScope.push(esTreeNodeToTSNodeMap.get(node)); } - function exitDeclaration() { + function exitDeclaration(): void { namespacesInScope.pop(); } diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index d93e205c7bb5..100a9d261c0e 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -73,7 +73,7 @@ export default util.createRule<[], MessageIds>({ } return { - TSTypeParameterInstantiation(node) { + TSTypeParameterInstantiation(node): void { const parentDeclaration = parserServices.esTreeNodeToTSNodeMap.get< ExtendingClassLikeDeclaration | ParameterCapableTSNode >(node.parent!); @@ -104,7 +104,7 @@ function getArgsAndParameters( function getTypeParametersFromNode( node: ParameterCapableTSNode, checker: ts.TypeChecker, -) { +): readonly ts.TypeParameterDeclaration[] | undefined { if (ts.isExpressionWithTypeArguments(node)) { return getTypeParametersFromType(node.expression, checker); } diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index c91c3d678c7b..11da74d88c91 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -27,7 +27,7 @@ export default util.createRule({ description: 'Warns if a type assertion does not change the type of an expression', category: 'Best Practices', - recommended: false, + recommended: 'error', }, fixable: 'code', messages: { @@ -166,7 +166,7 @@ export default util.createRule({ } return { - TSNonNullExpression(node) { + TSNonNullExpression(node): void { const originalNode = parserServices.esTreeNodeToTSNodeMap.get< ts.NonNullExpression >(node); diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 20ed4edc77aa..e40da7038930 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -255,7 +255,7 @@ export default util.createRule({ } return { - Program() { + Program(): void { findVariablesInScope(context.getScope()); }, }; diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 6410fa5fa435..3587c7953119 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -59,7 +59,7 @@ export default util.createRule({ create(context) { const rules = baseRule.create(context); return { - MethodDefinition(node) { + MethodDefinition(node): void { if ( node.value && node.value.type === AST_NODE_TYPES.FunctionExpression && diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 29b1c77dd34a..274cf2c1ceb2 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -22,7 +22,7 @@ export default util.createRule({ defaultOptions: [], create(context) { return { - CallExpression(node) { + CallExpression(node): void { if ( node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === 'require' && diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index 89f6c5403032..5aef0845a533 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -181,7 +181,7 @@ export default util.createRule({ } return { - 'ForStatement:exit'(node: TSESTree.ForStatement) { + 'ForStatement:exit'(node: TSESTree.ForStatement): void { if (!isSingleVariableDeclaration(node.init)) { return; } diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index f375b1bb8f28..dae4fae32956 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -72,7 +72,7 @@ export default util.createRule({ | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration, parent: TSESTree.Node, - ) { + ): string { const start = call.range[0]; const colonPos = call.returnType!.range[0] - start; const text = sourceCode.getText().slice(start, call.range[1]); @@ -102,7 +102,10 @@ export default util.createRule({ * @param member The TypeElement being checked * @param node The parent of member being checked */ - function checkMember(member: TSESTree.TypeElement, node: TSESTree.Node) { + function checkMember( + member: TSESTree.TypeElement, + node: TSESTree.Node, + ): void { if ( (member.type === AST_NODE_TYPES.TSCallSignatureDeclaration || member.type === AST_NODE_TYPES.TSConstructSignatureDeclaration) && @@ -141,12 +144,12 @@ export default util.createRule({ } return { - TSInterfaceDeclaration(node) { + TSInterfaceDeclaration(node): void { if (!hasOneSupertype(node) && node.body.body.length === 1) { checkMember(node.body.body[0], node); } }, - 'TSTypeLiteral[members.length = 1]'(node: TSESTree.TSTypeLiteral) { + 'TSTypeLiteral[members.length = 1]'(node: TSESTree.TSTypeLiteral): void { checkMember(node.members[0], node); }, }; diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 2db17e11d1dd..384edf018595 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -13,7 +13,7 @@ export default createRule({ docs: { description: 'Enforce `includes` method over `indexOf` method', category: 'Best Practices', - recommended: false, + recommended: 'error', }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index 6059a731a942..9137fe912aa6 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -26,7 +26,7 @@ export default util.createRule({ const sourceCode = context.getSourceCode(); return { - TSModuleDeclaration(node) { + TSModuleDeclaration(node): void { // Do nothing if the name is a string. if (!node.id || node.id.type === AST_NODE_TYPES.Literal) { return; diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 01f4ea320bab..22c85fd03437 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -61,7 +61,7 @@ export default util.createRule({ node: ts.PropertyAccessExpression, parent: ts.Node, classScope: ClassScope, - ) { + ): void { if (ts.isBinaryExpression(parent)) { handleParentBinaryExpression(node, parent, classScope); return; @@ -84,7 +84,7 @@ export default util.createRule({ node: ts.PropertyAccessExpression, parent: ts.BinaryExpression, classScope: ClassScope, - ) { + ): void { if ( parent.left === node && tsutils.isAssignmentKind(parent.operatorToken.kind) @@ -96,7 +96,7 @@ export default util.createRule({ function handleParentPostfixOrPrefixUnaryExpression( node: ts.PostfixUnaryExpression | ts.PrefixUnaryExpression, classScope: ClassScope, - ) { + ): void { if ( node.operator === ts.SyntaxKind.PlusPlusToken || node.operator === ts.SyntaxKind.MinusMinusToken @@ -107,14 +107,16 @@ export default util.createRule({ } } - function isConstructor(node: TSESTree.Node) { + function isConstructor(node: TSESTree.Node): boolean { return ( node.type === AST_NODE_TYPES.MethodDefinition && node.kind === 'constructor' ); } - function isFunctionScopeBoundaryInStack(node: TSESTree.Node) { + function isFunctionScopeBoundaryInStack( + node: TSESTree.Node, + ): boolean | tsutils.ScopeBoundary { if (classScopeStack.length === 0) { return false; } @@ -129,7 +131,7 @@ export default util.createRule({ function getEsNodesFromViolatingNode( violatingNode: ParameterOrPropertyDeclaration, - ) { + ): { esNode: TSESTree.Node; nameNode: TSESTree.Node } { if (ts.isParameterPropertyDeclaration(violatingNode)) { return { esNode: parserServices.tsNodeToESTreeNodeMap.get(violatingNode.name), @@ -148,7 +150,7 @@ export default util.createRule({ return { 'ClassDeclaration, ClassExpression'( node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, - ) { + ): void { classScopeStack.push( new ClassScope( checker, @@ -157,7 +159,7 @@ export default util.createRule({ ), ); }, - 'ClassDeclaration, ClassExpression:exit'() { + 'ClassDeclaration, ClassExpression:exit'(): void { const finalizedClassScope = classScopeStack.pop()!; const sourceCode = context.getSourceCode(); @@ -175,7 +177,7 @@ export default util.createRule({ }); } }, - MemberExpression(node) { + MemberExpression(node): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get< ts.PropertyAccessExpression >(node); @@ -187,7 +189,7 @@ export default util.createRule({ ); } }, - [functionScopeBoundaries](node: TSESTree.Node) { + [functionScopeBoundaries](node: TSESTree.Node): void { if (isConstructor(node)) { classScopeStack[classScopeStack.length - 1].enterConstructor( parserServices.esTreeNodeToTSNodeMap.get( @@ -198,7 +200,7 @@ export default util.createRule({ classScopeStack[classScopeStack.length - 1].enterNonConstructor(); } }, - [`${functionScopeBoundaries}:exit`](node: TSESTree.Node) { + [`${functionScopeBoundaries}:exit`](node: TSESTree.Node): void { if (isConstructor(node)) { classScopeStack[classScopeStack.length - 1].exitConstructor(); } else if (isFunctionScopeBoundaryInStack(node)) { @@ -247,7 +249,7 @@ class ClassScope { } } - public addDeclaredVariable(node: ParameterOrPropertyDeclaration) { + public addDeclaredVariable(node: ParameterOrPropertyDeclaration): void { if ( !tsutils.isModifierFlagSet(node, ts.ModifierFlags.Private) || tsutils.isModifierFlagSet(node, ts.ModifierFlags.Readonly) || @@ -270,7 +272,7 @@ class ClassScope { ).set(node.name.getText(), node); } - public addVariableModification(node: ts.PropertyAccessExpression) { + public addVariableModification(node: ts.PropertyAccessExpression): void { const modifierType = this.checker.getTypeAtLocation(node.expression); if ( modifierType.symbol === undefined || @@ -295,7 +297,7 @@ class ClassScope { ).add(node.name.text); } - public enterConstructor(node: ts.ConstructorDeclaration) { + public enterConstructor(node: ts.ConstructorDeclaration): void { this.constructorScopeDepth = DIRECTLY_INSIDE_CONSTRUCTOR; for (const parameter of node.parameters) { @@ -305,23 +307,23 @@ class ClassScope { } } - public exitConstructor() { + public exitConstructor(): void { this.constructorScopeDepth = OUTSIDE_CONSTRUCTOR; } - public enterNonConstructor() { + public enterNonConstructor(): void { if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { this.constructorScopeDepth += 1; } } - public exitNonConstructor() { + public exitNonConstructor(): void { if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { this.constructorScopeDepth -= 1; } } - public finalizeUnmodifiedPrivateNonReadonlys() { + public finalizeUnmodifiedPrivateNonReadonlys(): ParameterOrPropertyDeclaration[] { this.memberVariableModifications.forEach(variableName => { this.privateModifiableMembers.delete(variableName); }); diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index c48e2351985f..bd1a48fcb613 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -12,7 +12,7 @@ export default createRule({ description: 'Prefer RegExp#exec() over String#match() if no global flag is provided', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.', @@ -39,7 +39,7 @@ export default createRule({ return { "CallExpression[arguments.length=1] > MemberExpression.callee[property.name='match'][computed=false]"( node: TSESTree.MemberExpression, - ) { + ): void { const callNode = node.parent as TSESTree.CallExpression; const arg = callNode.arguments[0]; const evaluated = getStaticValue(arg, globalScope); diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 4e902dfd584a..2ffac6728acd 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -20,7 +20,7 @@ export default createRule({ description: 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { preferStartsWith: "Use 'String#startsWith' method instead.", diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 48d63cf0f545..faf55f95fa71 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -86,7 +86,7 @@ export default util.createRule({ const parserServices = util.getParserServices(context); const checker = parserServices.program.getTypeChecker(); - function validateNode(node: TSESTree.Node) { + function validateNode(node: TSESTree.Node): void { const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node); const signatures = checker .getTypeAtLocation(originalNode) @@ -111,17 +111,21 @@ export default util.createRule({ return { 'ArrowFunctionExpression[async = false]'( node: TSESTree.ArrowFunctionExpression, - ) { + ): void { if (checkArrowFunctions) { validateNode(node); } }, - 'FunctionDeclaration[async = false]'(node: TSESTree.FunctionDeclaration) { + 'FunctionDeclaration[async = false]'( + node: TSESTree.FunctionDeclaration, + ): void { if (checkFunctionDeclarations) { validateNode(node); } }, - 'FunctionExpression[async = false]'(node: TSESTree.FunctionExpression) { + 'FunctionExpression[async = false]'( + node: TSESTree.FunctionExpression, + ): void { if ( node.parent && 'kind' in node.parent && diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index a9745be16e02..5b3f430420f3 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -26,7 +26,7 @@ export default util.createRule({ return { "CallExpression[arguments.length=0] > MemberExpression[property.name='sort'][computed=false]"( node: TSESTree.MemberExpression, - ) { + ): void { // Get the symbol of the `sort` method. const tsNode = service.esTreeNodeToTSNodeMap.get(node); const sortSymbol = checker.getSymbolAtLocation(tsNode); diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index cbdd08791d9f..ef1092b46db3 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -23,7 +23,7 @@ export default util.createRule({ docs: { description: 'Disallow async functions which have no `await` expression', category: 'Best Practices', - recommended: false, + recommended: 'error', }, schema: baseRule.meta.schema, messages: baseRule.meta.messages, @@ -46,7 +46,7 @@ export default util.createRule({ | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, - ) { + ): void { scopeInfo = { upper: scopeInfo, returnsPromise: false, @@ -79,7 +79,7 @@ export default util.createRule({ | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, - ) { + ): void { if (scopeInfo) { if (!scopeInfo.returnsPromise) { switch (node.type) { @@ -109,7 +109,7 @@ export default util.createRule({ 'FunctionExpression[async = true]:exit': exitFunction, 'ArrowFunctionExpression[async = true]:exit': exitFunction, - ReturnStatement(node: TSESTree.ReturnStatement) { + ReturnStatement(node): void { if (!scopeInfo) { return; } diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index 6d68d5f7dfc8..df523033bf70 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -83,7 +83,7 @@ export default util.createRule({ } return { - "BinaryExpression[operator='+']"(node: TSESTree.BinaryExpression) { + "BinaryExpression[operator='+']"(node: TSESTree.BinaryExpression): void { const leftType = getNodeType(node.left); const rightType = getNodeType(node.right); diff --git a/packages/eslint-plugin/src/rules/semi.ts b/packages/eslint-plugin/src/rules/semi.ts index 8130088eb309..8d1ada467e3c 100644 --- a/packages/eslint-plugin/src/rules/semi.ts +++ b/packages/eslint-plugin/src/rules/semi.ts @@ -16,6 +16,7 @@ export default util.createRule({ docs: { description: 'Require or disallow semicolons instead of ASI', category: 'Stylistic Issues', + // too opinionated to be recommended recommended: false, }, fixable: 'code', @@ -59,7 +60,7 @@ export default util.createRule({ return { ...rules, ...nodesToCheck, - ExportDefaultDeclaration(node) { + ExportDefaultDeclaration(node): void { if (node.declaration.type !== AST_NODE_TYPES.TSInterfaceDeclaration) { rules.ExportDefaultDeclaration(node); } diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts index 7d74ab0c603d..c5ab5772523a 100644 --- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts @@ -18,7 +18,7 @@ export default util.createRule({ description: 'Sets preference level for triple slash directives versus ES6-style import declarations', category: 'Best Practices', - recommended: false, + recommended: 'error', }, messages: { tripleSlashReference: @@ -57,7 +57,7 @@ export default util.createRule({ importName: string; })[] = []; - function hasMatchingReference(source: TSESTree.Literal) { + function hasMatchingReference(source: TSESTree.Literal): void { references.forEach(reference => { if (reference.importName === source.value) { context.report({ @@ -71,20 +71,20 @@ export default util.createRule({ }); } return { - ImportDeclaration(node) { + ImportDeclaration(node): void { if (programNode) { const source = node.source as TSESTree.Literal; hasMatchingReference(source); } }, - TSImportEqualsDeclaration(node) { + TSImportEqualsDeclaration(node): void { if (programNode) { const source = (node.moduleReference as TSESTree.TSExternalModuleReference) .expression as TSESTree.Literal; hasMatchingReference(source); } }, - Program(node) { + Program(node): void { if (lib === 'always' && path === 'always' && types == 'always') { return; } diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index f5e11f51fb07..d0f1c5b45a44 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -185,12 +185,12 @@ export default util.createRule({ } return { - TSMappedType(node) { + TSMappedType(node): void { if (node.typeAnnotation) { checkTypeAnnotationSpacing(node.typeAnnotation); } }, - TSTypeAnnotation(node) { + TSTypeAnnotation(node): void { checkTypeAnnotationSpacing(node.typeAnnotation); }, }; diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 3c535467f2ce..182568e57488 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -55,7 +55,7 @@ export default util.createRule<[Options], MessageIds>({ }, ], create(context, [options]) { - function report(location: TSESTree.Node, name?: string) { + function report(location: TSESTree.Node, name?: string): void { context.report({ node: location, messageId: name ? 'expectedTypedefNamed' : 'expectedTypedef', @@ -63,11 +63,13 @@ export default util.createRule<[Options], MessageIds>({ }); } - function getNodeName(node: TSESTree.Parameter | TSESTree.PropertyName) { + function getNodeName( + node: TSESTree.Parameter | TSESTree.PropertyName, + ): string | undefined { return node.type === AST_NODE_TYPES.Identifier ? node.name : undefined; } - function checkParameters(params: TSESTree.Parameter[]) { + function checkParameters(params: TSESTree.Parameter[]): void { for (const param of params) { let annotationNode: TSESTree.Node | undefined; @@ -90,17 +92,17 @@ export default util.createRule<[Options], MessageIds>({ } return { - ArrayPattern(node) { + ArrayPattern(node): void { if (options[OptionKeys.ArrayDestructuring] && !node.typeAnnotation) { report(node); } }, - ArrowFunctionExpression(node) { + ArrowFunctionExpression(node): void { if (options[OptionKeys.ArrowParameter]) { checkParameters(node.params); } }, - ClassProperty(node) { + ClassProperty(node): void { if ( options[OptionKeys.MemberVariableDeclaration] && !node.typeAnnotation @@ -115,19 +117,19 @@ export default util.createRule<[Options], MessageIds>({ }, 'FunctionDeclaration, FunctionExpression'( node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, - ) { + ): void { if (options[OptionKeys.Parameter]) { checkParameters(node.params); } }, - ObjectPattern(node) { + ObjectPattern(node): void { if (options[OptionKeys.ObjectDestructuring] && !node.typeAnnotation) { report(node); } }, 'TSIndexSignature, TSPropertySignature'( node: TSESTree.TSIndexSignature | TSESTree.TSPropertySignature, - ) { + ): void { if (options[OptionKeys.PropertyDeclaration] && !node.typeAnnotation) { report( node, @@ -137,7 +139,7 @@ export default util.createRule<[Options], MessageIds>({ ); } }, - VariableDeclarator(node) { + VariableDeclarator(node): void { if ( options[OptionKeys.VariableDeclaration] && !node.id.typeAnnotation diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 88892b634176..0db82b2c7704 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -25,7 +25,7 @@ export default util.createRule({ category: 'Best Practices', description: 'Enforces unbound methods are called with their expected scope', - recommended: false, + recommended: 'error', }, messages: { unbound: @@ -54,7 +54,7 @@ export default util.createRule({ const checker = parserServices.program.getTypeChecker(); return { - [AST_NODE_TYPES.MemberExpression](node: TSESTree.MemberExpression) { + MemberExpression(node): void { if (isSafeUse(node)) { return; } @@ -73,7 +73,7 @@ export default util.createRule({ }, }); -function isDangerousMethod(symbol: ts.Symbol, ignoreStatic: boolean) { +function isDangerousMethod(symbol: ts.Symbol, ignoreStatic: boolean): boolean { const { valueDeclaration } = symbol; if (!valueDeclaration) { // working around https://github.com/microsoft/TypeScript/issues/31294 diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index 04695fcc3027..1c3f747bc51b 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -55,6 +55,7 @@ export default util.createRule({ description: 'Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter', category: 'Variables', + // too opinionated to be recommended recommended: false, }, type: 'suggestion', @@ -307,14 +308,14 @@ export default util.createRule({ typeParameters?: TSESTree.TSTypeParameterDeclaration, ): IsTypeParameter { if (typeParameters === undefined) { - return () => false; + return (() => false) as IsTypeParameter; } const set = new Set(); for (const t of typeParameters.params) { set.add(t.name.name); } - return typeName => set.has(typeName); + return (typeName => set.has(typeName)) as IsTypeParameter; } /** True if any of the outer type parameters are used in a signature. */ @@ -476,7 +477,7 @@ export default util.createRule({ function createScope( parent: ScopeNode, typeParameters?: TSESTree.TSTypeParameterDeclaration, - ) { + ): void { currentScope && scopes.push(currentScope); currentScope = { overloads: new Map(), @@ -485,7 +486,7 @@ export default util.createRule({ }; } - function checkScope() { + function checkScope(): void { const failures = checkOverloads( Array.from(currentScope.overloads.values()), currentScope.typeParameters, @@ -494,7 +495,7 @@ export default util.createRule({ currentScope = scopes.pop()!; } - function addOverload(signature: OverloadNode, key?: string) { + function addOverload(signature: OverloadNode, key?: string): void { key = key || getOverloadKey(signature); if (currentScope && signature.parent === currentScope.parent && key) { const overloads = currentScope.overloads.get(key); @@ -513,15 +514,15 @@ export default util.createRule({ return { Program: createScope, TSModuleBlock: createScope, - TSInterfaceDeclaration(node) { + TSInterfaceDeclaration(node): void { createScope(node.body, node.typeParameters); }, - ClassDeclaration(node) { + ClassDeclaration(node): void { createScope(node.body, node.typeParameters); }, TSTypeLiteral: createScope, // collect overloads - TSDeclareFunction(node) { + TSDeclareFunction(node): void { if (node.id && !node.body) { addOverload(node, node.id.name); } @@ -529,12 +530,12 @@ export default util.createRule({ TSCallSignatureDeclaration: addOverload, TSConstructSignatureDeclaration: addOverload, TSMethodSignature: addOverload, - TSAbstractMethodDefinition(node) { + TSAbstractMethodDefinition(node): void { if (!node.value.body) { addOverload(node); } }, - MethodDefinition(node) { + MethodDefinition(node): void { if (!node.value.body) { addOverload(node); } diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 30587b336ed9..cae887c229f1 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -11,14 +11,14 @@ import { /** * Check if the context file name is *.d.ts or *.d.tsx */ -export function isDefinitionFile(fileName: string) { +export function isDefinitionFile(fileName: string): boolean { return /\.d\.tsx?$/i.test(fileName || ''); } /** * Upper cases the first character or the string */ -export function upperCaseFirst(str: string) { +export function upperCaseFirst(str: string): string { return str[0].toUpperCase() + str.slice(1); } diff --git a/packages/eslint-plugin/src/util/types.ts b/packages/eslint-plugin/src/util/types.ts index 83a8bbabf575..6f769d7f950a 100644 --- a/packages/eslint-plugin/src/util/types.ts +++ b/packages/eslint-plugin/src/util/types.ts @@ -186,7 +186,10 @@ export function isTypeFlagSet( /** * @returns Whether a type is an instance of the parent type, including for the parent's base types. */ -export const typeIsOrHasBaseType = (type: ts.Type, parentType: ts.Type) => { +export function typeIsOrHasBaseType( + type: ts.Type, + parentType: ts.Type, +): boolean { if (type.symbol === undefined || parentType.symbol === undefined) { return false; } @@ -208,4 +211,4 @@ export const typeIsOrHasBaseType = (type: ts.Type, parentType: ts.Type) => { } return false; -}; +} diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index fe3d06d4fc87..978adc109669 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -68,7 +68,7 @@ class RuleTester extends TSESLint.RuleTester { } } -function getFixturesRootDir() { +function getFixturesRootDir(): string { return path.join(process.cwd(), 'tests/fixtures/'); } diff --git a/packages/eslint-plugin/tests/rules/indent/utils.ts b/packages/eslint-plugin/tests/rules/indent/utils.ts index 72cedd3ea645..badfbc1c3c6f 100644 --- a/packages/eslint-plugin/tests/rules/indent/utils.ts +++ b/packages/eslint-plugin/tests/rules/indent/utils.ts @@ -17,6 +17,7 @@ type MessageIds = InferMessageIdsTypeFromRule; * @returns The template literal, with spaces removed from all lines */ export function unIndent(strings: TemplateStringsArray): string { + const WHITESPACE_REGEX = / */u; const templateValue = strings[0]; const lines = templateValue .replace(/^\n/u, '') @@ -24,7 +25,7 @@ export function unIndent(strings: TemplateStringsArray): string { .split('\n'); const lineIndents = lines .filter(line => line.trim()) - .map(line => / */u.exec(line)![0].length); + .map(line => WHITESPACE_REGEX.exec(line)![0].length); const minLineIndent = Math.min(...lineIndents); return lines.map(line => line.slice(minLineIndent)).join('\n'); diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts index c1ddce12186f..03723eb9515d 100644 --- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts @@ -68,6 +68,11 @@ declare module 'foo' { }, { code: 'const { props, state } = this;', + options: [ + { + allowDestructuring: false, + }, + ], errors: [destructureError], }, { @@ -104,6 +109,11 @@ class TestClass { } } `, + options: [ + { + allowDestructuring: false, + }, + ], errors: [ idError, idError, diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index d09724e8eee2..45bb8c80db15 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -10,10 +10,12 @@ const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -function error(messages: { message: string; line: number; column: number }[]) { - // the base rule doesn't have messageIds +// the base rule doesn't have messageIds +function error( + messages: { message: string; line: number; column: number }[], // eslint-disable-next-line @typescript-eslint/no-explicit-any - return messages as any[]; +): any[] { + return messages; } ruleTester.run('no-unused-vars', rule, { diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 5e293018eb4c..d7f5fb29afd9 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -2,8 +2,11 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; import chalk from 'chalk'; import fs from 'fs'; import path from 'path'; +import { format, resolveConfig } from 'prettier'; import rules from '../src/rules'; +const prettierConfig = resolveConfig(__dirname); + interface LinterConfigRules { [name: string]: | TSESLint.Linter.RuleLevel @@ -23,29 +26,40 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Set([ 'func-call-spacing', 'indent', 'no-array-constructor', + 'no-empty-function', 'no-extra-parens', 'no-magic-numbers', 'no-unused-vars', 'no-use-before-define', 'no-useless-constructor', + 'require-await', 'semi', ]); +// list of rules from the base plugin that we think should be turned on for typescript code +const BASE_RULES_THAT_ARE_RECOMMENDED = new Set([ + 'no-var', + 'prefer-const', + 'prefer-rest-params', + 'prefer-spread', +]); -const ruleEntries = Object.entries(rules); +const ruleEntries = Object.entries(rules).sort((a, b) => + a[0].localeCompare(b[0]), +); /** * Helper function reduces records to key - value pairs. * @param config * @param entry */ -const reducer = ( +function reducer( config: LinterConfigRules, entry: [string, TSESLint.RuleModule], settings: { errorLevel?: 'error' | 'warn'; filterDeprecated: boolean; }, -) => { +): LinterConfigRules { const key = entry[0]; const value = entry[1]; @@ -81,13 +95,17 @@ const reducer = ( config[ruleName] = usedSetting; return config; -}; +} /** * Helper function writes configuration. */ function writeConfig(config: LinterConfig, filePath: string): void { - fs.writeFileSync(filePath, `${JSON.stringify(config, null, 2)}\n`); + const configStr = format(JSON.stringify(config), { + parser: 'json', + ...prettierConfig, + }); + fs.writeFileSync(filePath, configStr); } const baseConfig: LinterConfig = { @@ -117,14 +135,18 @@ console.log(); console.log( '------------------------------ recommended.json ------------------------------', ); +const recommendedRules = ruleEntries + .filter(entry => !!entry[1].meta.docs.recommended) + .reduce( + (config, entry) => reducer(config, entry, { filterDeprecated: false }), + {}, + ); +BASE_RULES_THAT_ARE_RECOMMENDED.forEach(ruleName => { + recommendedRules[ruleName] = 'error'; +}); const recommendedConfig: LinterConfig = { extends: './configs/base.json', - rules: ruleEntries - .filter(entry => !!entry[1].meta.docs.recommended) - .reduce( - (config, entry) => reducer(config, entry, { filterDeprecated: false }), - {}, - ), + rules: recommendedRules, }; writeConfig( recommendedConfig, diff --git a/packages/eslint-plugin/tools/validate-configs/checkConfigAll.ts b/packages/eslint-plugin/tools/validate-configs/checkConfigAll.ts index 84981b8816e7..fab57fe20cf6 100644 --- a/packages/eslint-plugin/tools/validate-configs/checkConfigAll.ts +++ b/packages/eslint-plugin/tools/validate-configs/checkConfigAll.ts @@ -3,13 +3,13 @@ import { logRule } from '../log'; const prefix = '@typescript-eslint/'; -function checkConfigAll() { +function checkConfigAll(): boolean { const { rules } = plugin; const all = plugin.configs.all.rules; const allNames = new Set(Object.keys(all)); - return Object.entries(rules).reduce((acc, [ruleName, rule]) => { + return Object.entries(rules).reduce((acc, [ruleName, rule]) => { if (!rule.meta.deprecated) { const prefixed = `${prefix}${ruleName}` as keyof typeof all; if (allNames.has(prefixed)) { diff --git a/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts index 21f2faa876dc..ae2561431127 100644 --- a/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts +++ b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts @@ -3,13 +3,13 @@ import { logRule } from '../log'; const prefix = '@typescript-eslint/'; -function checkConfigRecommended() { +function checkConfigRecommended(): boolean { const { rules } = plugin; const recommended = plugin.configs.recommended.rules; const recommendedNames = new Set(Object.keys(recommended)); - return Object.entries(rules).reduce((acc, [ruleName, rule]) => { + return Object.entries(rules).reduce((acc, [ruleName, rule]) => { if (!rule.meta.deprecated && rule.meta.docs.recommended !== false) { const prefixed = `${prefix}${ruleName}` as keyof typeof recommended; if (recommendedNames.has(prefixed)) { diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts index e9d339c10c23..ed6a8131edba 100644 --- a/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts @@ -3,6 +3,7 @@ import chalk from 'chalk'; import marked from 'marked'; import { logError } from '../log'; +const RULE_LINK_REGEX = /\[`@typescript-eslint\/(.+)`\]/; function validateTableStructure( rules: Record>>, rulesTable: marked.Tokens.Table, @@ -13,7 +14,7 @@ function validateTableStructure( let hasErrors = false; rulesTable.cells.forEach((row, rowIndex) => { - const match = /\[`@typescript-eslint\/(.+)`\]/.exec(row[0]); + const match = RULE_LINK_REGEX.exec(row[0]); if (!match) { logError(chalk.bold(`Unable to parse link in row ${rowIndex}:`), row[0]); hasErrors = true; diff --git a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts index e14242fca723..3edb71e5a55b 100644 --- a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts +++ b/packages/experimental-utils/src/eslint-utils/RuleCreator.ts @@ -42,7 +42,7 @@ export function RuleCreator(urlCreator: (ruleName: string) => string) { url: urlCreator(name), }, }, - create(context) { + create(context): TRuleListener { const optionsWithDefault = applyDefault( defaultOptions, context.options, diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/experimental-utils/src/eslint-utils/deepMerge.ts index 966a0db08212..3db67a594078 100644 --- a/packages/experimental-utils/src/eslint-utils/deepMerge.ts +++ b/packages/experimental-utils/src/eslint-utils/deepMerge.ts @@ -18,7 +18,10 @@ export function isObjectNotArray( * @param second The second object * @returns a new object */ -export function deepMerge(first: ObjectLike = {}, second: ObjectLike = {}) { +export function deepMerge( + first: ObjectLike = {}, + second: ObjectLike = {}, +): Record { // get the unique set of keys across both objects const keys = new Set(Object.keys(first).concat(Object.keys(second))); diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 6c7e5a38428f..1b98c064db09 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -21,7 +21,7 @@ function overrideDefine( this: TSESLintScope.Scope, node: TSESTree.Node, definition: TSESLintScope.Definition, - ) { + ): void { define.call(this, node, definition); // Set `variable.eslintUsed` to tell ESLint that the variable is exported. @@ -147,7 +147,7 @@ class Referencer extends TSESLintScope.Referencer { const upperScope = this.currentScope(); // Process the name. - if (type === 'FunctionDeclaration' && id) { + if (type === AST_NODE_TYPES.FunctionDeclaration && id) { upperScope.__define( id, new TSESLintScope.Definition( @@ -166,14 +166,14 @@ class Referencer extends TSESLintScope.Referencer { const def = defs[i]; if ( def.type === 'FunctionName' && - def.node.type === 'TSDeclareFunction' + def.node.type === AST_NODE_TYPES.TSDeclareFunction ) { defs.splice(i, 1); identifiers.splice(i, 1); break; } } - } else if (type === 'FunctionExpression' && id) { + } else if (type === AST_NODE_TYPES.FunctionExpression && id) { scopeManager.__nestFunctionExpressionNameScope(node); } @@ -213,7 +213,7 @@ class Referencer extends TSESLintScope.Referencer { this.visit(returnType); // Process the body. - if (body && body.type === 'BlockStatement') { + if (body && body.type === AST_NODE_TYPES.BlockStatement) { this.visitChildren(body); } else { this.visit(body); @@ -732,7 +732,7 @@ class Referencer extends TSESLintScope.Referencer { return; } - if (id && id.type === 'Identifier') { + if (id && id.type === AST_NODE_TYPES.Identifier) { scope.__define( id, new TSESLintScope.Definition( @@ -777,7 +777,7 @@ class Referencer extends TSESLintScope.Referencer { */ TSImportEqualsDeclaration(node: TSESTree.TSImportEqualsDeclaration): void { const { id, moduleReference } = node; - if (id && id.type === 'Identifier') { + if (id && id.type === AST_NODE_TYPES.Identifier) { this.currentScope().__define( id, new TSESLintScope.Definition( @@ -809,7 +809,7 @@ class Referencer extends TSESLintScope.Referencer { scopeManager.__currentScope = globalScope; // Skip TSModuleBlock to avoid to create that block scope. - if (node.body && node.body.type === 'TSModuleBlock') { + if (node.body && node.body.type === AST_NODE_TYPES.TSModuleBlock) { node.body.body.forEach(this.visit, this); } @@ -845,7 +845,7 @@ class Referencer extends TSESLintScope.Referencer { export function analyzeScope( ast: TSESTree.Program, parserOptions: ParserOptions, -) { +): ScopeManager { const options = { ignoreEval: true, optimistic: false, diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index fb5142f9b37d..830a282da1e4 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -28,7 +28,7 @@ interface ParseForESLintResult { function validateBoolean( value: boolean | undefined, - fallback: boolean = false, + fallback = false, ): boolean { if (typeof value !== 'boolean') { return fallback; @@ -44,7 +44,10 @@ export const version = packageJSON.version; export const Syntax = Object.freeze(AST_NODE_TYPES); -export function parse(code: string, options?: ParserOptions) { +export function parse( + code: string, + options?: ParserOptions, +): ParseForESLintResult['ast'] { return parseForESLint(code, options).ast; } diff --git a/packages/parser/src/scope/scope-manager.ts b/packages/parser/src/scope/scope-manager.ts index 648e24b77f8b..c179bd512d3d 100644 --- a/packages/parser/src/scope/scope-manager.ts +++ b/packages/parser/src/scope/scope-manager.ts @@ -13,12 +13,14 @@ export class ScopeManager extends TSESLintScope.ScopeManager { } /** @internal */ - __nestEnumScope(node: TSESTree.TSEnumDeclaration) { + __nestEnumScope(node: TSESTree.TSEnumDeclaration): TSESLintScope.Scope { return this.__nestScope(new EnumScope(this, this.__currentScope, node)); } /** @internal */ - __nestEmptyFunctionScope(node: TSESTree.TSDeclareFunction) { + __nestEmptyFunctionScope( + node: TSESTree.TSDeclareFunction, + ): TSESLintScope.Scope { return this.__nestScope( new EmptyFunctionScope(this, this.__currentScope, node), ); diff --git a/packages/parser/src/simple-traverse.ts b/packages/parser/src/simple-traverse.ts index 10f58918799c..a616f239a7b4 100644 --- a/packages/parser/src/simple-traverse.ts +++ b/packages/parser/src/simple-traverse.ts @@ -26,7 +26,7 @@ class SimpleTraverser { this.enter = enter; } - traverse(node: unknown, parent: TSESTree.Node | undefined) { + traverse(node: unknown, parent: TSESTree.Node | undefined): void { if (!isValidNode(node)) { return; } @@ -54,6 +54,6 @@ class SimpleTraverser { export function simpleTraverse( startingNode: TSESTree.Node, options: SimpleTraverseOptions, -) { +): void { new SimpleTraverser(options).traverse(startingNode, undefined); } diff --git a/packages/parser/tests/lib/basics.ts b/packages/parser/tests/lib/basics.ts index d526745e341b..c06e8e57be12 100644 --- a/packages/parser/tests/lib/basics.ts +++ b/packages/parser/tests/lib/basics.ts @@ -39,7 +39,7 @@ export const Price: React.SFC = function Price(props) {} linter.defineRule('test', { create(context) { return { - TSTypeReference(node) { + TSTypeReference(node): void { const name = context.getSourceCode().getText(node.typeName); context.report({ node, diff --git a/packages/parser/tests/lib/jsx.ts b/packages/parser/tests/lib/jsx.ts index 4d7f6a3f9bf0..530b26c444b5 100644 --- a/packages/parser/tests/lib/jsx.ts +++ b/packages/parser/tests/lib/jsx.ts @@ -27,7 +27,7 @@ describe('JSX', () => { * Test each fixture file */ function testFixture(fixturesDir: string, useJSXTextNode: boolean) { - return (filename: string) => { + return (filename: string): void => { const code = fs.readFileSync(filename, 'utf8'); const config = { useJSXTextNode, diff --git a/packages/parser/tests/tools/scope-analysis.ts b/packages/parser/tests/tools/scope-analysis.ts index e7aab1d9951a..373b863be818 100644 --- a/packages/parser/tests/tools/scope-analysis.ts +++ b/packages/parser/tests/tools/scope-analysis.ts @@ -8,20 +8,20 @@ export class ReferenceResolver { this.map = new Map(); } - resolve(obj: any, properties: any) { + resolve(obj: any, properties: any): any { const resolved = Object.assign({ $id: this.map.size }, properties); this.map.set(obj, resolved); return resolved; } - ref(obj: any) { + ref(obj: any): any { if (typeof obj !== 'object' || obj === null) { return obj; } - const { map } = this; + const map = this.map; return { - get $ref() { + get $ref(): any { return map.get(obj).$id; }, }; @@ -34,7 +34,7 @@ export class ReferenceResolver { * @param {ASTNode} node The AST node object. * @returns {Object} The object that can be used for JSON.stringify. */ -export function nodeToJSON(node: any) { +export function nodeToJSON(node: any): any { if (!node) { return node; } @@ -52,7 +52,7 @@ export function nodeToJSON(node: any) { * @param {ReferenceResolver} resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function variableToJSON(variable: any, resolver: any) { +export function variableToJSON(variable: any, resolver: any): any { const { name, eslintUsed } = variable; const defs = variable.defs.map((d: any) => ({ type: d.type, @@ -80,7 +80,7 @@ export function variableToJSON(variable: any, resolver: any) { * @param {ReferenceResolver} resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function referenceToJSON(reference: any, resolver: any) { +export function referenceToJSON(reference: any, resolver: any): any { const kind = `${reference.isRead() ? 'r' : ''}${ reference.isWrite() ? 'w' : '' }`; @@ -104,7 +104,10 @@ export function referenceToJSON(reference: any, resolver: any) { * @param {ReferenceResolver} resolver The reference resolver. * @returns {Object} The object that can be used for JSON.stringify. */ -export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { +export function scopeToJSON( + scope: any, + resolver = new ReferenceResolver(), +): any { const { type, functionExpressionScope, isStrict } = scope; const block = nodeToJSON(scope.block); const variables = scope.variables.map((v: any) => @@ -142,7 +145,7 @@ export function scopeToJSON(scope: any, resolver = new ReferenceResolver()) { }); } -export function getScopeTree(scopeManager: any) { +export function getScopeTree(scopeManager: any): any { const { globalScope } = scopeManager; // Do the postprocess to test. diff --git a/packages/parser/tests/tools/test-utils.ts b/packages/parser/tests/tools/test-utils.ts index 1ce769a521bb..28dd40d2e077 100644 --- a/packages/parser/tests/tools/test-utils.ts +++ b/packages/parser/tests/tools/test-utils.ts @@ -18,7 +18,7 @@ const defaultConfig = { * @param ast the AST object * @returns copy of the AST object */ -function getRaw(ast: TSESTree.Program) { +function getRaw(ast: TSESTree.Program): TSESTree.Program { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { @@ -39,18 +39,18 @@ function getRaw(ast: TSESTree.Program) { export function createSnapshotTestBlock( code: string, config: ParserOptions = {}, -) { +): () => void { config = Object.assign({}, defaultConfig, config); /** * @returns {Object} the AST object */ - function parse() { + function parse(): TSESTree.Program { const ast = parser.parseForESLint(code, config).ast; return getRaw(ast); } - return () => { + return (): void => { try { const result = parse(); expect(result).toMatchSnapshot(); @@ -77,18 +77,19 @@ export function createSnapshotTestBlock( export function createScopeSnapshotTestBlock( code: string, config: ParserOptions = {}, -) { +): () => void { config = Object.assign({}, defaultConfig, config); /** * @returns {Object} the AST object */ - function parse() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function parse(): any { const result = parser.parseForESLint(code, config); return getScopeTree(result.scopeManager); } - return () => { + return (): void => { try { const result = parse(); expect(result).toMatchSnapshot(); @@ -123,7 +124,7 @@ export function formatSnapshotName( filename: string, fixturesDir: string, fileExtension = '.js', -) { +): string { return `fixtures/${filename .replace(fixturesDir + '/', '') .replace(fileExtension, '')}`; diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 9cb2bdc974a8..fffb9ea15cfd 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -1,14 +1,15 @@ import { SourceFile } from 'typescript'; -import { convertError, Converter } from './convert'; +import { convertError, Converter, ASTMaps } from './convert'; import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; import { Extra } from './parser-options'; +import { TSESTree } from './ts-estree'; export function astConverter( ast: SourceFile, extra: Extra, shouldPreserveNodeMaps: boolean, -) { +): { estree: TSESTree.Program; astMaps: ASTMaps | undefined } { /** * The TypeScript compiler produced fundamental parse errors when parsing the * source. diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index dedae68dd172..3a7d2de99dc1 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -19,8 +19,10 @@ import { isESTreeClassMember, isOptional, unescapeStringLiteralText, + TSError, } from './node-utils'; import { AST_NODE_TYPES, TSESTree, TSNode } from './ts-estree'; +import { ParserWeakMap } from './parser-options'; const SyntaxKind = ts.SyntaxKind; @@ -35,7 +37,7 @@ interface ConverterOptions { * @param error the error object * @returns converted error object */ -export function convertError(error: any) { +export function convertError(error: any): TSError { return createError( error.file, error.start, @@ -43,14 +45,19 @@ export function convertError(error: any) { ); } +export interface ASTMaps { + esTreeNodeToTSNodeMap: ParserWeakMap; + tsNodeToESTreeNodeMap: ParserWeakMap; +} + export class Converter { private readonly ast: ts.SourceFile; private readonly options: ConverterOptions; private readonly esTreeNodeToTSNodeMap = new WeakMap(); private readonly tsNodeToESTreeNodeMap = new WeakMap(); - private allowPattern: boolean = false; - private inTypeMode: boolean = false; + private allowPattern = false; + private inTypeMode = false; /** * Converts a TypeScript node into an ESTree node @@ -63,7 +70,7 @@ export class Converter { this.options = options; } - getASTMaps() { + getASTMaps(): ASTMaps { return { esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap, @@ -168,7 +175,7 @@ export class Converter { private registerTSNodeInNodeMap( node: ts.Node, result: TSESTree.BaseNode | null, - ) { + ): void { if (result && this.options.shouldPreserveNodeMaps) { if (!this.tsNodeToESTreeNodeMap.has(node)) { this.tsNodeToESTreeNodeMap.set(node, result); diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index f1666635b11c..c23daf6e3173 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -644,6 +644,13 @@ export function getNodeContainer( return container!; } +export interface TSError { + index: number; + lineNumber: number; + column: number; + message: string; +} + /** * @param ast the AST object * @param start the index at which the error starts @@ -654,7 +661,7 @@ export function createError( ast: ts.SourceFile, start: number, message: string, -) { +): TSError { const loc = ast.getLineAndCharacterOfPosition(start); return { index: start, @@ -668,7 +675,7 @@ export function createError( * @param n the TSNode * @param ast the TS AST */ -export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile) { +export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean { // If we have a token or node that has a non-zero width, it must have tokens. // Note: getWidth() does not take trivia into account. return n.kind === SyntaxKind.EndOfFileToken diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 564114d7ccb7..f215fa44492c 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -33,7 +33,7 @@ let warnedAboutTSVersion = false; * * @param options Parser options */ -function getFileName({ jsx }: { jsx?: boolean }) { +function getFileName({ jsx }: { jsx?: boolean }): string { return jsx ? 'estree.tsx' : 'estree.ts'; } @@ -62,6 +62,11 @@ function resetExtra(): void { }; } +interface ASTAndProgram { + ast: ts.SourceFile; + program: ts.Program | undefined; +} + /** * @param code The code of the file being linted * @param options The config object @@ -71,7 +76,7 @@ function getASTFromProject( code: string, options: TSESTreeOptions, createDefaultProgram: boolean, -) { +): ASTAndProgram | undefined { const filePath = options.filePath || getFileName(options); const astAndProgram = firstDefined( calculateProjectParserOptions(code, filePath, extra), @@ -95,7 +100,10 @@ function getASTFromProject( * @param options The config object * @returns If found, returns the source file corresponding to the code and the containing program */ -function getASTAndDefaultProject(code: string, options: TSESTreeOptions) { +function getASTAndDefaultProject( + code: string, + options: TSESTreeOptions, +): ASTAndProgram | undefined { const fileName = options.filePath || getFileName(options); const program = createProgram(code, fileName, extra); const ast = program && program.getSourceFile(fileName); @@ -106,7 +114,7 @@ function getASTAndDefaultProject(code: string, options: TSESTreeOptions) { * @param code The code of the file being linted * @returns Returns a new source file and program corresponding to the linted code */ -function createNewProgram(code: string) { +function createNewProgram(code: string): ASTAndProgram { const FILENAME = getFileName(extra); const compilerHost: ts.CompilerHost = { @@ -170,7 +178,7 @@ function getProgramAndAST( options: TSESTreeOptions, shouldProvideParserServices: boolean, createDefaultProgram: boolean, -) { +): ASTAndProgram | undefined { return ( (shouldProvideParserServices && getASTFromProject(code, options, createDefaultProgram)) || @@ -293,7 +301,7 @@ function warnAboutTSVersion(): void { // Parser //------------------------------------------------------------------------------ -type AST = TSESTree.Program & +export type AST = TSESTree.Program & (T['range'] extends true ? { range: [number, number] } : {}) & (T['tokens'] extends true ? { tokens: TSESTree.Token[] } : {}) & (T['comment'] extends true ? { comments: TSESTree.Comment[] } : {}); @@ -403,7 +411,7 @@ export function parseAndGenerateServices< options, shouldProvideParserServices, extra.createDefaultProgram, - ); + )!; /** * Determine whether or not two-way maps of converted AST nodes should be preserved * during the conversion process diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index 091990533498..88c631715450 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -34,7 +34,7 @@ const parsedFilesSeen = new Set(); * Clear tsconfig caches. * Primarily used for testing. */ -export function clearCaches() { +export function clearCaches(): void { knownWatchProgramMap.clear(); watchCallbackTrackingMap.clear(); parsedFilesSeen.clear(); @@ -58,7 +58,7 @@ function diagnosticReporter(diagnostic: ts.Diagnostic): void { ); } -const noopFileWatcher = { close: () => {} }; +const noopFileWatcher = { close: (): void => {} }; function getTsconfigPath(tsconfigPath: string, extra: Extra): string { return path.isAbsolute(tsconfigPath) @@ -118,7 +118,7 @@ export function calculateProjectParserOptions( // ensure readFile reads the code being linted instead of the copy on disk const oldReadFile = watchCompilerHost.readFile; - watchCompilerHost.readFile = (filePath, encoding) => + watchCompilerHost.readFile = (filePath, encoding): string | undefined => path.normalize(filePath) === path.normalize(currentLintOperationState.filePath) ? currentLintOperationState.code @@ -128,7 +128,7 @@ export function calculateProjectParserOptions( watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; // ensure process doesn't emit programs - watchCompilerHost.afterProgramCreate = program => { + watchCompilerHost.afterProgramCreate = (program): void => { // report error if there are any errors in the config file const configFileDiagnostics = program .getConfigFileParsingDiagnostics() @@ -143,18 +143,20 @@ export function calculateProjectParserOptions( }; // register callbacks to trigger program updates without using fileWatchers + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type watchCompilerHost.watchFile = (fileName, callback) => { const normalizedFileName = path.normalize(fileName); watchCallbackTrackingMap.set(normalizedFileName, callback); return { - close: () => { + close: (): void => { watchCallbackTrackingMap.delete(normalizedFileName); }, }; }; // ensure fileWatchers aren't created for directories - watchCompilerHost.watchDirectory = () => noopFileWatcher; + watchCompilerHost.watchDirectory = (): typeof noopFileWatcher => + noopFileWatcher; // we're using internal typescript APIs which aren't on the types /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -163,8 +165,9 @@ export function calculateProjectParserOptions( .onCachedDirectoryStructureHostCreate; (watchCompilerHost as any).onCachedDirectoryStructureHostCreate = ( host: any, - ) => { + ): void => { const oldReadDirectory = host.readDirectory; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type host.readDirectory = ( path: string, extensions?: readonly string[], @@ -206,7 +209,11 @@ export function calculateProjectParserOptions( * @param extra.project Provided tsconfig paths * @returns The program containing just the file being linted and associated library files */ -export function createProgram(code: string, filePath: string, extra: Extra) { +export function createProgram( + code: string, + filePath: string, + extra: Extra, +): ts.Program | undefined { if (!extra.projects || extra.projects.length !== 1) { return undefined; } @@ -225,7 +232,7 @@ export function createProgram(code: string, filePath: string, extra: Extra) { const compilerHost = ts.createCompilerHost(commandLine.options, true); const oldReadFile = compilerHost.readFile; - compilerHost.readFile = (fileName: string) => + compilerHost.readFile = (fileName: string): string | undefined => path.normalize(fileName) === path.normalize(filePath) ? code : oldReadFile(fileName); diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 4b8e05d166b3..64f2453fc60b 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -33,8 +33,6 @@ const sharedFixturesDirPath = path.join( class FixturesTester { protected fixtures: FixturePatternConfig[] = []; - constructor() {} - /** * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, * including the capability to ignore specific nested patterns. @@ -45,7 +43,7 @@ class FixturesTester { public addFixturePatternConfig( fixturesSubPath: string, config: CreateFixturePatternConfig = {}, - ) { + ): void { let _fixturesDirPath = fixturesDirPath; if (!fs.existsSync(path.join(fixturesDirPath, fixturesSubPath))) { _fixturesDirPath = sharedFixturesDirPath; diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 43c23ce44d7c..7fba488c78d8 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,12 +1,17 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + import { ParserPlugin } from '@babel/parser'; import codeFrame from 'babel-code-frame'; import * as parser from '../../src/parser'; import * as parseUtils from './utils'; -function createError(message: string, line: number, column: number) { +function createError( + message: string, + line: number, + column: number, +): SyntaxError { // Construct an error similar to the ones thrown by Babylon. const error = new SyntaxError(`${message} (${line}:${column})`); - // eslint-disable-next-line @typescript-eslint/no-explicit-any (error as any).loc = { line, column, @@ -14,7 +19,7 @@ function createError(message: string, line: number, column: number) { return error; } -function parseWithBabelParser(text: string, jsx: boolean = true) { +function parseWithBabelParser(text: string, jsx = true): any { const babel = require('@babel/parser'); const plugins: ParserPlugin[] = [ 'typescript', @@ -40,7 +45,7 @@ function parseWithBabelParser(text: string, jsx: boolean = true) { }); } -function parseWithTypeScriptESTree(text: string, jsx: boolean = true) { +function parseWithTypeScriptESTree(text: string, jsx = true): parser.AST { try { const result = parser.parseAndGenerateServices(text, { loc: true, @@ -69,12 +74,14 @@ interface ASTComparisonParseOptions { jsx?: boolean; } -export function parse(text: string, opts: ASTComparisonParseOptions) { +export function parse( + text: string, + opts: ASTComparisonParseOptions, +): { parseError: any | null; ast: any | null } { /** * Always return a consistent interface, there will be times when we expect both * parsers to fail to parse the invalid source. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: { parseError: any | null; ast: any | null } = { parseError: null, ast: null, diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index 43be2143e785..563fd19cc309 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -26,7 +26,7 @@ export function omitDeep( root: any, keysToOmit: { key: string; predicate: Function }[], nodes: Record void> = {}, -) { +): any { function shouldOmit(keyName: string, val: any): boolean { if (keysToOmit && keysToOmit.length) { return keysToOmit.some( @@ -36,7 +36,7 @@ export function omitDeep( return false; } - function visit(node: any, parent: any) { + function visit(node: any, parent: any): void { if (!node) { return; } @@ -72,8 +72,8 @@ export function omitDeep( /** * Common predicates for Babylon AST preprocessing */ -const always = () => true; -const ifNumber = (val: any) => typeof val === 'number'; +const always = (): boolean => true; +const ifNumber = (val: any): boolean => typeof val === 'number'; /** * - Babylon wraps the "Program" node in an extra "File" node, normalize this for simplicity for now... @@ -290,7 +290,7 @@ export function preprocessBabylonAST(ast: any): any { export function removeLocationDataAndSourceTypeFromProgramNode( ast: any, ignoreSourceType: boolean, -) { +): any { delete ast.loc; delete ast.range; if (ignoreSourceType) { diff --git a/packages/typescript-estree/tests/lib/convert.ts b/packages/typescript-estree/tests/lib/convert.ts index 4a5ac51be55f..2a275c53fb4c 100644 --- a/packages/typescript-estree/tests/lib/convert.ts +++ b/packages/typescript-estree/tests/lib/convert.ts @@ -100,7 +100,7 @@ describe('convert', () => { instance.convertProgram(); const maps = instance.getASTMaps(); - function checkMaps(child: any) { + function checkMaps(child: any): void { child.forEachChild((node: any) => { if ( node.kind !== ts.SyntaxKind.EndOfFileToken && @@ -134,7 +134,7 @@ describe('convert', () => { instance.convertProgram(); const maps = instance.getASTMaps(); - function checkMaps(child: any) { + function checkMaps(child: any): void { child.forEachChild((node: any) => { if ( node.kind !== ts.SyntaxKind.EndOfFileToken && @@ -167,7 +167,7 @@ describe('convert', () => { const program = instance.convertProgram(); const maps = instance.getASTMaps(); - function checkMaps(child: any) { + function checkMaps(child: any): void { child.forEachChild((node: any) => { if (node.kind !== ts.SyntaxKind.EndOfFileToken) { expect(ast).toBe( @@ -184,7 +184,7 @@ describe('convert', () => { expect(maps.esTreeNodeToTSNodeMap.get(program.body[0])).toBeDefined(); expect(program.body[0]).not.toBe( - maps.tsNodeToESTreeNodeMap.get(ast.statements[0]), + maps.tsNodeToESTreeNodeMap.get(ast.statements[0] as any), ); checkMaps(ast); }); diff --git a/packages/typescript-estree/tests/lib/jsx.ts b/packages/typescript-estree/tests/lib/jsx.ts index 52b6debdf6b4..a3e0148907cc 100644 --- a/packages/typescript-estree/tests/lib/jsx.ts +++ b/packages/typescript-estree/tests/lib/jsx.ts @@ -23,11 +23,8 @@ describe('JSX', () => { /** * Test each fixture file */ - function testFixture( - fixturesDir: string, - useJSXTextNode: boolean, - ): (filename: string) => void { - return filename => { + function testFixture(fixturesDir: string, useJSXTextNode: boolean) { + return (filename: string): void => { const code = readFileSync(filename, 'utf8'); const config: TSESTreeOptions = { loc: true, diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 7e5c634db9d3..1afab0c5e444 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -280,7 +280,7 @@ describe('semanticInfo', () => { function testIsolatedFile( parseResult: ParseAndGenerateServicesResult, -) { +): void { // get type checker expect(parseResult).toHaveProperty('services.program.getTypeChecker'); const checker = parseResult.services.program!.getTypeChecker(); @@ -331,7 +331,7 @@ function testIsolatedFile( * @param {ts.TypeChecker} checker * @param {ts.Node} tsNode */ -function checkNumberArrayType(checker: ts.TypeChecker, tsNode: ts.Node) { +function checkNumberArrayType(checker: ts.TypeChecker, tsNode: ts.Node): void { const nodeType = checker.getTypeAtLocation(tsNode); expect(nodeType.flags).toBe(ts.TypeFlags.Object); expect((nodeType as ts.ObjectType).objectFlags).toBe( diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index 16210df104fb..b9fcb51cab64 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -6,7 +6,7 @@ import { TSESTreeOptions } from '../src/parser-options'; * @param {Object} ast the AST object * @returns {Object} copy of the AST object */ -export function getRaw(ast: parser.TSESTree.Program) { +export function getRaw(ast: parser.TSESTree.Program): parser.TSESTree.Program { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { @@ -20,7 +20,7 @@ export function getRaw(ast: parser.TSESTree.Program) { export function parseCodeAndGenerateServices( code: string, config: TSESTreeOptions, -) { +): parser.ParseAndGenerateServicesResult { return parser.parseAndGenerateServices(code, config); } @@ -36,18 +36,18 @@ export function createSnapshotTestBlock( code: string, config: TSESTreeOptions, generateServices?: true, -) { +): () => void { /** * @returns {Object} the AST object */ - function parse() { + function parse(): parser.TSESTree.Program { const ast = generateServices ? parser.parseAndGenerateServices(code, config).ast : parser.parse(code, config); return getRaw(ast); } - return () => { + return (): void => { try { const result = parse(); expect(result).toMatchSnapshot(); diff --git a/tests/integration/utils/jest-snapshot-resolver.js b/tests/integration/utils/jest-snapshot-resolver.js index 3032ef5d575c..366a96118398 100644 --- a/tests/integration/utils/jest-snapshot-resolver.js +++ b/tests/integration/utils/jest-snapshot-resolver.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/explicit-function-return-type */ /** * Use a jest snapshotResolver to map the test snapshot output back to the * linked volume. This means that even though we are running our tests inside diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index 34bf65ac52f3..11b237656153 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -35,7 +35,7 @@ interface AllContributorsUser { contributions: string[]; } -async function* fetchUsers(page = 1) { +async function* fetchUsers(page = 1): AsyncIterableIterator { let lastLength = 0; do { const response = await fetch(`${contributorsApiUrl}&page=${page}`, { @@ -61,7 +61,7 @@ async function* fetchUsers(page = 1) { ); } -async function main() { +async function main(): Promise { const githubContributors: Contributor[] = []; // fetch all of the contributor info diff --git a/yarn.lock b/yarn.lock index 5924927ec6d2..c86527946ff0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1428,6 +1428,11 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== +"@types/prettier@^1.18.0": + version "1.18.0" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.18.0.tgz#d2dbe4d5f76b455138f13a2d881278e2c06a733d" + integrity sha512-5N6WK/XXs9PLPpge2KOmOSaIym2vIo32GsrxM5YOFs7uZ8R9L/acg+hQzWsfwoHEpasqQkH0+3LzLTbiF1GFLQ== + "@types/semver@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6" @@ -6988,7 +6993,7 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier@^1.18.2: +prettier@*, prettier@^1.18.2: version "1.18.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== From 90b36ddac2f6de006fd59f2a9234df1eb2d1606e Mon Sep 17 00:00:00 2001 From: Taeheon Kim Date: Wed, 14 Aug 2019 01:39:11 +0900 Subject: [PATCH 34/38] docs(eslint-plugin): update ROADMAP.md (#844) --- packages/eslint-plugin/ROADMAP.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 58580935012b..65b5dcd46ba6 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -22,7 +22,7 @@ | [`no-import-side-effect`] | 🔌 | [`import/no-unassigned-import`] | | [`no-inferrable-types`] | ✅ | [`@typescript-eslint/no-inferrable-types`] | | [`no-internal-module`] | ✅ | [`@typescript-eslint/prefer-namespace-keyword`] | -| [`no-magic-numbers`] | 🌟 | [`no-magic-numbers`][no-magic-numbers] | +| [`no-magic-numbers`] | ✅ | [`@typescript-eslint/no-magic-numbers`] | | [`no-namespace`] | ✅ | [`@typescript-eslint/no-namespace`] | | [`no-non-null-assertion`] | ✅ | [`@typescript-eslint/no-non-null-assertion`] | | [`no-parameter-reassignment`] | ✅ | [`no-param-reassign`][no-param-reassign] | @@ -620,6 +620,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@typescript-eslint/no-unnecessary-type-arguments`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md [`@typescript-eslint/semi`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md [`@typescript-eslint/no-floating-promises`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md +[`@typescript-eslint/no-magic-numbers`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md From d3470c963eb436d9e5128301d4579fb2b251de7c Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 13 Aug 2019 20:37:21 +0100 Subject: [PATCH 35/38] feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) BREAKING CHANGE: removed some rules from recommended config --- .eslintrc.js | 1 + packages/eslint-plugin/README.md | 21 ++++++- packages/eslint-plugin/package.json | 6 +- .../recommended-requiring-type-checking.json | 19 +++++++ .../src/configs/recommended.json | 10 ---- packages/eslint-plugin/src/index.ts | 2 + .../eslint-plugin/src/rules/await-thenable.ts | 1 + .../src/rules/no-floating-promises.ts | 1 + .../src/rules/no-for-in-array.ts | 1 + .../src/rules/no-misused-promises.ts | 1 + .../src/rules/no-unnecessary-qualifier.ts | 1 + .../rules/no-unnecessary-type-arguments.ts | 1 + .../rules/no-unnecessary-type-assertion.ts | 1 + .../src/rules/prefer-includes.ts | 1 + .../src/rules/prefer-readonly.ts | 1 + .../src/rules/prefer-regexp-exec.ts | 1 + .../rules/prefer-string-starts-ends-with.ts | 1 + .../src/rules/promise-function-async.ts | 1 + .../src/rules/require-array-sort-compare.ts | 1 + .../eslint-plugin/src/rules/require-await.ts | 1 + .../src/rules/restrict-plus-operands.ts | 1 + .../src/rules/strict-boolean-expressions.ts | 1 + .../eslint-plugin/src/rules/unbound-method.ts | 1 + .../eslint-plugin/tools/generate-configs.ts | 56 ++++++++++++++++++- .../checkConfigRecommended.ts | 6 +- ...kConfigRecommendedRequiringTypeChecking.ts | 45 +++++++++++++++ .../tools/validate-configs/index.ts | 6 ++ .../validate-docs/validate-table-rules.ts | 24 ++++++++ .../experimental-utils/src/ts-eslint/Rule.ts | 5 ++ tests/integration/docker-compose.yml | 17 ++++++ .../.eslintrc.yml | 17 ++++++ .../Dockerfile | 17 ++++++ .../index.ts | 1 + .../test.js.snap | 44 +++++++++++++++ .../test.sh | 19 +++++++ tests/integration/run-all-tests.sh | 3 + 36 files changed, 317 insertions(+), 19 deletions(-) create mode 100644 packages/eslint-plugin/src/configs/recommended-requiring-type-checking.json create mode 100644 packages/eslint-plugin/tools/validate-configs/checkConfigRecommendedRequiringTypeChecking.ts create mode 100644 tests/integration/fixtures/recommended-does-not-require-program/.eslintrc.yml create mode 100644 tests/integration/fixtures/recommended-does-not-require-program/Dockerfile create mode 100644 tests/integration/fixtures/recommended-does-not-require-program/index.ts create mode 100644 tests/integration/fixtures/recommended-does-not-require-program/test.js.snap create mode 100755 tests/integration/fixtures/recommended-does-not-require-program/test.sh diff --git a/.eslintrc.js b/.eslintrc.js index 32a476969d3a..ef3d195354eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,6 +15,7 @@ module.exports = { 'eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', ], rules: { // diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 516f9c48daef..1ecc3e86cf97 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -51,7 +51,7 @@ You can also enable all the recommended rules for our plugin. Add `plugin:@types } ``` -You can also use [eslint:recommended](https://eslint.org/docs/rules/) with this plugin. Add both `eslint:recommended` and `plugin:@typescript-eslint/eslint-recommended`: +You can also use [eslint:recommended](https://eslint.org/docs/rules/) (the set of rules which are recommended for all projects by the ESLint Team) with this plugin. As noted in the root README, not all eslint core rules are compatible with TypeScript, so you need to add both `eslint:recommended` and `plugin:@typescript-eslint/eslint-recommended` (which will adjust the one from eslint appropriately for TypeScript) to your config: ```json { @@ -63,7 +63,24 @@ You can also use [eslint:recommended](https://eslint.org/docs/rules/) with this } ``` -If you want to use rules which require type information, you will need to specify a path to your tsconfig.json file in the "project" property of "parserOptions". +As of version 2 of this plugin, _by design_, none of the rules in the main `recommended` config require type-checking in order to run. This means that they are more lightweight and faster to run. + +Some highly valuable rules simply require type-checking in order to be implemented correctly, however, so we provide an additional config you can extend from called `recommended-requiring-type-checking`. You wou apply this _in addition_ to the recommended configs previously mentioned, e.g.: + +```json +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ] +} +``` + +Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking). + +NOTE: If you want to use rules which require type information, you will need to specify a path to your tsconfig.json file in the "project" property of "parserOptions". If you do not do this, you will get a runtime error which explains this. ```json { diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 14b417ac5c73..e0d1c05a9fec 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -30,11 +30,11 @@ "main": "dist/index.js", "scripts": { "build": "tsc -p tsconfig.build.json", - "check:docs": "ts-node --files ./tools/validate-docs/index.ts", - "check:configs": "ts-node --files ./tools/validate-configs/index.ts", + "check:docs": "../../node_modules/.bin/ts-node --files ./tools/validate-docs/index.ts", + "check:configs": "../../node_modules/.bin/ts-node --files ./tools/validate-configs/index.ts", "clean": "rimraf dist/", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "generate:configs": "ts-node --files tools/generate-configs.ts", + "generate:configs": "../../node_modules/.bin/ts-node --files tools/generate-configs.ts", "prebuild": "npm run clean", "test": "jest --coverage", "typecheck": "tsc --noEmit" diff --git a/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.json b/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.json new file mode 100644 index 000000000000..68867b532483 --- /dev/null +++ b/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.json @@ -0,0 +1,19 @@ +{ + "extends": "./configs/base.json", + "rules": { + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/no-for-in-array": "error", + "@typescript-eslint/no-misused-promises": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-regexp-exec": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "require-await": "off", + "@typescript-eslint/require-await": "error", + "@typescript-eslint/unbound-method": "error", + "no-var": "error", + "prefer-const": "error", + "prefer-rest-params": "error", + "prefer-spread": "error" + } +} diff --git a/packages/eslint-plugin/src/configs/recommended.json b/packages/eslint-plugin/src/configs/recommended.json index 95d18847686e..7d7a5628c9d8 100644 --- a/packages/eslint-plugin/src/configs/recommended.json +++ b/packages/eslint-plugin/src/configs/recommended.json @@ -2,7 +2,6 @@ "extends": "./configs/base.json", "rules": { "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/await-thenable": "error", "@typescript-eslint/ban-ts-ignore": "error", "@typescript-eslint/ban-types": "error", "camelcase": "off", @@ -18,28 +17,19 @@ "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-for-in-array": "error", "@typescript-eslint/no-inferrable-types": "error", "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-misused-promises": "error", "@typescript-eslint/no-namespace": "error", "@typescript-eslint/no-non-null-assertion": "warn", "@typescript-eslint/no-this-alias": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "warn", "no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "error", "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-includes": "error", "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/prefer-regexp-exec": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error", - "require-await": "off", - "@typescript-eslint/require-await": "error", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unbound-method": "error", "no-var": "error", "prefer-const": "error", "prefer-rest-params": "error", diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index 0fb5516ba720..d8e55844e1d3 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -3,6 +3,7 @@ import rules from './rules'; import all from './configs/all.json'; import base from './configs/base.json'; import recommended from './configs/recommended.json'; +import recommendedRequiringTypeChecking from './configs/recommended-requiring-type-checking.json'; import eslintRecommended from './configs/eslint-recommended'; export = { @@ -12,5 +13,6 @@ export = { base, recommended, 'eslint-recommended': eslintRecommended, + 'recommended-requiring-type-checking': recommendedRequiringTypeChecking, }, }; diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 304321001f7b..94dc75cf78d7 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -10,6 +10,7 @@ export default util.createRule({ description: 'Disallows awaiting a value that is not a Thenable', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, messages: { await: 'Unexpected `await` of a non-Promise (non-"Thenable") value.', diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 5bc2f75adaa4..816cc0846706 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -10,6 +10,7 @@ export default util.createRule({ description: 'Requires Promise-like values to be handled appropriately.', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, messages: { floating: 'Promises must be handled appropriately', diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index 03171e7fdf71..db15d310457c 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -8,6 +8,7 @@ export default util.createRule({ description: 'Disallow iterating over an array with a for-in loop', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, messages: { forInViolation: diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 6d06ef8807a2..63d0f0bf483c 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -18,6 +18,7 @@ export default util.createRule({ description: 'Avoid using promises in places not designed to handle them', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, messages: { voidReturn: diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index 64f58848d79b..1017be32222f 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -10,6 +10,7 @@ export default util.createRule({ category: 'Best Practices', description: 'Warns when a namespace qualifier is unnecessary', recommended: false, + requiresTypeChecking: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 100a9d261c0e..040650ea05d4 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -29,6 +29,7 @@ export default util.createRule<[], MessageIds>({ 'Warns if an explicitly specified type argument is the default for that type parameter', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index 11da74d88c91..61583878bae9 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -28,6 +28,7 @@ export default util.createRule({ 'Warns if a type assertion does not change the type of an expression', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 384edf018595..fcb5dfca4f57 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -14,6 +14,7 @@ export default createRule({ description: 'Enforce `includes` method over `indexOf` method', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 22c85fd03437..2c8ab3671be8 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -32,6 +32,7 @@ export default util.createRule({ "Requires that private members are marked as `readonly` if they're never modified outside of the constructor", category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index bd1a48fcb613..fea08554c3ad 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -13,6 +13,7 @@ export default createRule({ 'Prefer RegExp#exec() over String#match() if no global flag is provided', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, messages: { regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.', diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 2ffac6728acd..56344783b34d 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -21,6 +21,7 @@ export default createRule({ 'Enforce the use of `String#startsWith` and `String#endsWith` instead of other equivalent methods of checking substrings', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, messages: { preferStartsWith: "Use 'String#startsWith' method instead.", diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index faf55f95fa71..225b2bd83675 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -22,6 +22,7 @@ export default util.createRule({ 'Requires any function or method that returns a Promise to be marked async', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, messages: { missingAsync: 'Functions that return promises must be async.', diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index 5b3f430420f3..e88f2791f8f1 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -12,6 +12,7 @@ export default util.createRule({ description: 'Enforce giving `compare` argument to `Array#sort`', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, messages: { requireCompare: "Require 'compare' argument.", diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index ef1092b46db3..7441b4648966 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -24,6 +24,7 @@ export default util.createRule({ description: 'Disallow async functions which have no `await` expression', category: 'Best Practices', recommended: 'error', + requiresTypeChecking: true, }, schema: baseRule.meta.schema, messages: baseRule.meta.messages, diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index df523033bf70..1f715f1f9022 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -11,6 +11,7 @@ export default util.createRule({ 'When adding two variables, operands must both be of type number or of type string', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, messages: { notNumbers: diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index d9077bf31548..9c3c5b6ea98e 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -27,6 +27,7 @@ export default util.createRule({ description: 'Restricts the types allowed in boolean expressions', category: 'Best Practices', recommended: false, + requiresTypeChecking: true, }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 0db82b2c7704..c76ac76f9d03 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -26,6 +26,7 @@ export default util.createRule({ description: 'Enforces unbound methods are called with their expected scope', recommended: 'error', + requiresTypeChecking: true, }, messages: { unbound: diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index d7f5fb29afd9..cda1b0771ead 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -58,6 +58,7 @@ function reducer( settings: { errorLevel?: 'error' | 'warn'; filterDeprecated: boolean; + filterRequiresTypeChecking?: 'include' | 'exclude'; }, ): LinterConfigRules { const key = entry[0]; @@ -67,6 +68,22 @@ function reducer( return config; } + // Explicitly exclude rules requiring type-checking + if ( + settings.filterRequiresTypeChecking === 'exclude' && + value.meta.docs.requiresTypeChecking === true + ) { + return config; + } + + // Explicitly include rules requiring type-checking + if ( + settings.filterRequiresTypeChecking === 'include' && + value.meta.docs.requiresTypeChecking !== true + ) { + return config; + } + const ruleName = `${RULE_NAME_PREFIX}${key}`; const recommendation = value.meta.docs.recommended; const usedSetting = settings.errorLevel @@ -119,7 +136,7 @@ writeConfig(baseConfig, path.resolve(__dirname, '../src/configs/base.json')); console.log(); console.log( - '---------------------------------- all.json ----------------------------------', + '------------------------------------------------ all.json ------------------------------------------------', ); const allConfig: LinterConfig = { extends: './configs/base.json', @@ -133,12 +150,16 @@ writeConfig(allConfig, path.resolve(__dirname, '../src/configs/all.json')); console.log(); console.log( - '------------------------------ recommended.json ------------------------------', + '------------------------------ recommended.json (should not require program) ------------------------------', ); const recommendedRules = ruleEntries .filter(entry => !!entry[1].meta.docs.recommended) .reduce( - (config, entry) => reducer(config, entry, { filterDeprecated: false }), + (config, entry) => + reducer(config, entry, { + filterDeprecated: false, + filterRequiresTypeChecking: 'exclude', + }), {}, ); BASE_RULES_THAT_ARE_RECOMMENDED.forEach(ruleName => { @@ -152,3 +173,32 @@ writeConfig( recommendedConfig, path.resolve(__dirname, '../src/configs/recommended.json'), ); + +console.log(); +console.log( + '--------------------------------- recommended-requiring-type-checking.json ---------------------------------', +); +const recommendedRulesRequiringProgram = ruleEntries + .filter(entry => !!entry[1].meta.docs.recommended) + .reduce( + (config, entry) => + reducer(config, entry, { + filterDeprecated: false, + filterRequiresTypeChecking: 'include', + }), + {}, + ); +BASE_RULES_THAT_ARE_RECOMMENDED.forEach(ruleName => { + recommendedRulesRequiringProgram[ruleName] = 'error'; +}); +const recommendedRequiringTypeCheckingConfig: LinterConfig = { + extends: './configs/base.json', + rules: recommendedRulesRequiringProgram, +}; +writeConfig( + recommendedRequiringTypeCheckingConfig, + path.resolve( + __dirname, + '../src/configs/recommended-requiring-type-checking.json', + ), +); diff --git a/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts index ae2561431127..28f0c7b21a50 100644 --- a/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts +++ b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommended.ts @@ -10,7 +10,11 @@ function checkConfigRecommended(): boolean { const recommendedNames = new Set(Object.keys(recommended)); return Object.entries(rules).reduce((acc, [ruleName, rule]) => { - if (!rule.meta.deprecated && rule.meta.docs.recommended !== false) { + if ( + !rule.meta.deprecated && + rule.meta.docs.recommended !== false && + rule.meta.docs.requiresTypeChecking !== true + ) { const prefixed = `${prefix}${ruleName}` as keyof typeof recommended; if (recommendedNames.has(prefixed)) { if (recommended[prefixed] !== rule.meta.docs.recommended) { diff --git a/packages/eslint-plugin/tools/validate-configs/checkConfigRecommendedRequiringTypeChecking.ts b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommendedRequiringTypeChecking.ts new file mode 100644 index 000000000000..a63f5e42c236 --- /dev/null +++ b/packages/eslint-plugin/tools/validate-configs/checkConfigRecommendedRequiringTypeChecking.ts @@ -0,0 +1,45 @@ +import plugin from '../../src/index'; +import { logRule } from '../log'; + +const prefix = '@typescript-eslint/'; + +function checkConfigRecommendedRequiringTypeChecking(): boolean { + const { rules } = plugin; + + const recommendedRequiringTypeChecking = + plugin.configs['recommended-requiring-type-checking'].rules; + const recommendedNames = new Set( + Object.keys(recommendedRequiringTypeChecking), + ); + + return Object.entries(rules).reduce((acc, [ruleName, rule]) => { + if ( + !rule.meta.deprecated && + rule.meta.docs.recommended !== false && + rule.meta.docs.requiresTypeChecking === true + ) { + const prefixed = `${prefix}${ruleName}` as keyof typeof recommendedRequiringTypeChecking; + if (recommendedNames.has(prefixed)) { + if ( + recommendedRequiringTypeChecking[prefixed] !== + rule.meta.docs.recommended + ) { + logRule( + false, + ruleName, + 'incorrect setting compared to the rule meta.', + ); + return true; + } + } else { + logRule(false, ruleName, 'missing in the config.'); + return true; + } + } + + logRule(true, ruleName); + return acc; + }, false); +} + +export { checkConfigRecommendedRequiringTypeChecking }; diff --git a/packages/eslint-plugin/tools/validate-configs/index.ts b/packages/eslint-plugin/tools/validate-configs/index.ts index cb64df536481..1c05196a677e 100644 --- a/packages/eslint-plugin/tools/validate-configs/index.ts +++ b/packages/eslint-plugin/tools/validate-configs/index.ts @@ -1,11 +1,17 @@ import chalk from 'chalk'; import { checkConfigRecommended } from './checkConfigRecommended'; +import { checkConfigRecommendedRequiringTypeChecking } from './checkConfigRecommendedRequiringTypeChecking'; import { checkConfigAll } from './checkConfigAll'; let hasErrors = false; console.log(chalk.underline('Checking config "recommended"')); hasErrors = checkConfigRecommended() || hasErrors; +console.log( + chalk.underline('Checking config "recommended-requiring-type-checking"'), +); +hasErrors = checkConfigRecommendedRequiringTypeChecking() || hasErrors; + console.log(); console.log(chalk.underline('Checking config "all"')); hasErrors = checkConfigAll() || hasErrors; diff --git a/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts index c3e712ca525f..b85172d0fdc4 100644 --- a/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts +++ b/packages/eslint-plugin/tools/validate-docs/validate-table-rules.ts @@ -105,7 +105,31 @@ function validateTableRules( const ruleFileContents = fs.readFileSync( path.resolve(__dirname, `../../src/rules/${ruleName}.ts`), ); + const usesTypeInformation = ruleFileContents.includes('getParserServices'); + const tableRowHasThoughtBalloon = !!rowNeedsTypeInfo; + if (rule.meta.docs.requiresTypeChecking === true) { + if (!usesTypeInformation) { + errors.push( + 'Rule has `requiresTypeChecking` set in its meta, but it does not actually use type information - fix by removing `meta.docs.requiresTypeChecking`', + ); + } else if (!tableRowHasThoughtBalloon) { + errors.push( + 'Rule was documented as not using type information, when it actually does - fix by updating the plugin README.md', + ); + } + } else { + if (usesTypeInformation) { + errors.push( + 'Rule does not have `requiresTypeChecking` set in its meta, despite using type information - fix by setting `meta.docs.requiresTypeChecking: true` in the rule', + ); + } else if (tableRowHasThoughtBalloon) { + errors.push( + `Rule was documented as using type information, when it actually doesn't - fix by updating the plugin README.md`, + ); + } + } + validateTableBoolean( usesTypeInformation, rowNeedsTypeInfo, diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index 89ac7b532885..75acea5988ce 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -32,6 +32,11 @@ interface RuleMetaDataDocs { * The URL of the rule's docs */ url: string; + /** + * Does the rule require us to create a full TypeScript Program in order for it + * to type-check code. This is only used for documentation purposes. + */ + requiresTypeChecking?: boolean; } interface RuleMetaData { /** diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml index 5d10d7661774..74bfb63dab22 100644 --- a/tests/integration/docker-compose.yml +++ b/tests/integration/docker-compose.yml @@ -36,3 +36,20 @@ services: - /usr/eslint-plugin/tests # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. - ./fixtures/vue-sfc:/usr/linked + + recommended-does-not-require-program: + build: ./fixtures/recommended-does-not-require-program + container_name: "recommended-does-not-require-program" + volumes: + # Runtime link to the relevant built @typescript-eslint packages and integration test utils, + # but apply an empty volume for the package tests, we don't need those. + - ../../package.json/:/usr/root-package.json + - ./utils/:/usr/utils + - ../../packages/parser/:/usr/parser + - /usr/parser/tests + - ../../packages/typescript-estree/:/usr/typescript-estree + - /usr/typescript-estree/tests + - ../../packages/eslint-plugin/:/usr/eslint-plugin + - /usr/eslint-plugin/tests + # Runtime link to all the specific integration test files, so that most updates don't require a rebuild. + - ./fixtures/recommended-does-not-require-program:/usr/linked diff --git a/tests/integration/fixtures/recommended-does-not-require-program/.eslintrc.yml b/tests/integration/fixtures/recommended-does-not-require-program/.eslintrc.yml new file mode 100644 index 000000000000..75de006c68de --- /dev/null +++ b/tests/integration/fixtures/recommended-does-not-require-program/.eslintrc.yml @@ -0,0 +1,17 @@ +# This integration test exists to make sure that the recommended config does +# not require a program to be specified to ensure a fast and simple initial +# setup. Users can add on one of our other configs if they want to opt in to +# more expensive checks. +root: true + +# Local version of @typescript-eslint/parser +parser: '@typescript-eslint/parser' + +extends: +- 'eslint:recommended' +- 'plugin:@typescript-eslint/eslint-recommended' +- 'plugin:@typescript-eslint/recommended' + +plugins: +# Local version of @typescript-eslint/eslint-plugin +- '@typescript-eslint' diff --git a/tests/integration/fixtures/recommended-does-not-require-program/Dockerfile b/tests/integration/fixtures/recommended-does-not-require-program/Dockerfile new file mode 100644 index 000000000000..3b281e624c87 --- /dev/null +++ b/tests/integration/fixtures/recommended-does-not-require-program/Dockerfile @@ -0,0 +1,17 @@ +FROM node:carbon + +# Copy the test.sh into the container. Every other file will be linked, rather +# than copied to allow for changes without rebuilds wherever possible +WORKDIR /usr +COPY ./test.sh /usr/ + +# Create file which will be executed by jest +# to assert that the lint output is what we expect +RUN echo "const actualLintOutput = require('./lint-output.json');\n" \ + "\n" \ + "test('it should produce the expected lint ouput', () => {\n" \ + " expect(actualLintOutput).toMatchSnapshot();\n" \ + "});\n" > test.js + +# Run the integration test +CMD [ "./test.sh" ] diff --git a/tests/integration/fixtures/recommended-does-not-require-program/index.ts b/tests/integration/fixtures/recommended-does-not-require-program/index.ts new file mode 100644 index 000000000000..838b04b94755 --- /dev/null +++ b/tests/integration/fixtures/recommended-does-not-require-program/index.ts @@ -0,0 +1 @@ +var foo = true diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap new file mode 100644 index 000000000000..36d059733d53 --- /dev/null +++ b/tests/integration/fixtures/recommended-does-not-require-program/test.js.snap @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`it should produce the expected lint ouput 1`] = ` +Array [ + Object { + "errorCount": 1, + "filePath": "/usr/linked/index.ts", + "fixableErrorCount": 1, + "fixableWarningCount": 0, + "messages": Array [ + Object { + "column": 1, + "endColumn": 15, + "endLine": 1, + "fix": Object { + "range": Array [ + 0, + 3, + ], + "text": "let", + }, + "line": 1, + "message": "Unexpected var, use let or const instead.", + "nodeType": "VariableDeclaration", + "ruleId": "no-var", + "severity": 2, + }, + Object { + "column": 5, + "endColumn": 8, + "endLine": 1, + "line": 1, + "message": "'foo' is assigned a value but never used.", + "nodeType": "Identifier", + "ruleId": "@typescript-eslint/no-unused-vars", + "severity": 1, + }, + ], + "source": "var foo = true +", + "warningCount": 1, + }, +] +`; diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.sh b/tests/integration/fixtures/recommended-does-not-require-program/test.sh new file mode 100755 index 000000000000..1fa77f5cbdf7 --- /dev/null +++ b/tests/integration/fixtures/recommended-does-not-require-program/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Generate the package.json to use +node /usr/utils/generate-package-json.js + +# Install dependencies +npm install + +# Use the local volumes for our own packages +npm install $(npm pack /usr/typescript-estree | tail -1) +npm install $(npm pack /usr/parser | tail -1) +npm install $(npm pack /usr/eslint-plugin | tail -1) + +# Run the linting +# (the "|| true" helps make sure that we run our tests on failed linting runs as well) +npx eslint --format json --output-file /usr/lint-output.json --config /usr/linked/.eslintrc.yml /usr/linked/**/*.ts || true + +# Run our assertions against the linting output +npx jest /usr/test.js --snapshotResolver=/usr/utils/jest-snapshot-resolver.js diff --git a/tests/integration/run-all-tests.sh b/tests/integration/run-all-tests.sh index 5b43af062465..4506da773492 100755 --- a/tests/integration/run-all-tests.sh +++ b/tests/integration/run-all-tests.sh @@ -9,3 +9,6 @@ docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-con # vue-sfc docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit vue-sfc + +# recommended-does-not-require-program +docker-compose -f tests/integration/docker-compose.yml up --build --abort-on-container-exit recommended-does-not-require-program From 0c4f474ccba2fd329cb43ae2309e786b51889a81 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 13 Aug 2019 12:52:28 -0700 Subject: [PATCH 36/38] feat(eslint-plugin): [interface-name-prefix, class-name-casing] Add allowUnderscorePrefix option to support private declarations (#790) --- .../docs/rules/class-name-casing.md | 16 +++ .../docs/rules/interface-name-prefix.md | 85 +++++++++++-- .../src/rules/class-name-casing.ts | 32 ++++- .../src/rules/interface-name-prefix.ts | 113 ++++++++++++++++-- .../tests/rules/class-name-casing.test.ts | 18 +++ .../tests/rules/interface-name-prefix.test.ts | 63 +++++++++- 6 files changed, 302 insertions(+), 25 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/class-name-casing.md b/packages/eslint-plugin/docs/rules/class-name-casing.md index a1fba58e323e..f594a9854f18 100644 --- a/packages/eslint-plugin/docs/rules/class-name-casing.md +++ b/packages/eslint-plugin/docs/rules/class-name-casing.md @@ -5,6 +5,17 @@ This rule enforces PascalCased names for classes and interfaces. ## Rule Details This rule aims to make it easy to differentiate classes from regular variables at a glance. +The `_` prefix is sometimes used to designate a private declaration, so the rule also supports a name +that might be `_Example` instead of `Example`. + +## Options + +This rule has an object option: + +- `"allowUnderscorePrefix": false`: (default) does not allow the name to have an underscore prefix +- `"allowUnderscorePrefix": true`: allows the name to optionally have an underscore prefix + +## Examples Examples of **incorrect** code for this rule: @@ -16,6 +27,8 @@ class Another_Invalid_Class_Name {} var bar = class invalidName {}; interface someInterface {} + +class _InternalClass {} ``` Examples of **correct** code for this rule: @@ -28,6 +41,9 @@ export default class {} var foo = class {}; interface SomeInterface {} + +/* eslint @typescript-eslint/class-name-casing: { "allowUnderscorePrefix": true } */ +class _InternalClass {} ``` ## When Not To Use It diff --git a/packages/eslint-plugin/docs/rules/interface-name-prefix.md b/packages/eslint-plugin/docs/rules/interface-name-prefix.md index c6d907568a17..309dcbe4f243 100644 --- a/packages/eslint-plugin/docs/rules/interface-name-prefix.md +++ b/packages/eslint-plugin/docs/rules/interface-name-prefix.md @@ -1,22 +1,35 @@ # Require that interface names be prefixed with `I` (interface-name-prefix) -It can be hard to differentiate between classes and interfaces. -Prefixing interfaces with "I" can help telling them apart at a glance. +Interfaces often represent important software contracts, so it can be helpful to prefix their names with `I`. +The unprefixed name is then available for a class that provides a standard implementation of the interface. +Alternatively, the contributor guidelines for the TypeScript repo suggest +[never prefixing](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#names) interfaces with `I`. ## Rule Details -This rule enforces consistency of interface naming prefix conventions. +This rule enforces whether or not the `I` prefix is required for interface names. +The `_` prefix is sometimes used to designate a private declaration, so the rule also supports a private interface +that might be named `_IAnimal` instead of `IAnimal`. ## Options -This rule has a string option. +This rule has an object option: -- `"never"` (default) disallows all interfaces being prefixed with `"I"` -- `"always"` requires all interfaces be prefixed with `"I"` +- `{ "prefixWithI": "never" }`: (default) disallows all interfaces being prefixed with `"I"` or `"_I"` +- `{ "prefixWithI": "always" }`: requires all interfaces be prefixed with `"I"` (but does not allow `"_I"`) +- `{ "prefixWithI": "always", "allowUnderscorePrefix": true }`: requires all interfaces be prefixed with + either `"I"` or `"_I"` + +For backwards compatibility, this rule supports a string option instead: + +- `"never"`: Equivalent to `{ "prefixWithI": "never" }` +- `"always"`: Equivalent to `{ "prefixWithI": "always" }` + +## Examples ### never -TypeScript suggests [never prefixing](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#names) interfaces with "I". +**Configuration:** `{ "prefixWithI": "never" }` The following patterns are considered warnings: @@ -24,6 +37,14 @@ The following patterns are considered warnings: interface IAnimal { name: string; } + +interface IIguana { + name: string; +} + +interface _IAnimal { + name: string; +} ``` The following patterns are not warnings: @@ -32,16 +53,30 @@ The following patterns are not warnings: interface Animal { name: string; } + +interface Iguana { + name: string; +} ``` ### always +**Configuration:** `{ "prefixWithI": "always" }` + The following patterns are considered warnings: ```ts interface Animal { name: string; } + +interface Iguana { + name: string; +} + +interface _IAnimal { + name: string; +} ``` The following patterns are not warnings: @@ -50,6 +85,42 @@ The following patterns are not warnings: interface IAnimal { name: string; } + +interface IIguana { + name: string; +} +``` + +### always and allowing underscores + +**Configuration:** `{ "prefixWithI": "always", "allowUnderscorePrefix": true }` + +The following patterns are considered warnings: + +```ts +interface Animal { + name: string; +} + +interface Iguana { + name: string; +} +``` + +The following patterns are not warnings: + +```ts +interface IAnimal { + name: string; +} + +interface IIguana { + name: string; +} + +interface _IAnimal { + name: string; +} ``` ## When Not To Use It diff --git a/packages/eslint-plugin/src/rules/class-name-casing.ts b/packages/eslint-plugin/src/rules/class-name-casing.ts index cb238f87ac7b..c71a39fd2ac4 100644 --- a/packages/eslint-plugin/src/rules/class-name-casing.ts +++ b/packages/eslint-plugin/src/rules/class-name-casing.ts @@ -4,7 +4,14 @@ import { } from '@typescript-eslint/experimental-utils'; import * as util from '../util'; -export default util.createRule({ +type Options = [ + { + allowUnderscorePrefix?: boolean; + }, +]; +type MessageIds = 'notPascalCased'; + +export default util.createRule({ name: 'class-name-casing', meta: { type: 'suggestion', @@ -16,16 +23,31 @@ export default util.createRule({ messages: { notPascalCased: "{{friendlyName}} '{{name}}' must be PascalCased.", }, - schema: [], + schema: [ + { + type: 'object', + properties: { + allowUnderscorePrefix: { + type: 'boolean', + default: false, + }, + }, + additionalProperties: false, + }, + ], }, - defaultOptions: [], - create(context) { + defaultOptions: [{ allowUnderscorePrefix: false }], + create(context, [options]) { /** * Determine if the identifier name is PascalCased * @param name The identifier name */ function isPascalCase(name: string): boolean { - return /^[A-Z][0-9A-Za-z]*$/.test(name); + if (options.allowUnderscorePrefix) { + return /^_?[A-Z][0-9A-Za-z]*$/.test(name); + } else { + return /^[A-Z][0-9A-Za-z]*$/.test(name); + } } /** diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index 119765522213..13284fc2aa34 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -1,8 +1,43 @@ import * as util from '../util'; -type Options = ['never' | 'always']; +type ParsedOptions = + | { + prefixWithI: 'never'; + } + | { + prefixWithI: 'always'; + allowUnderscorePrefix: boolean; + }; +type Options = [ + + | 'never' + | 'always' + | { + prefixWithI?: 'never'; + } + | { + prefixWithI: 'always'; + allowUnderscorePrefix?: boolean; + }, +]; type MessageIds = 'noPrefix' | 'alwaysPrefix'; +/** + * Parses a given value as options. + */ +export function parseOptions([options]: Options): ParsedOptions { + if (options === 'always') { + return { prefixWithI: 'always', allowUnderscorePrefix: false }; + } + if (options !== 'never' && options.prefixWithI === 'always') { + return { + prefixWithI: 'always', + allowUnderscorePrefix: !!options.allowUnderscorePrefix, + }; + } + return { prefixWithI: 'never' }; +} + export default util.createRule({ name: 'interface-name-prefix', meta: { @@ -21,13 +56,46 @@ export default util.createRule({ }, schema: [ { - enum: ['never', 'always'], + oneOf: [ + { + enum: [ + // Deprecated, equivalent to: { prefixWithI: 'never' } + 'never', + // Deprecated, equivalent to: { prefixWithI: 'always', allowUnderscorePrefix: false } + 'always', + ], + }, + { + type: 'object', + properties: { + prefixWithI: { + type: 'string', + enum: ['never'], + }, + }, + additionalProperties: false, + }, + { + type: 'object', + properties: { + prefixWithI: { + type: 'string', + enum: ['always'], + }, + allowUnderscorePrefix: { + type: 'boolean', + }, + }, + required: ['prefixWithI'], // required to select this "oneOf" alternative + additionalProperties: false, + }, + ], }, ], }, - defaultOptions: ['never'], - create(context, [option]) { - const never = option !== 'always'; + defaultOptions: [{ prefixWithI: 'never' }], + create(context, [options]) { + const parsedOptions = parseOptions([options]); /** * Checks if a string is prefixed with "I". @@ -41,21 +109,42 @@ export default util.createRule({ return /^I[A-Z]/.test(name); } + /** + * Checks if a string is prefixed with "I" or "_I". + * @param name The string to check + */ + function isPrefixedWithIOrUnderscoreI(name: string): boolean { + if (typeof name !== 'string') { + return false; + } + + return /^_?I[A-Z]/.test(name); + } + return { TSInterfaceDeclaration(node): void { - if (never) { - if (isPrefixedWithI(node.id.name)) { + if (parsedOptions.prefixWithI === 'never') { + if (isPrefixedWithIOrUnderscoreI(node.id.name)) { context.report({ node: node.id, messageId: 'noPrefix', }); } } else { - if (!isPrefixedWithI(node.id.name)) { - context.report({ - node: node.id, - messageId: 'alwaysPrefix', - }); + if (parsedOptions.allowUnderscorePrefix) { + if (!isPrefixedWithIOrUnderscoreI(node.id.name)) { + context.report({ + node: node.id, + messageId: 'alwaysPrefix', + }); + } + } else { + if (!isPrefixedWithI(node.id.name)) { + context.report({ + node: node.id, + messageId: 'alwaysPrefix', + }); + } } } }, diff --git a/packages/eslint-plugin/tests/rules/class-name-casing.test.ts b/packages/eslint-plugin/tests/rules/class-name-casing.test.ts index af85e24472f5..7409fd927e65 100644 --- a/packages/eslint-plugin/tests/rules/class-name-casing.test.ts +++ b/packages/eslint-plugin/tests/rules/class-name-casing.test.ts @@ -14,6 +14,10 @@ ruleTester.run('class-name-casing', rule, { sourceType: 'module', }, }, + { + code: 'class _NameWithUnderscore {}', + options: [{ allowUnderscorePrefix: true }], + }, 'var Foo = class {};', 'interface SomeInterface {}', 'class ClassNameWithDigit2 {}', @@ -50,6 +54,20 @@ ruleTester.run('class-name-casing', rule, { }, ], }, + { + code: 'class _NameWithUnderscore {}', + errors: [ + { + messageId: 'notPascalCased', + data: { + friendlyName: 'Class', + name: '_NameWithUnderscore', + }, + line: 1, + column: 7, + }, + ], + }, { code: 'var foo = class {};', errors: [ diff --git a/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts b/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts index 09cf548c7ac8..337a96a368fb 100644 --- a/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts +++ b/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts @@ -1,6 +1,29 @@ -import rule from '../../src/rules/interface-name-prefix'; +import assert from 'assert'; +import rule, { parseOptions } from '../../src/rules/interface-name-prefix'; import { RuleTester } from '../RuleTester'; +describe('interface-name-prefix', () => { + it('parseOptions', () => { + assert.deepEqual(parseOptions(['never']), { prefixWithI: 'never' }); + assert.deepEqual(parseOptions(['always']), { + prefixWithI: 'always', + allowUnderscorePrefix: false, + }); + assert.deepEqual(parseOptions([{}]), { prefixWithI: 'never' }); + assert.deepEqual(parseOptions([{ prefixWithI: 'never' }]), { + prefixWithI: 'never', + }); + assert.deepEqual(parseOptions([{ prefixWithI: 'always' }]), { + prefixWithI: 'always', + allowUnderscorePrefix: false, + }); + assert.deepEqual( + parseOptions([{ prefixWithI: 'always', allowUnderscorePrefix: true }]), + { prefixWithI: 'always', allowUnderscorePrefix: true }, + ); + }); +}); + const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); @@ -22,6 +45,14 @@ interface IAnimal { }, { code: ` +interface _IAnimal { + name: string; +} + `, + options: [{ prefixWithI: 'always', allowUnderscorePrefix: true }], + }, + { + code: ` interface IIguana { name: string; } @@ -85,6 +116,21 @@ interface Animal { }, { code: ` +interface Animal { + name: string; +} + `, + options: [{ prefixWithI: 'always', allowUnderscorePrefix: true }], + errors: [ + { + messageId: 'alwaysPrefix', + line: 2, + column: 11, + }, + ], + }, + { + code: ` interface Iguana { name: string; } @@ -117,6 +163,21 @@ interface IIguana { code: ` interface IAnimal { name: string; +} + `, + options: ['never'], + errors: [ + { + messageId: 'noPrefix', + line: 2, + column: 11, + }, + ], + }, + { + code: ` +interface _IAnimal { + name: string; } `, options: ['never'], From 0cfc48e1e8a2222a542006361005aa57824c4a4f Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 13 Aug 2019 16:30:42 -0400 Subject: [PATCH 37/38] fix(typescript-estree): jsx comment parsing (#703) --- .../tests/lib/__snapshots__/comments.ts.snap | 790 ++++++++++++++++++ .../jsx-tag-comment-after-prop.src.js | 11 + .../typescript-estree/src/convert-comments.ts | 4 +- .../tests/lib/__snapshots__/comments.ts.snap | 790 ++++++++++++++++++ .../semantic-diagnostics-enabled.ts.snap | 2 + 5 files changed, 1596 insertions(+), 1 deletion(-) create mode 100644 packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js diff --git a/packages/parser/tests/lib/__snapshots__/comments.ts.snap b/packages/parser/tests/lib/__snapshots__/comments.ts.snap index d04a7d39a320..92affb66677c 100644 --- a/packages/parser/tests/lib/__snapshots__/comments.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/comments.ts.snap @@ -7282,6 +7282,796 @@ Object { } `; +exports[`Comments fixtures/jsx-tag-comment-after-prop.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "pure", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "foo", + "range": Array [ + 66, + 69, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 66, + 75, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 71, + 74, + ], + "raw": "123", + "type": "Literal", + "value": 123, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 70, + 75, + ], + "type": "JSXExpressionContainer", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 99, + 102, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 99, + 109, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 103, + 109, + ], + "raw": "\\"woof\\"", + "type": "Literal", + "value": "woof", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 39, + 42, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 38, + 118, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 38, + 118, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 123, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 125, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 125, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 125, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 125, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 51, + 57, + ], + "type": "Line", + "value": " one", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 84, + 90, + ], + "type": "Line", + "value": " two", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 127, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 66, + 69, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 71, + 74, + ], + "type": "Numeric", + "value": "123", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 99, + 102, + ], + "type": "JSXIdentifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 103, + 109, + ], + "type": "JSXText", + "value": "\\"woof\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 3, + "line": 9, + }, + }, + "range": Array [ + 122, + 123, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` Object { "body": Array [ diff --git a/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js b/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js new file mode 100644 index 000000000000..f6321a0a0c2a --- /dev/null +++ b/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js @@ -0,0 +1,11 @@ +const pure = () => { + return ( + + ); +} + diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 159c24cf3efe..d3738774cd90 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -147,7 +147,9 @@ export function convertComments( // Rescan after a JSX expression if ( container.parent && - container.parent.kind === ts.SyntaxKind.JsxExpression + container.parent.kind === ts.SyntaxKind.JsxExpression && + container.parent.parent && + container.parent.parent.kind === ts.SyntaxKind.JsxElement ) { kind = triviaScanner.reScanJsxToken(); continue; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap index e143fdb8524f..b90f5eb45487 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap @@ -7282,6 +7282,796 @@ Object { } `; +exports[`Comments fixtures/jsx-tag-comment-after-prop.src 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "pure", + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + }, + "init": Object { + "async": false, + "body": Object { + "body": Array [ + Object { + "argument": Object { + "children": Array [], + "closingElement": null, + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "openingElement": Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "name": "foo", + "range": Array [ + 66, + 69, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 66, + 75, + ], + "type": "JSXAttribute", + "value": Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 71, + 74, + ], + "raw": "123", + "type": "Literal", + "value": 123, + }, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 70, + 75, + ], + "type": "JSXExpressionContainer", + }, + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "name": "bar", + "range": Array [ + 99, + 102, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 99, + 109, + ], + "type": "JSXAttribute", + "value": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 103, + 109, + ], + "raw": "\\"woof\\"", + "type": "Literal", + "value": "woof", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "name": "Foo", + "range": Array [ + 39, + 42, + ], + "type": "JSXIdentifier", + }, + "range": Array [ + 38, + 118, + ], + "selfClosing": true, + "type": "JSXOpeningElement", + }, + "range": Array [ + 38, + 118, + ], + "type": "JSXElement", + }, + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 123, + ], + "type": "ReturnStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 125, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 13, + 125, + ], + "type": "ArrowFunctionExpression", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 125, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "const", + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 125, + ], + "type": "VariableDeclaration", + }, + ], + "comments": Array [ + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 4, + }, + "start": Object { + "column": 8, + "line": 4, + }, + }, + "range": Array [ + 51, + 57, + ], + "type": "Line", + "value": " one", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 6, + }, + "start": Object { + "column": 8, + "line": 6, + }, + }, + "range": Array [ + 84, + 90, + ], + "type": "Line", + "value": " two", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 127, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "const", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 10, + ], + "type": "Identifier", + "value": "pure", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 18, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 23, + 29, + ], + "type": "Keyword", + "value": "return", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 3, + }, + "start": Object { + "column": 6, + "line": 3, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 3, + }, + "start": Object { + "column": 7, + "line": 3, + }, + }, + "range": Array [ + 39, + 42, + ], + "type": "JSXIdentifier", + "value": "Foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 5, + }, + "start": Object { + "column": 8, + "line": 5, + }, + }, + "range": Array [ + 66, + 69, + ], + "type": "JSXIdentifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "start": Object { + "column": 11, + "line": 5, + }, + }, + "range": Array [ + 69, + 70, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 5, + }, + "start": Object { + "column": 12, + "line": 5, + }, + }, + "range": Array [ + 70, + 71, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 5, + }, + "start": Object { + "column": 13, + "line": 5, + }, + }, + "range": Array [ + 71, + 74, + ], + "type": "Numeric", + "value": "123", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "start": Object { + "column": 16, + "line": 5, + }, + }, + "range": Array [ + 74, + 75, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 7, + }, + "start": Object { + "column": 8, + "line": 7, + }, + }, + "range": Array [ + 99, + 102, + ], + "type": "JSXIdentifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 7, + }, + "start": Object { + "column": 11, + "line": 7, + }, + }, + "range": Array [ + 102, + 103, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 7, + }, + "start": Object { + "column": 12, + "line": 7, + }, + }, + "range": Array [ + 103, + 109, + ], + "type": "JSXText", + "value": "\\"woof\\"", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 8, + }, + "start": Object { + "column": 6, + "line": 8, + }, + }, + "range": Array [ + 116, + 117, + ], + "type": "Punctuator", + "value": "/", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 8, + }, + "start": Object { + "column": 7, + "line": 8, + }, + }, + "range": Array [ + 117, + 118, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "range": Array [ + 121, + 122, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 9, + }, + "start": Object { + "column": 3, + "line": 9, + }, + }, + "range": Array [ + 122, + 123, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; + exports[`Comments fixtures/jsx-tag-comments.src 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 7af41c0f3025..b4f79cd04d1f 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -18,6 +18,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-generic-with-comment-in-tag.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comment-after-prop.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-multiline-non-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; From 05ba26879dd5a5a0e1159951c8b24dc5e0e5cc4a Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 13 Aug 2019 21:31:17 +0000 Subject: [PATCH 38/38] chore: publish v2.0.0 --- CHANGELOG.md | 66 ++++++++++++++++++++++ lerna.json | 2 +- packages/eslint-plugin-tslint/CHANGELOG.md | 22 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +- packages/eslint-plugin/CHANGELOG.md | 62 ++++++++++++++++++++ packages/eslint-plugin/package.json | 4 +- packages/experimental-utils/CHANGELOG.md | 30 ++++++++++ packages/experimental-utils/package.json | 4 +- packages/parser/CHANGELOG.md | 28 +++++++++ packages/parser/package.json | 8 +-- packages/shared-fixtures/CHANGELOG.md | 12 ++++ packages/shared-fixtures/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 30 ++++++++++ packages/typescript-estree/package.json | 4 +- 14 files changed, 265 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff90c01198b3..306e15820217 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,72 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) +* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) +* feat(eslint-plugin)!: [array-type] rework options (#654) ([1389393](https://github.com/typescript-eslint/typescript-eslint/commit/1389393)), closes [#654](https://github.com/typescript-eslint/typescript-eslint/issues/654) [#635](https://github.com/typescript-eslint/typescript-eslint/issues/635) + + +### Bug Fixes + +* **eslint-plugin:** [efrt] flag default export w/allowExpressions ([#831](https://github.com/typescript-eslint/typescript-eslint/issues/831)) ([ebbcc01](https://github.com/typescript-eslint/typescript-eslint/commit/ebbcc01)) +* **eslint-plugin:** [no-explicit-any] Fix ignoreRestArgs for interfaces ([#777](https://github.com/typescript-eslint/typescript-eslint/issues/777)) ([22e9ae5](https://github.com/typescript-eslint/typescript-eslint/commit/22e9ae5)) +* **eslint-plugin:** [no-useless-constructor] handle bodyless constructor ([#685](https://github.com/typescript-eslint/typescript-eslint/issues/685)) ([55e788c](https://github.com/typescript-eslint/typescript-eslint/commit/55e788c)) +* **eslint-plugin:** [prefer-readonly] TypeError when having comp… ([#761](https://github.com/typescript-eslint/typescript-eslint/issues/761)) ([211b1b5](https://github.com/typescript-eslint/typescript-eslint/commit/211b1b5)) +* **eslint-plugin:** [typedef] support "for..in", "for..of" ([#787](https://github.com/typescript-eslint/typescript-eslint/issues/787)) ([39e41b5](https://github.com/typescript-eslint/typescript-eslint/commit/39e41b5)) +* **eslint-plugin:** [typedef] support default value for parameter ([#785](https://github.com/typescript-eslint/typescript-eslint/issues/785)) ([84916e6](https://github.com/typescript-eslint/typescript-eslint/commit/84916e6)) +* **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1)) +* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) +* **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) +* **eslint-plugin:** [interface-name-prefix, class-name-casing] Add allowUnderscorePrefix option to support private declarations ([#790](https://github.com/typescript-eslint/typescript-eslint/issues/790)) ([0c4f474](https://github.com/typescript-eslint/typescript-eslint/commit/0c4f474)) +* **eslint-plugin:** [no-var-requires] report on foo(require('')) ([#725](https://github.com/typescript-eslint/typescript-eslint/issues/725)) ([b2ca20d](https://github.com/typescript-eslint/typescript-eslint/commit/b2ca20d)), closes [#665](https://github.com/typescript-eslint/typescript-eslint/issues/665) +* **eslint-plugin:** [promise-function-async] make allowAny default true ([#733](https://github.com/typescript-eslint/typescript-eslint/issues/733)) ([590ca50](https://github.com/typescript-eslint/typescript-eslint/commit/590ca50)) +* **eslint-plugin:** [strict-boolean-expressions] add ignoreRhs option ([#691](https://github.com/typescript-eslint/typescript-eslint/issues/691)) ([fd6be42](https://github.com/typescript-eslint/typescript-eslint/commit/fd6be42)) +* **eslint-plugin:** add support for object props in CallExpressions ([#728](https://github.com/typescript-eslint/typescript-eslint/issues/728)) ([8141f01](https://github.com/typescript-eslint/typescript-eslint/commit/8141f01)) +* **eslint-plugin:** added new rule typedef ([#581](https://github.com/typescript-eslint/typescript-eslint/issues/581)) ([35cc99b](https://github.com/typescript-eslint/typescript-eslint/commit/35cc99b)) +* **eslint-plugin:** added new rule use-default-type-parameter ([#562](https://github.com/typescript-eslint/typescript-eslint/issues/562)) ([2b942ba](https://github.com/typescript-eslint/typescript-eslint/commit/2b942ba)) +* **eslint-plugin:** move opinionated rules between configs ([#595](https://github.com/typescript-eslint/typescript-eslint/issues/595)) ([4893aec](https://github.com/typescript-eslint/typescript-eslint/commit/4893aec)) +* **eslint-plugin:** remove deprecated rules ([#739](https://github.com/typescript-eslint/typescript-eslint/issues/739)) ([e32c7ad](https://github.com/typescript-eslint/typescript-eslint/commit/e32c7ad)) + + +### BREAKING CHANGES + +* removed some rules from recommended config +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +* **eslint-plugin:** both 'eslint-recommended' and 'recommended' have changed. +* **eslint-plugin:** removing rules +* changes config structure + +```ts +type ArrayOption = 'array' | 'generic' | 'array-simple'; +type Options = [ + { + // default case for all arrays + default: ArrayOption, + // optional override for readonly arrays + readonly?: ArrayOption, + }, +]; +``` +* **eslint-plugin:** changing default rule config +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) diff --git a/lerna.json b/lerna.json index b700c7342eb2..e4b8a9078807 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.13.0", + "version": "2.0.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index fc36ec031752..1339f31787c9 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) + + +### BREAKING CHANGES + +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index bf40809b2db4..a35949dc244b 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "1.13.0", + "version": "2.0.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -31,7 +31,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "1.13.0", + "@typescript-eslint/experimental-utils": "2.0.0", "lodash.memoize": "^4.1.2" }, "peerDependencies": { @@ -41,6 +41,6 @@ }, "devDependencies": { "@types/lodash.memoize": "^4.1.4", - "@typescript-eslint/parser": "1.13.0" + "@typescript-eslint/parser": "2.0.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index b7ff8b2d6ac6..ac4b1f894c4d 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,68 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +### Bug Fixes + +* **eslint-plugin:** [efrt] flag default export w/allowExpressions ([#831](https://github.com/typescript-eslint/typescript-eslint/issues/831)) ([ebbcc01](https://github.com/typescript-eslint/typescript-eslint/commit/ebbcc01)) +* **eslint-plugin:** [no-explicit-any] Fix ignoreRestArgs for interfaces ([#777](https://github.com/typescript-eslint/typescript-eslint/issues/777)) ([22e9ae5](https://github.com/typescript-eslint/typescript-eslint/commit/22e9ae5)) +* **eslint-plugin:** [no-useless-constructor] handle bodyless constructor ([#685](https://github.com/typescript-eslint/typescript-eslint/issues/685)) ([55e788c](https://github.com/typescript-eslint/typescript-eslint/commit/55e788c)) +* **eslint-plugin:** [prefer-readonly] TypeError when having comp… ([#761](https://github.com/typescript-eslint/typescript-eslint/issues/761)) ([211b1b5](https://github.com/typescript-eslint/typescript-eslint/commit/211b1b5)) +* **eslint-plugin:** [typedef] support "for..in", "for..of" ([#787](https://github.com/typescript-eslint/typescript-eslint/issues/787)) ([39e41b5](https://github.com/typescript-eslint/typescript-eslint/commit/39e41b5)) +* **eslint-plugin:** [typedef] support default value for parameter ([#785](https://github.com/typescript-eslint/typescript-eslint/issues/785)) ([84916e6](https://github.com/typescript-eslint/typescript-eslint/commit/84916e6)) + + +* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) +* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) +* feat(eslint-plugin)!: [array-type] rework options (#654) ([1389393](https://github.com/typescript-eslint/typescript-eslint/commit/1389393)), closes [#654](https://github.com/typescript-eslint/typescript-eslint/issues/654) [#635](https://github.com/typescript-eslint/typescript-eslint/issues/635) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) +* **eslint-plugin:** [interface-name-prefix, class-name-casing] Add allowUnderscorePrefix option to support private declarations ([#790](https://github.com/typescript-eslint/typescript-eslint/issues/790)) ([0c4f474](https://github.com/typescript-eslint/typescript-eslint/commit/0c4f474)) +* **eslint-plugin:** [no-var-requires] report on foo(require('')) ([#725](https://github.com/typescript-eslint/typescript-eslint/issues/725)) ([b2ca20d](https://github.com/typescript-eslint/typescript-eslint/commit/b2ca20d)), closes [#665](https://github.com/typescript-eslint/typescript-eslint/issues/665) +* **eslint-plugin:** [promise-function-async] make allowAny default true ([#733](https://github.com/typescript-eslint/typescript-eslint/issues/733)) ([590ca50](https://github.com/typescript-eslint/typescript-eslint/commit/590ca50)) +* **eslint-plugin:** [strict-boolean-expressions] add ignoreRhs option ([#691](https://github.com/typescript-eslint/typescript-eslint/issues/691)) ([fd6be42](https://github.com/typescript-eslint/typescript-eslint/commit/fd6be42)) +* **eslint-plugin:** add support for object props in CallExpressions ([#728](https://github.com/typescript-eslint/typescript-eslint/issues/728)) ([8141f01](https://github.com/typescript-eslint/typescript-eslint/commit/8141f01)) +* **eslint-plugin:** added new rule typedef ([#581](https://github.com/typescript-eslint/typescript-eslint/issues/581)) ([35cc99b](https://github.com/typescript-eslint/typescript-eslint/commit/35cc99b)) +* **eslint-plugin:** added new rule use-default-type-parameter ([#562](https://github.com/typescript-eslint/typescript-eslint/issues/562)) ([2b942ba](https://github.com/typescript-eslint/typescript-eslint/commit/2b942ba)) +* **eslint-plugin:** move opinionated rules between configs ([#595](https://github.com/typescript-eslint/typescript-eslint/issues/595)) ([4893aec](https://github.com/typescript-eslint/typescript-eslint/commit/4893aec)) +* **eslint-plugin:** remove deprecated rules ([#739](https://github.com/typescript-eslint/typescript-eslint/issues/739)) ([e32c7ad](https://github.com/typescript-eslint/typescript-eslint/commit/e32c7ad)) + + +### BREAKING CHANGES + +* removed some rules from recommended config +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +* **eslint-plugin:** both 'eslint-recommended' and 'recommended' have changed. +* **eslint-plugin:** removing rules +* changes config structure + +```ts +type ArrayOption = 'array' | 'generic' | 'array-simple'; +type Options = [ + { + // default case for all arrays + default: ArrayOption, + // optional override for readonly arrays + readonly?: ArrayOption, + }, +]; +``` +* **eslint-plugin:** changing default rule config +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e0d1c05a9fec..b3d3734d15e2 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "1.13.0", + "version": "2.0.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -40,7 +40,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "1.13.0", + "@typescript-eslint/experimental-utils": "2.0.0", "eslint-utils": "^1.4.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^2.0.1", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 243445d33cda..8ea9fd4a22c6 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +### Bug Fixes + +* **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1)) +* **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) + + +### BREAKING CHANGES + +* removed some rules from recommended config +* recommended config changes are considered breaking +* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 4574f3129d10..c4fde675f184 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "1.13.0", + "version": "2.0.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -37,7 +37,7 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "1.13.0", + "@typescript-eslint/typescript-estree": "2.0.0", "eslint-scope": "^4.0.0" }, "peerDependencies": { diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 0b158483fcf8..23eb1182e2a2 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) + + +### Bug Fixes + +* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +### BREAKING CHANGES + +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index bc3f3cf29b07..4d67b9a555e5 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "1.13.0", + "version": "2.0.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/parser.js", "files": [ @@ -42,13 +42,13 @@ }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "1.13.0", - "@typescript-eslint/typescript-estree": "1.13.0", + "@typescript-eslint/experimental-utils": "2.0.0", + "@typescript-eslint/typescript-estree": "2.0.0", "eslint-visitor-keys": "^1.0.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "1.13.0", + "@typescript-eslint/shared-fixtures": "2.0.0", "glob": "^7.1.4" } } diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 2c796c965bbf..3aec5aabbcd5 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +### Bug Fixes + +* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index d211eed6e38a..0fedd2edbe95 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "1.13.0", + "version": "2.0.0", "private": true } diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 2267143f5c7a..27a2f9ea6a3c 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) + + +* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) +* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) + + +### Bug Fixes + +* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) + + +### Features + +* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) + + +### BREAKING CHANGES + +* recommended config changes are considered breaking +* by default we will now throw when a file is not in the `project` provided +* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +* Node 6 is no longer supported + + + + + # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index e0a0e6618820..d7c8bae66ef9 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "1.13.0", + "version": "2.0.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -53,7 +53,7 @@ "@types/lodash.isplainobject": "^4.0.4", "@types/lodash.unescape": "^4.0.4", "@types/semver": "^6.0.1", - "@typescript-eslint/shared-fixtures": "1.13.0", + "@typescript-eslint/shared-fixtures": "2.0.0", "babel-code-frame": "^6.26.0", "glob": "^7.1.4", "lodash.isplainobject": "4.0.6",