From 864c81100f754301e59272d549649bf62faa47a5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 11 Nov 2019 20:49:18 -0500 Subject: [PATCH 01/20] feat(eslint-plugin): added new rule no-dynamic-delete (#565) Co-authored-by: Josh Goldberg Co-authored-by: Brad Zacher --- packages/eslint-plugin/README.md | 1 + packages/eslint-plugin/ROADMAP.md | 3 +- .../docs/rules/no-dynamic-delete.md | 49 ++++++++ packages/eslint-plugin/src/configs/all.json | 1 + packages/eslint-plugin/src/rules/index.ts | 2 + .../src/rules/no-dynamic-delete.ts | 109 ++++++++++++++++++ .../tests/rules/no-dynamic-delete.test.ts | 105 +++++++++++++++++ 7 files changed, 269 insertions(+), 1 deletion(-) create mode 100644 packages/eslint-plugin/docs/rules/no-dynamic-delete.md create mode 100644 packages/eslint-plugin/src/rules/no-dynamic-delete.ts create mode 100644 packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index b616245454e6..75feac4ee49e 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/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-dynamic-delete`](./docs/rules/no-dynamic-delete.md) | Bans usage of the delete operator with computed key expressions | | :wrench: | | | [`@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: | | diff --git a/packages/eslint-plugin/ROADMAP.md b/packages/eslint-plugin/ROADMAP.md index 06326a5439ec..82e7737feb55 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -60,7 +60,7 @@ | [`no-duplicate-super`] | 🌟 | [`constructor-super`][constructor-super] | | [`no-duplicate-switch-case`] | 🌟 | [`no-duplicate-case`][no-duplicate-case] | | [`no-duplicate-variable`] | 🌟 | [`no-redeclare`][no-redeclare] | -| [`no-dynamic-delete`] | πŸ›‘ | N/A | +| [`no-dynamic-delete`] | βœ… | [`@typescript-eslint/no-dynamic-delete`] | | [`no-empty`] | 🌟 | [`no-empty`][no-empty] | | [`no-eval`] | 🌟 | [`no-eval`][no-eval] | | [`no-floating-promises`] | βœ… | [`@typescript-eslint/no-floating-promises`] | @@ -613,6 +613,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [`@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/no-array-constructor`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md +[`@typescript-eslint/no-dynamic-delete`]: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.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 diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md new file mode 100644 index 000000000000..630046823387 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -0,0 +1,49 @@ +# Disallow the delete operator with computed key expressions (no-dynamic-delete) + +Deleting dynamically computed keys can be dangerous and in some cases not well optimized. + +## Rule Details + +Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures. +Using `Object`s with added and removed keys can cause occasional edge case bugs, such as if a key is named `"hasOwnProperty"`. +Consider using a `Map` or `Set` if you’re storing collections of objects. + +Examples of **correct** code wth this rule: + +```ts +const container: { [i: string]: number } = { + /* ... */ +}; + +// Constant runtime lookups by string index +delete container.aaa; + +// Constants that must be accessed by [] +delete container[7]; +delete container['-Infinity']; +``` + +Examples of **incorrect** code with this rule: + +```ts +// Can be replaced with the constant equivalents, such as container.aaa +delete container['aaa']; +delete container['Infinity']; + +// Dynamic, difficult-to-reason-about lookups +const name = 'name'; +delete container[name]; +delete container[name.toUpperCase()]; +``` + +## When Not To Use It + +When you know your keys are safe to delete, this rule can be unnecessary. +Some environments such as older browsers might not support `Map` and `Set`. + +Do not consider this rule as performance advice before profiling your code's bottlenecks. +Even repeated minor performance slowdowns likely do not significantly affect your application's general perceived speed. + +## Related to + +- TSLint: [no-dynamic-delete](https://palantir.github.io/tslint/rules/no-dynamic-delete) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 395c1af592ed..c7e9a99bc765 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -26,6 +26,7 @@ "@typescript-eslint/member-ordering": "error", "no-array-constructor": "off", "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-dynamic-delete": "error", "no-empty-function": "off", "@typescript-eslint/no-empty-function": "error", "@typescript-eslint/no-empty-interface": "error", diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 4aa8beea1f63..11c774610a00 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -18,6 +18,7 @@ import memberDelimiterStyle from './member-delimiter-style'; import memberNaming from './member-naming'; import memberOrdering from './member-ordering'; import noArrayConstructor from './no-array-constructor'; +import noDynamicDelete from './no-dynamic-delete'; import noEmptyFunction from './no-empty-function'; import noEmptyInterface from './no-empty-interface'; import noExplicitAny from './no-explicit-any'; @@ -85,6 +86,7 @@ export default { 'member-naming': memberNaming, 'member-ordering': memberOrdering, 'no-array-constructor': noArrayConstructor, + 'no-dynamic-delete': noDynamicDelete, 'no-empty-function': noEmptyFunction, 'no-empty-interface': noEmptyInterface, 'no-explicit-any': noExplicitAny, diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts new file mode 100644 index 000000000000..0ee1636ea643 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -0,0 +1,109 @@ +import { + TSESTree, + AST_NODE_TYPES, + TSESLint, +} from '@typescript-eslint/experimental-utils'; +import * as tsutils from 'tsutils'; +import * as util from '../util'; + +export default util.createRule({ + name: 'no-dynamic-delete', + meta: { + docs: { + category: 'Best Practices', + description: + 'Bans usage of the delete operator with computed key expressions', + recommended: false, + }, + fixable: 'code', + messages: { + dynamicDelete: 'Do not delete dynamically computed property keys.', + }, + schema: [], + type: 'suggestion', + }, + defaultOptions: [], + create(context) { + function createFixer( + member: TSESTree.MemberExpression, + ): TSESLint.ReportFixFunction | undefined { + if ( + member.property.type === AST_NODE_TYPES.Literal && + typeof member.property.value === 'string' + ) { + return createPropertyReplacement( + member.property, + member.property.value, + ); + } + + if (member.property.type === AST_NODE_TYPES.Identifier) { + return createPropertyReplacement(member.property, member.property.name); + } + + return undefined; + } + + return { + 'UnaryExpression[operator=delete]'(node: TSESTree.UnaryExpression): void { + if ( + node.argument.type !== AST_NODE_TYPES.MemberExpression || + !node.argument.computed || + isNecessaryDynamicAccess( + diveIntoWrapperExpressions(node.argument.property), + ) + ) { + return; + } + + context.report({ + fix: createFixer(node.argument), + messageId: 'dynamicDelete', + node: node.argument.property, + }); + }, + }; + + function createPropertyReplacement( + property: TSESTree.Expression, + replacement: string, + ) { + return (fixer: TSESLint.RuleFixer): TSESLint.RuleFix => + fixer.replaceTextRange(getTokenRange(property), `.${replacement}`); + } + + function getTokenRange(property: TSESTree.Expression): [number, number] { + const sourceCode = context.getSourceCode(); + + return [ + sourceCode.getTokenBefore(property)!.range[0], + sourceCode.getTokenAfter(property)!.range[1], + ]; + } + }, +}); + +function diveIntoWrapperExpressions( + node: TSESTree.Expression, +): TSESTree.Expression { + if (node.type === AST_NODE_TYPES.UnaryExpression) { + return diveIntoWrapperExpressions(node.argument); + } + + return node; +} + +function isNecessaryDynamicAccess(property: TSESTree.Expression): boolean { + if (property.type !== AST_NODE_TYPES.Literal) { + return false; + } + + if (typeof property.value === 'number') { + return true; + } + + return ( + typeof property.value === 'string' && + !tsutils.isValidPropertyAccess(property.value) + ); +} diff --git a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts new file mode 100644 index 000000000000..e3b4e5366e8b --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts @@ -0,0 +1,105 @@ +import path from 'path'; +import rule from '../../src/rules/no-dynamic-delete'; +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-dynamic-delete', rule, { + valid: [ + `const container: { [i: string]: 0 } = {}; + delete container.aaa;`, + `const container: { [i: string]: 0 } = {}; + delete container.delete;`, + `const container: { [i: string]: 0 } = {}; + delete container[7];`, + `const container: { [i: string]: 0 } = {}; + delete container[-7];`, + `const container: { [i: string]: 0 } = {}; + delete container[+7];`, + `const container: { [i: string]: 0 } = {}; + delete container['-Infinity'];`, + `const container: { [i: string]: 0 } = {}; + delete container['+Infinity'];`, + `const value = 1; + delete value;`, + `const value = 1; + delete -value;`, + ], + invalid: [ + { + code: `const container: { [i: string]: 0 } = {}; + delete container['aaa'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.aaa;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container [ 'aaa' ] ;`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container .aaa ;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['aa' + 'b'];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['delete'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.delete;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[-Infinity];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[+Infinity];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container[NaN];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container['NaN'];`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container.NaN;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + delete container [ 'NaN' ] ;`, + errors: [{ messageId: 'dynamicDelete' }], + output: `const container: { [i: string]: 0 } = {}; + delete container .NaN ;`, + }, + { + code: `const container: { [i: string]: 0 } = {}; + const name = 'name'; + delete container[name];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + { + code: `const container: { [i: string]: 0 } = {}; + const getName = () => 'aaa'; + delete container[getName()];`, + errors: [{ messageId: 'dynamicDelete' }], + }, + ], +}); From db1aa185c91a391d4593819a22d034ae40b79198 Mon Sep 17 00:00:00 2001 From: Nimalan Date: Tue, 12 Nov 2019 07:20:53 +0530 Subject: [PATCH 02/20] fix(typescript-estree): options range loc being always true (#704) Co-authored-by: Brad Zacher --- packages/parser/src/analyze-scope.ts | 2 +- packages/parser/src/parser.ts | 4 +- packages/typescript-estree/package.json | 1 + .../typescript-estree/src/ast-converter.ts | 17 +++ packages/typescript-estree/src/parser.ts | 2 + .../src/simple-traverse.ts | 2 +- .../src/visitor-keys.ts | 0 .../tests/lib/__snapshots__/parse.ts.snap | 122 ++++++++++++++++++ packages/typescript-estree/tests/lib/parse.ts | 16 +++ .../tests/lib/visitor-keys.ts | 2 +- 10 files changed, 163 insertions(+), 5 deletions(-) rename packages/{parser => typescript-estree}/src/simple-traverse.ts (95%) rename packages/{parser => typescript-estree}/src/visitor-keys.ts (100%) rename packages/{parser => typescript-estree}/tests/lib/visitor-keys.ts (92%) diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 27e90a46565d..67d553fac465 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -7,7 +7,7 @@ import { getKeys as fallback } from 'eslint-visitor-keys'; import { ParserOptions } from './parser-options'; import { ScopeManager } from './scope/scope-manager'; -import { visitorKeys as childVisitorKeys } from './visitor-keys'; +import { visitorKeys as childVisitorKeys } from '@typescript-eslint/typescript-estree'; /** * Define the override function of `Scope#__define` for global augmentation. diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index bcb6dde759a4..46878a9cdea7 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -5,10 +5,10 @@ import { ParserServices, TSESTreeOptions, TSESTree, + simpleTraverse, + visitorKeys, } from '@typescript-eslint/typescript-estree'; import { analyzeScope } from './analyze-scope'; -import { simpleTraverse } from './simple-traverse'; -import { visitorKeys } from './visitor-keys'; type ParserOptions = TSESLint.ParserOptions; diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 85a3a2b92b10..45386970cfa2 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -40,6 +40,7 @@ }, "dependencies": { "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", "glob": "^7.1.4", "is-glob": "^4.0.1", "lodash.unescape": "4.0.1", diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index fffb9ea15cfd..270d50dde3f7 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -4,6 +4,7 @@ import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; import { Extra } from './parser-options'; import { TSESTree } from './ts-estree'; +import { simpleTraverse } from './simple-traverse'; export function astConverter( ast: SourceFile, @@ -32,6 +33,22 @@ export function astConverter( const estree = instance.convertProgram(); + /** + * Optionally remove range and loc if specified + */ + if (extra.range || extra.loc) { + simpleTraverse(estree, { + enter: node => { + if (!extra.range) { + delete node.range; + } + if (!extra.loc) { + delete node.loc; + } + }, + }); + } + /** * Optionally convert and include all tokens in the AST */ diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 141ba25cce6a..0ef765ed8b64 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -419,5 +419,7 @@ export { TSESTreeOptions, version, }; +export { simpleTraverse } from './simple-traverse'; +export { visitorKeys } from './visitor-keys'; export * from './ts-estree'; export { clearCaches } from './create-program/createWatchProgram'; diff --git a/packages/parser/src/simple-traverse.ts b/packages/typescript-estree/src/simple-traverse.ts similarity index 95% rename from packages/parser/src/simple-traverse.ts rename to packages/typescript-estree/src/simple-traverse.ts index a616f239a7b4..e21d24d0de8b 100644 --- a/packages/parser/src/simple-traverse.ts +++ b/packages/typescript-estree/src/simple-traverse.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/typescript-estree'; +import { TSESTree } from './ts-estree'; import { visitorKeys } from './visitor-keys'; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/parser/src/visitor-keys.ts b/packages/typescript-estree/src/visitor-keys.ts similarity index 100% rename from packages/parser/src/visitor-keys.ts rename to packages/typescript-estree/src/visitor-keys.ts diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap index e953f852a8e9..c09d5159cd4b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.ts.snap @@ -1,5 +1,127 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`parse() general output should not contain loc 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "name": "foo", + "range": Array [ + 4, + 7, + ], + "type": "Identifier", + }, + "init": Object { + "name": "bar", + "range": Array [ + 10, + 13, + ], + "type": "Identifier", + }, + "range": Array [ + 4, + 13, + ], + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "range": Array [ + 0, + 14, + ], + "type": "VariableDeclaration", + }, + ], + "range": Array [ + 0, + 14, + ], + "sourceType": "script", + "type": "Program", +} +`; + +exports[`parse() general output should not contain range 1`] = ` +Object { + "body": Array [ + Object { + "declarations": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "name": "foo", + "type": "Identifier", + }, + "init": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "name": "bar", + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 4, + "line": 1, + }, + }, + "type": "VariableDeclarator", + }, + ], + "kind": "let", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "VariableDeclaration", + }, + ], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "sourceType": "script", + "type": "Program", +} +`; + exports[`parse() general output tokens, comments, locs, and ranges when called with those options 1`] = ` Object { "body": Array [ diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index 53197b7a73d8..ebfb922b8392 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -37,6 +37,22 @@ describe('parse()', () => { 'output tokens, comments, locs, and ranges when called with those options', createSnapshotTestBlock(code, config), ); + + it( + 'output should not contain loc', + createSnapshotTestBlock(code, { + range: true, + loc: false, + }), + ); + + it( + 'output should not contain range', + createSnapshotTestBlock(code, { + range: false, + loc: true, + }), + ); }); describe('non string code', () => { diff --git a/packages/parser/tests/lib/visitor-keys.ts b/packages/typescript-estree/tests/lib/visitor-keys.ts similarity index 92% rename from packages/parser/tests/lib/visitor-keys.ts rename to packages/typescript-estree/tests/lib/visitor-keys.ts index fd8ab4970f9b..6d16e90d00bf 100644 --- a/packages/parser/tests/lib/visitor-keys.ts +++ b/packages/typescript-estree/tests/lib/visitor-keys.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import { AST_NODE_TYPES } from '../../src/ts-estree'; import { visitorKeys } from '../../src/visitor-keys'; //------------------------------------------------------------------------------ From c5835f332c4c63af778b4064a6c524840deb690b Mon Sep 17 00:00:00 2001 From: Eran Shabi Date: Tue, 12 Nov 2019 04:20:28 +0200 Subject: [PATCH 03/20] feat(eslint-plugin): added new rule no-untyped-public-signature (#801) Co-authored-by: Brad Zacher --- packages/eslint-plugin/README.md | 1 + .../docs/rules/no-untyped-public-signature.md | 57 +++++ packages/eslint-plugin/src/configs/all.json | 1 + packages/eslint-plugin/src/rules/index.ts | 2 + .../src/rules/no-untyped-public-signature.ts | 120 ++++++++++ .../rules/no-untyped-public-signature.test.ts | 210 ++++++++++++++++++ 6 files changed, 391 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/no-untyped-public-signature.md create mode 100644 packages/eslint-plugin/src/rules/no-untyped-public-signature.ts create mode 100644 packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 75feac4ee49e..20d3d817a218 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -182,6 +182,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@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 | :heavy_check_mark: | :wrench: | :thought_balloon: | +| [`@typescript-eslint/no-untyped-public-signature`](./docs/rules/no-untyped-public-signature.md) | Requires that all public method arguments and return type will be explicitly typed | | | | | [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | | [`@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/docs/rules/no-untyped-public-signature.md b/packages/eslint-plugin/docs/rules/no-untyped-public-signature.md new file mode 100644 index 000000000000..7ffafd5a5ae7 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-untyped-public-signature.md @@ -0,0 +1,57 @@ +# Disallow untyped public methods (no-untyped-public-signature) + +public methods are meant to be used by code outside of your class. By typing both the parameters and the return type of public methods they will be more readable and easy to use. + +## Rule Details + +This rule aims to ensure that only typed public methods are declared in the code. + +The following patterns are considered warnings: + +```ts +// untyped parameter +public foo(param1): void { +} + +// untyped parameter +public foo(param1: any): void { +} + +// untyped return type +public foo(param1: string) { +} + +// untyped return type +public foo(param1: string): any { +} +``` + +The following patterns are not warnings: + +```ts +// typed public method +public foo(param1: string): void { +} + +// untyped private method +private foo(param1) { +} +``` + +## Options + +This rule, in its default state, does not require any argument. + +### ignoredMethods + +You may pass method names you would like this rule to ignore, like so: + +```cjson +{ + "@typescript-eslint/no-untyped-public-signature": ["error", { "ignoredMethods": ["ignoredMethodName"] }] +} +``` + +## When Not To Use It + +If you don't wish to type public methods. diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index c7e9a99bc765..84c450b0723a 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -51,6 +51,7 @@ "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-arguments": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-untyped-public-signature": "error", "@typescript-eslint/no-unused-expressions": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 11c774610a00..87d02d56a3bf 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -40,6 +40,7 @@ import noUnnecessaryCondition from './no-unnecessary-condition'; import noUnnecessaryQualifier from './no-unnecessary-qualifier'; import noUnnecessaryTypeAssertion from './no-unnecessary-type-assertion'; import noUnusedVars from './no-unused-vars'; +import noUntypedPublicSignature from './no-untyped-public-signature'; import noUnusedExpressions from './no-unused-expressions'; import noUseBeforeDefine from './no-use-before-define'; import noUselessConstructor from './no-useless-constructor'; @@ -108,6 +109,7 @@ export default { 'no-unnecessary-qualifier': noUnnecessaryQualifier, 'no-unnecessary-type-arguments': useDefaultTypeParameter, 'no-unnecessary-type-assertion': noUnnecessaryTypeAssertion, + 'no-untyped-public-signature': noUntypedPublicSignature, 'no-unused-vars': noUnusedVars, 'no-unused-expressions': noUnusedExpressions, 'no-use-before-define': noUseBeforeDefine, diff --git a/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts new file mode 100644 index 000000000000..2ecb1cbd62c6 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts @@ -0,0 +1,120 @@ +import * as util from '../util'; +import { + AST_NODE_TYPES, + TSESTree, +} from '@typescript-eslint/experimental-utils'; + +type MessageIds = 'noReturnType' | 'untypedParameter'; + +type Options = [{ ignoredMethods: string[] }]; + +export default util.createRule({ + name: 'no-unused-public-signature', + meta: { + docs: { + description: + 'Requires that all public method arguments and return type will be explicitly typed', + category: 'Best Practices', + recommended: false, + }, + messages: { + noReturnType: 'Public method has no return type', + untypedParameter: 'Public method parameters should be typed', + }, + schema: [ + { + allowAdditionalProperties: false, + properties: { + ignoredMethods: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + type: 'object', + }, + ], + type: 'suggestion', + }, + defaultOptions: [{ ignoredMethods: [] }], + create(context, [options]) { + const ignoredMethods = new Set(options.ignoredMethods); + + function isPublicMethod( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ): boolean { + return node.accessibility === 'public' || !node.accessibility; + } + + function isIgnoredMethod( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ignoredMethods: Set, + ): boolean { + if ( + node.key.type === AST_NODE_TYPES.Literal && + typeof node.key.value === 'string' + ) { + return ignoredMethods.has(node.key.value); + } + if ( + node.key.type === AST_NODE_TYPES.TemplateLiteral && + node.key.expressions.length === 0 + ) { + return ignoredMethods.has(node.key.quasis[0].value.raw); + } + if (node.key.type === AST_NODE_TYPES.Identifier && !node.computed) { + return ignoredMethods.has(node.key.name); + } + + return false; + } + + function isParamTyped(node: TSESTree.Identifier): boolean { + return ( + !!node.typeAnnotation && + node.typeAnnotation.typeAnnotation.type !== AST_NODE_TYPES.TSAnyKeyword + ); + } + + function isReturnTyped( + node: TSESTree.TSTypeAnnotation | undefined, + ): boolean { + if (!node) { + return false; + } + return ( + node.typeAnnotation && + node.typeAnnotation.type !== AST_NODE_TYPES.TSAnyKeyword + ); + } + + return { + 'TSAbstractMethodDefinition, MethodDefinition'( + node: TSESTree.MethodDefinition | TSESTree.TSAbstractMethodDefinition, + ): void { + if (isPublicMethod(node) && !isIgnoredMethod(node, ignoredMethods)) { + const paramIdentifiers = node.value.params.filter( + param => param.type === AST_NODE_TYPES.Identifier, + ) as TSESTree.Identifier[]; + const identifiersHaveTypes = paramIdentifiers.every(isParamTyped); + if (!identifiersHaveTypes) { + context.report({ + node, + messageId: 'untypedParameter', + data: {}, + }); + } + + if (!isReturnTyped(node.value.returnType)) { + context.report({ + node, + messageId: 'noReturnType', + data: {}, + }); + } + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts b/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts new file mode 100644 index 000000000000..1a167d64e30d --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-untyped-public-signature.test.ts @@ -0,0 +1,210 @@ +import rule from '../../src/rules/no-untyped-public-signature'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parserOptions: { + ecmaVersion: 6, + sourceType: 'module', + ecmaFeatures: {}, + }, + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-untyped-public-signature', rule, { + valid: [ + { + code: `class A { + private a(c) { + } + }`, + }, + { + code: `class A { + private async a(c) { + } + }`, + }, + { + code: ` + class A { + public b(c: string):void { + + } + }`, + }, + { + code: ` + class A { + public b(...c):void { + + } + }`, + }, + { + code: ` + class A { + b(c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + ['b'](c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + [\`b\`](c):void { + + } + }`, + options: [{ ignoredMethods: ['b'] }], + }, + { + code: ` + class A { + b(...c):void { + + } + + d(c):void { + + } + }`, + options: [{ ignoredMethods: ['b', 'd'] }], + }, + ], + invalid: [ + //untyped parameter + { + code: `class A { + public b(c):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //untyped parameter (any) + { + code: `class A { + public b(c: any):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //implicit public method + { + code: `class A { + b(c):void { + + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //implicit async public method + { + code: `class A { + async a(c): void { + } + }`, + errors: [{ messageId: 'untypedParameter' }], + }, + //no return type + { + code: `class A { + public a(c: number) { + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + //no return type + untyped parameter + { + code: `class A { + public b(c) { + + } + }`, + errors: [ + { messageId: 'untypedParameter' }, + { messageId: 'noReturnType' }, + ], + }, + //any return type + { + code: `class A { + public b(c: number): any { + + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + //with ignored methods + { + code: `class A { + public b(c: number): any { + + } + + c() { + } + }`, + options: [{ ignoredMethods: ['c'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = 'd'; + class A { + [methodName]() { + } + }`, + options: [{ ignoredMethods: ['methodName'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + class A { + [1]() { + } + }`, + options: [{ ignoredMethods: ['1'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = 'C'; + class A { + [\`methodName\${c}\`]() { + } + }`, + options: [{ ignoredMethods: ['methodNameC', 'methodNamec'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + let c = '1'; + class A { + [(c as number)]() { + } + }`, + options: [{ ignoredMethods: ['1'] }], + errors: [{ messageId: 'noReturnType' }], + }, + { + code: ` + class A { + abstract c() { + } + }`, + errors: [{ messageId: 'noReturnType' }], + }, + ], +}); From 1bb4d6301b1c0c4e87a2e27e445150160315e896 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 12 Nov 2019 18:20:12 +0200 Subject: [PATCH 04/20] fix(eslint-plugin): [no-type-alias] handle constructor aliases (#1198) --- .../eslint-plugin/docs/rules/no-type-alias.md | 15 +++++++++++++++ .../eslint-plugin/src/rules/no-type-alias.ts | 15 +++++++++++++++ .../tests/rules/no-type-alias.test.ts | 18 ++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 46230f3d3293..496188d4c0a4 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -84,6 +84,7 @@ or more of the following you may pass an object with the options set as follows: - `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`). - `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`) +- `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`) - `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`) - `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`) - `allowTupleTypes` set to `"always"` will allow you to use type aliases with tuples (Defaults to `"never"`) @@ -248,6 +249,20 @@ type Foo = (name: string, age: number) => string | Person; type Foo = (name: string, age: number) => string & Person; ``` +### allowConstructors + +This applies to constructor types. + +The setting accepts the following values: + +- `"always"` or `"never"` to active or deactivate the feature. + +Examples of **correct** code for the `{ "allowConstructors": "always" }` option: + +```ts +type Foo = new () => void; +``` + ### allowLiterals This applies to literal types (`type Foo = { ... }`). diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index 38816b60a2fa..f10fbeaf3c9a 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -22,6 +22,7 @@ type Options = [ { allowAliases?: Values; allowCallbacks?: 'always' | 'never'; + allowConstructors?: 'always' | 'never'; allowLiterals?: Values; allowMappedTypes?: Values; allowTupleTypes?: Values; @@ -62,6 +63,9 @@ export default util.createRule({ allowCallbacks: { enum: ['always', 'never'], }, + allowConstructors: { + enum: ['always', 'never'], + }, allowLiterals: { enum: enumValues, }, @@ -80,6 +84,7 @@ export default util.createRule({ { allowAliases: 'never', allowCallbacks: 'never', + allowConstructors: 'never', allowLiterals: 'never', allowMappedTypes: 'never', allowTupleTypes: 'never', @@ -91,6 +96,7 @@ export default util.createRule({ { allowAliases, allowCallbacks, + allowConstructors, allowLiterals, allowMappedTypes, allowTupleTypes, @@ -220,6 +226,15 @@ export default util.createRule({ if (allowCallbacks === 'never') { reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); } + } else if (type.node.type === AST_NODE_TYPES.TSConstructorType) { + if (allowConstructors === 'never') { + reportError( + type.node, + type.compositionType, + isTopLevel, + 'Constructors', + ); + } } else if (type.node.type === AST_NODE_TYPES.TSTypeLiteral) { // literal object type checkAndReport(allowLiterals!, isTopLevel, type, 'Literals'); diff --git a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts index d17348af7460..d66691dd9556 100644 --- a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts @@ -439,6 +439,10 @@ type Foo = { 'type Foo = [string] & [number, number] | keyof [number, number, number];', options: [{ allowTupleTypes: 'in-unions-and-intersections' }], }, + { + code: 'type Foo = new (bar: number) => string | null;', + options: [{ allowConstructors: 'always' }], + }, ], invalid: [ { @@ -3176,5 +3180,19 @@ type Foo = { }, ], }, + { + code: 'type Foo = new (bar: number) => string | null;', + options: [{ allowConstructors: 'never' }], + errors: [ + { + messageId: 'noTypeAlias', + data: { + alias: 'constructors', + line: 1, + column: 12, + }, + }, + ], + }, ], }); From ecb3f4ec9b9f8b56896b0ad985547de0e6608381 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 12 Nov 2019 08:26:53 -0800 Subject: [PATCH 05/20] fix(eslint-plugin): disable base no-unused-expressions in all config --- packages/eslint-plugin/src/configs/all.json | 1 + packages/eslint-plugin/tools/generate-configs.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 84c450b0723a..7df63e938566 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -52,6 +52,7 @@ "@typescript-eslint/no-unnecessary-type-arguments": "error", "@typescript-eslint/no-unnecessary-type-assertion": "error", "@typescript-eslint/no-untyped-public-signature": "error", + "no-unused-expressions": "off", "@typescript-eslint/no-unused-expressions": "error", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "error", diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 664504783f0a..5e3db377d0d8 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -31,6 +31,7 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Set([ 'no-extra-parens', 'no-magic-numbers', 'quotes', + 'no-unused-expressions', 'no-unused-vars', 'no-use-before-define', 'no-useless-constructor', From ca41dcf6c0fbfc19975b18ffb5b44c0cbe8adb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Veyret?= Date: Wed, 13 Nov 2019 18:13:13 +0100 Subject: [PATCH 06/20] docs(eslint-plugin): brace-style as a replacement for one-line (#1202) --- 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 82e7737feb55..2d4e37bded7e 100644 --- a/packages/eslint-plugin/ROADMAP.md +++ b/packages/eslint-plugin/ROADMAP.md @@ -169,7 +169,7 @@ | [`number-literal-format`] | πŸ›‘ | N/A | | [`object-literal-key-quotes`] | 🌟 | [`quote-props`][quote-props] | | [`object-literal-shorthand`] | 🌟 | [`object-shorthand`][object-shorthand] | -| [`one-line`] | πŸ›‘ | N/A | +| [`one-line`] | 🌟 | [`brace-style`][brace-style] or [Prettier] | | [`one-variable-per-declaration`] | 🌟 | [`one-var`][one-var] | | [`ordered-imports`] | πŸŒ“ | [`import/order`] | | [`prefer-function-over-method`] | 🌟 | [`class-methods-use-this`][class-methods-use-this] | @@ -545,6 +545,7 @@ Relevant plugins: [`chai-expect-keywords`](https://github.com/gavinaiken/eslint- [no-undef-init]: https://eslint.org/docs/rules/no-undef-init [quote-props]: https://eslint.org/docs/rules/quote-props [object-shorthand]: https://eslint.org/docs/rules/object-shorthand +[brace-style]: https://eslint.org/docs/rules/brace-style [one-var]: https://eslint.org/docs/rules/one-var [class-methods-use-this]: https://eslint.org/docs/rules/class-methods-use-this [prefer-template]: https://eslint.org/docs/rules/prefer-template From d8b07a7a492c9adece40c4209eab24ae77535618 Mon Sep 17 00:00:00 2001 From: Austaras Date: Thu, 14 Nov 2019 08:21:49 +0800 Subject: [PATCH 07/20] feat(eslint-plugin): add space-before-function-paren [extension] (#924) --- packages/eslint-plugin/README.md | 1 + .../docs/rules/space-before-function-paren.md | 42 ++ packages/eslint-plugin/src/configs/all.json | 2 + packages/eslint-plugin/src/rules/index.ts | 2 + .../src/rules/space-before-function-paren.ts | 180 ++++++ .../rules/space-before-function-paren.test.ts | 577 ++++++++++++++++++ .../eslint-plugin/tools/generate-configs.ts | 1 + 7 files changed, 805 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/space-before-function-paren.md create mode 100644 packages/eslint-plugin/src/rules/space-before-function-paren.ts create mode 100644 packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 20d3d817a218..9f82b851d29b 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -201,6 +201,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@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/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | enforce consistent spacing before `function` definition opening parenthesis | | :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 | :heavy_check_mark: | | | | [`@typescript-eslint/type-annotation-spacing`](./docs/rules/type-annotation-spacing.md) | Require consistent spacing around type annotations | :heavy_check_mark: | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md new file mode 100644 index 000000000000..df8d848c7b42 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -0,0 +1,42 @@ +# Require or disallow a space before function parenthesis (space-before-function-paren) + +When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example: + + +```ts +function withoutSpace (x) { + // ... +} + +function withSpace (x) { + // ... +} + +var anonymousWithoutSpace = function () {}; + +var anonymousWithSpace = function () {}; +``` + +Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required. + +## Rule Details + +This rule extends the base [eslint/func-call-spacing](https://eslint.org/docs/rules/space-before-function-paren) rule. +It supports all options and features of the base rule. +This version adds support for generic type parameters on function calls. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": ["error"] +} +``` + +## Options + +See [eslint/space-before-function-paren options](https://eslint.org/docs/rules/space-before-function-paren#options). + +Taken with ❀️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md) diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 7df63e938566..23b38b458a3b 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -77,6 +77,8 @@ "@typescript-eslint/restrict-plus-operands": "error", "semi": "off", "@typescript-eslint/semi": "error", + "space-before-function-paren": "off", + "@typescript-eslint/space-before-function-paren": "error", "@typescript-eslint/strict-boolean-expressions": "error", "@typescript-eslint/triple-slash-reference": "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 87d02d56a3bf..35f2d7582912 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -58,6 +58,7 @@ import requireArraySortCompare from './require-array-sort-compare'; import requireAwait from './require-await'; import restrictPlusOperands from './restrict-plus-operands'; import semi from './semi'; +import spaceBeforeFunctionParen from './space-before-function-paren'; import strictBooleanExpressions from './strict-boolean-expressions'; import tripleSlashReference from './triple-slash-reference'; import typeAnnotationSpacing from './type-annotation-spacing'; @@ -128,6 +129,7 @@ export default { 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, semi: semi, + 'space-before-function-paren': spaceBeforeFunctionParen, 'strict-boolean-expressions': strictBooleanExpressions, 'triple-slash-reference': tripleSlashReference, 'type-annotation-spacing': typeAnnotationSpacing, diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts new file mode 100644 index 000000000000..1def91e08f25 --- /dev/null +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -0,0 +1,180 @@ +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import { isOpeningParenToken } from 'eslint-utils'; +import * as util from '../util'; + +type Option = 'never' | 'always'; +type FuncOption = Option | 'ignore'; + +export type Options = [ + + | Option + | Partial<{ + anonymous: FuncOption; + named: FuncOption; + asyncArrow: FuncOption; + }>, +]; +export type MessageIds = 'unexpected' | 'missing'; + +export default util.createRule({ + name: 'space-before-function-paren', + meta: { + type: 'layout', + docs: { + description: + 'enforce consistent spacing before `function` definition opening parenthesis', + category: 'Stylistic Issues', + recommended: false, + }, + fixable: 'whitespace', + schema: [ + { + oneOf: [ + { + enum: ['always', 'never'], + }, + { + type: 'object', + properties: { + anonymous: { + enum: ['always', 'never', 'ignore'], + }, + named: { + enum: ['always', 'never', 'ignore'], + }, + asyncArrow: { + enum: ['always', 'never', 'ignore'], + }, + }, + additionalProperties: false, + }, + ], + }, + ], + messages: { + unexpected: 'Unexpected space before function parentheses.', + missing: 'Missing space before function parentheses.', + }, + }, + defaultOptions: ['always'], + + create(context) { + const sourceCode = context.getSourceCode(); + const baseConfig = + typeof context.options[0] === 'string' ? context.options[0] : 'always'; + const overrideConfig = + typeof context.options[0] === 'object' ? context.options[0] : {}; + + /** + * Determines whether a function has a name. + * @param {ASTNode} node The function node. + * @returns {boolean} Whether the function has a name. + */ + function isNamedFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): boolean { + if (node.id) { + return true; + } + + const parent = node.parent!; + + return ( + parent.type === 'MethodDefinition' || + (parent.type === 'Property' && + (parent.kind === 'get' || parent.kind === 'set' || parent.method)) + ); + } + + /** + * Gets the config for a given function + * @param {ASTNode} node The function node + * @returns {string} "always", "never", or "ignore" + */ + function getConfigForFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): FuncOption { + if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) { + // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar + if ( + node.async && + isOpeningParenToken(sourceCode.getFirstToken(node, { skip: 1 })!) + ) { + return overrideConfig.asyncArrow || baseConfig; + } + } else if (isNamedFunction(node)) { + return overrideConfig.named || baseConfig; + + // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + } else if (!node.generator) { + return overrideConfig.anonymous || baseConfig; + } + + return 'ignore'; + } + + /** + * Checks the parens of a function node + * @param {ASTNode} node A function node + * @returns {void} + */ + function checkFunction( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionDeclaration + | TSESTree.FunctionExpression, + ): void { + const functionConfig = getConfigForFunction(node); + + if (functionConfig === 'ignore') { + return; + } + + let leftToken: TSESTree.Token, rightToken: TSESTree.Token; + if (node.typeParameters) { + leftToken = sourceCode.getLastToken(node.typeParameters)!; + rightToken = sourceCode.getTokenAfter(leftToken)!; + } else { + rightToken = sourceCode.getFirstToken(node, isOpeningParenToken)!; + leftToken = sourceCode.getTokenBefore(rightToken)!; + } + const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); + + if (hasSpacing && functionConfig === 'never') { + context.report({ + node, + loc: leftToken.loc.end, + messageId: 'unexpected', + fix: fixer => + fixer.removeRange([leftToken.range[1], rightToken.range[0]]), + }); + } else if ( + !hasSpacing && + functionConfig === 'always' && + (!node.typeParameters || node.id) + ) { + context.report({ + node, + loc: leftToken.loc.end, + messageId: 'missing', + fix: fixer => fixer.insertTextAfter(leftToken, ' '), + }); + } + } + + return { + ArrowFunctionExpression: checkFunction, + FunctionDeclaration: checkFunction, + FunctionExpression: checkFunction, + }; + }, +}); diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts new file mode 100644 index 000000000000..7acb61fa85fa --- /dev/null +++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts @@ -0,0 +1,577 @@ +import { + TSESLint, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import rule, { + MessageIds, + Options, +} from '../../src/rules/space-before-function-paren'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('space-before-function-paren', rule, { + valid: [ + 'function foo () {}', + 'var foo = function () {}', + 'var bar = function foo () {}', + 'var obj = { get foo () {}, set foo (val) {} };', + 'type TransformFunction = (el: ASTElement, code: string) => string;', + 'var f = function () {};', + 'function foo {}> () {}', + 'async {}> () => {}', + 'async () => {}', + { + code: 'function foo {}>>() {}', + options: ['never'], + }, + { + code: 'var obj = { foo () {} };', + parserOptions: { ecmaVersion: 6 }, + }, + { code: 'function* foo () {}', parserOptions: { ecmaVersion: 6 } }, + { code: 'var foo = function *() {};', parserOptions: { ecmaVersion: 6 } }, + { code: 'function foo() {}', options: ['never'] }, + { code: 'var foo = function() {}', options: ['never'] }, + { code: 'var bar = function foo() {}', options: ['never'] }, + { + code: 'var obj = { get foo() {}, set foo(val) {} };', + options: ['never'], + }, + { + code: 'var obj = { foo() {} };', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'function* foo() {}', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'var foo = function*() {};', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + }, + + { + code: [ + 'function foo() {}', + 'var bar = function () {}', + 'function* baz() {}', + 'var bat = function*() {};', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: [ + 'function foo () {}', + 'var bar = function() {}', + 'function* baz () {}', + 'var bat = function* () {};', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'class Foo { constructor() {} *method() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'class Foo { constructor () {} *method () {} }', + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'var foo = function() {}', + options: [{ named: 'always', anonymous: 'ignore' }], + }, + { + code: 'var foo = function () {}', + options: [{ named: 'always', anonymous: 'ignore' }], + }, + { + code: 'var bar = function foo() {}', + options: [{ named: 'ignore', anonymous: 'always' }], + }, + { + code: 'var bar = function foo () {}', + options: [{ named: 'ignore', anonymous: 'always' }], + }, + + // Async arrow functions + { code: '() => 1', parserOptions: { ecmaVersion: 6 } }, + { code: 'async a => a', parserOptions: { ecmaVersion: 8 } }, + { + code: 'async a => a', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async a => a', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async () => 1', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async () => 1', + options: [{ asyncArrow: 'ignore' }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: [{ asyncArrow: 'ignore' }], + parserOptions: { ecmaVersion: 8 }, + }, + { code: 'async () => 1', parserOptions: { ecmaVersion: 8 } }, + { + code: 'async () => 1', + options: ['always'], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: 'async() => 1', + options: ['never'], + parserOptions: { ecmaVersion: 8 }, + }, + ], + + invalid: [ + { + code: 'function foo {}>() {}', + output: 'function foo {}> () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 33, + }, + ], + }, + { + code: 'function foo() {}', + output: 'function foo () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + ], + }, + { + code: 'function foo/* */() {}', + output: 'function foo /* */() {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + ], + }, + { + code: 'var foo = function() {}', + output: 'var foo = function () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo() {}', + output: 'var bar = function foo () {}', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var obj = { get foo() {}, set foo(val) {} };', + output: 'var obj = { get foo () {}, set foo (val) {} };', + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 34, + }, + ], + }, + { + code: 'var obj = { foo() {} };', + output: 'var obj = { foo () {} };', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 16, + }, + ], + }, + { + code: 'function* foo() {}', + output: 'function* foo () {}', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 14, + }, + ], + }, + + { + code: 'function foo () {}', + output: 'function foo() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 13, + }, + ], + }, + { + code: 'var foo = function () {}', + output: 'var foo = function() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo () {}', + output: 'var bar = function foo() {}', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var obj = { get foo () {}, set foo (val) {} };', + output: 'var obj = { get foo() {}, set foo(val) {} };', + options: ['never'], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 35, + }, + ], + }, + { + code: 'var obj = { foo () {} };', + output: 'var obj = { foo() {} };', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 16, + }, + ], + }, + { + code: 'function* foo () {}', + output: 'function* foo() {}', + options: ['never'], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 14, + }, + ], + }, + + { + code: [ + 'function foo () {}', + 'var bar = function() {}', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + output: [ + 'function foo() {}', + 'var bar = function () {}', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'unexpected', + line: 1, + column: 13, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 2, + column: 19, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 35, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 3, + column: 49, + }, + ], + }, + { + code: 'class Foo { constructor () {} *method () {} }', + output: 'class Foo { constructor() {} *method() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 24, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 38, + }, + ], + }, + { + code: 'var foo = { bar () {} }', + output: 'var foo = { bar() {} }', + options: [{ named: 'never', anonymous: 'always' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 16, + }, + ], + }, + { + code: [ + 'function foo() {}', + 'var bar = function () {}', + 'var obj = { get foo() {}, set foo(val) {}, bar() {} };', + ].join('\n'), + output: [ + 'function foo () {}', + 'var bar = function() {}', + 'var obj = { get foo () {}, set foo (val) {}, bar () {} };', + ].join('\n'), + options: [{ named: 'always', anonymous: 'never' }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + type: AST_NODE_TYPES.FunctionDeclaration, + messageId: 'missing', + line: 1, + column: 13, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 2, + column: 19, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 20, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 34, + }, + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 3, + column: 47, + }, + ], + }, + { + code: 'var foo = function() {}', + output: 'var foo = function () {}', + options: [{ named: 'ignore', anonymous: 'always' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var foo = function () {}', + output: 'var foo = function() {}', + options: [{ named: 'ignore', anonymous: 'never' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 19, + }, + ], + }, + { + code: 'var bar = function foo() {}', + output: 'var bar = function foo () {}', + options: [{ named: 'always', anonymous: 'ignore' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'missing', + line: 1, + column: 23, + }, + ], + }, + { + code: 'var bar = function foo () {}', + output: 'var bar = function foo() {}', + options: [{ named: 'never', anonymous: 'ignore' }], + errors: [ + { + type: AST_NODE_TYPES.FunctionExpression, + messageId: 'unexpected', + line: 1, + column: 23, + }, + ], + }, + + // Async arrow functions + { + code: 'async() => 1', + output: 'async () => 1', + options: [{ asyncArrow: 'always' }], + parserOptions: { ecmaVersion: 8 }, + errors: ['Missing space before function parentheses.'], + }, + { + code: 'async () => 1', + output: 'async() => 1', + options: [{ asyncArrow: 'never' }], + parserOptions: { ecmaVersion: 8 }, + errors: ['Unexpected space before function parentheses.'], + }, + { + code: 'async() => 1', + output: 'async () => 1', + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'missing', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: 'async() => 1', + output: 'async () => 1', + options: ['always'], + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'missing', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: 'async () => 1', + output: 'async() => 1', + options: ['never'], + parserOptions: { ecmaVersion: 8 }, + errors: [ + { + messageId: 'unexpected', + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + ] as TSESLint.InvalidTestCase[], +}); diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 5e3db377d0d8..ff6c5c63a0c2 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -37,6 +37,7 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Set([ 'no-useless-constructor', 'require-await', 'semi', + 'space-before-function-paren', ]); // 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([ From 9c8203f15854293f67dac7ea201c6a2ee527edc1 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Thu, 14 Nov 2019 19:15:39 +0200 Subject: [PATCH 08/20] fix(eslint-plugin): [camelcase] handle optional member expr (#1204) --- packages/eslint-plugin/src/rules/camelcase.ts | 42 ++++++++++++------ .../tests/rules/camelcase.test.ts | 44 +++++++++++++++++++ 2 files changed, 73 insertions(+), 13 deletions(-) diff --git a/packages/eslint-plugin/src/rules/camelcase.ts b/packages/eslint-plugin/src/rules/camelcase.ts index 4bb614cba9d7..0928484b629d 100644 --- a/packages/eslint-plugin/src/rules/camelcase.ts +++ b/packages/eslint-plugin/src/rules/camelcase.ts @@ -72,23 +72,28 @@ export default util.createRule({ * @private */ function isTSPropertyType(node: TSESTree.Node): boolean { - if (!node.parent) { - return false; - } - if (TS_PROPERTY_TYPES.includes(node.parent.type)) { + if (TS_PROPERTY_TYPES.includes(node.type)) { return true; } - if (node.parent.type === AST_NODE_TYPES.AssignmentPattern) { + if (node.type === AST_NODE_TYPES.AssignmentPattern) { return ( - node.parent.parent !== undefined && - TS_PROPERTY_TYPES.includes(node.parent.parent.type) + node.parent !== undefined && + TS_PROPERTY_TYPES.includes(node.parent.type) ); } return false; } + function report(node: TSESTree.Identifier): void { + context.report({ + node, + messageId: 'notCamelCase', + data: { name: node.name }, + }); + } + return { Identifier(node): void { /* @@ -103,13 +108,24 @@ export default util.createRule({ } // Check TypeScript specific nodes - if (isTSPropertyType(node)) { + const parent = node.parent; + if (parent && isTSPropertyType(parent)) { if (properties === 'always' && isUnderscored(name)) { - context.report({ - node, - messageId: 'notCamelCase', - data: { name: node.name }, - }); + report(node); + } + + return; + } + + if (parent && parent.type === AST_NODE_TYPES.OptionalMemberExpression) { + // Report underscored object names + if ( + properties === 'always' && + parent.object.type === AST_NODE_TYPES.Identifier && + parent.object.name === node.name && + isUnderscored(name) + ) { + report(node); } return; diff --git a/packages/eslint-plugin/tests/rules/camelcase.test.ts b/packages/eslint-plugin/tests/rules/camelcase.test.ts index e0e142c70a4b..d2d3287ce662 100644 --- a/packages/eslint-plugin/tests/rules/camelcase.test.ts +++ b/packages/eslint-plugin/tests/rules/camelcase.test.ts @@ -79,6 +79,22 @@ ruleTester.run('camelcase', rule, { code: 'abstract class Foo { abstract bar: number = 0; }', options: [{ properties: 'always' }], }, + { + code: 'const foo = foo?.baz;', + }, + { + code: 'const foo = foo?.foo_bar?.foo_bar_baz;', + }, + { + code: 'const foo = foo.bar?.foo_bar_baz;', + }, + { + code: 'const foo = (foo?.bar?.baz)?.foo_bar_baz;', + }, + { + code: 'const foo = foo_bar?.foo;', + options: [{ properties: 'never' }], + }, ], invalid: [ @@ -194,5 +210,33 @@ ruleTester.run('camelcase', rule, { }, ], }, + { + code: 'const foo = foo_bar?.foo;', + options: [{ properties: 'always' }], + errors: [ + { + messageId: 'notCamelCase', + data: { + name: 'foo_bar', + }, + line: 1, + column: 13, + }, + ], + }, + { + code: 'const foo = (foo_test?.bar)?.baz;', + options: [{ properties: 'always' }], + errors: [ + { + messageId: 'notCamelCase', + data: { + name: 'foo_test', + }, + line: 1, + column: 14, + }, + ], + }, ], }); From 259ff20dfb52281243f442bc9e3b858f41863ce7 Mon Sep 17 00:00:00 2001 From: Hidemi Yukita Date: Fri, 15 Nov 2019 03:02:18 +0900 Subject: [PATCH 09/20] feat(eslint-plugin): [no-type-alias] handle conditional types (#953) --- .../eslint-plugin/docs/rules/no-type-alias.md | 11 ++++++ .../eslint-plugin/src/rules/no-type-alias.ts | 16 +++++++++ .../tests/rules/no-type-alias.test.ts | 35 +++++++++++++++++-- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 496188d4c0a4..1927fdd54c9a 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -84,6 +84,7 @@ or more of the following you may pass an object with the options set as follows: - `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`). - `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`) +- `allowConditionalTypes` set to `"always"` will allow you to use type aliases with conditional types (Defaults to `"never"`) - `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`) - `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`) - `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`) @@ -249,6 +250,16 @@ type Foo = (name: string, age: number) => string | Person; type Foo = (name: string, age: number) => string & Person; ``` +### allowConditionalTypes + +This applies to conditional types. + +Examples of **correct** code for the `{ "allowConditionalTypes": "always" }` option: + +```ts +type Foo = T extends number ? number : null; +``` + ### allowConstructors This applies to constructor types. diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index f10fbeaf3c9a..02aca84e3151 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -22,6 +22,7 @@ type Options = [ { allowAliases?: Values; allowCallbacks?: 'always' | 'never'; + allowConditionalTypes?: 'always' | 'never'; allowConstructors?: 'always' | 'never'; allowLiterals?: Values; allowMappedTypes?: Values; @@ -63,6 +64,9 @@ export default util.createRule({ allowCallbacks: { enum: ['always', 'never'], }, + allowConditionalTypes: { + enum: ['always', 'never'], + }, allowConstructors: { enum: ['always', 'never'], }, @@ -84,6 +88,7 @@ export default util.createRule({ { allowAliases: 'never', allowCallbacks: 'never', + allowConditionalTypes: 'never', allowConstructors: 'never', allowLiterals: 'never', allowMappedTypes: 'never', @@ -96,6 +101,7 @@ export default util.createRule({ { allowAliases, allowCallbacks, + allowConditionalTypes, allowConstructors, allowLiterals, allowMappedTypes, @@ -226,6 +232,16 @@ export default util.createRule({ if (allowCallbacks === 'never') { reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); } + } else if (type.node.type === AST_NODE_TYPES.TSConditionalType) { + // conditional type + if (allowConditionalTypes === 'never') { + reportError( + type.node, + type.compositionType, + isTopLevel, + 'Conditional types', + ); + } } else if (type.node.type === AST_NODE_TYPES.TSConstructorType) { if (allowConstructors === 'never') { reportError( diff --git a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts index d66691dd9556..be5ca84b9e5b 100644 --- a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts @@ -439,6 +439,10 @@ type Foo = { 'type Foo = [string] & [number, number] | keyof [number, number, number];', options: [{ allowTupleTypes: 'in-unions-and-intersections' }], }, + { + code: 'type MyType = T extends number ? number : null;', + options: [{ allowConditionalTypes: 'always' }], + }, { code: 'type Foo = new (bar: number) => string | null;', options: [{ allowConstructors: 'always' }], @@ -3188,9 +3192,36 @@ type Foo = { messageId: 'noTypeAlias', data: { alias: 'constructors', - line: 1, - column: 12, }, + line: 1, + column: 12, + }, + ], + }, + { + code: 'type MyType = T extends number ? number : null;', + errors: [ + { + messageId: 'noTypeAlias', + data: { + alias: 'conditional types', + }, + line: 1, + column: 18, + }, + ], + }, + { + code: 'type MyType = T extends number ? number : null;', + options: [{ allowConditionalTypes: 'never' }], + errors: [ + { + messageId: 'noTypeAlias', + data: { + alias: 'conditional types', + }, + line: 1, + column: 18, }, ], }, From 4fac6c5c40b1ff171db7ff6913534d307ac5a169 Mon Sep 17 00:00:00 2001 From: Retsam Date: Thu, 14 Nov 2019 20:25:27 -0500 Subject: [PATCH 10/20] fix(eslint-plugin): [no-unnecessary-cond] fix naked type param (#1207) --- .../src/rules/no-unnecessary-condition.ts | 12 ++++++++++-- .../tests/rules/no-unnecessary-condition.test.ts | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 49c8f13401c8..8e75f7adb3fd 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -110,8 +110,16 @@ export default createRule({ function checkNode(node: TSESTree.Node): void { const type = getNodeType(node); - // Conditional is always necessary if it involves `any` or `unknown` - if (isTypeFlagSet(type, TypeFlags.Any | TypeFlags.Unknown)) { + // Conditional is always necessary if it involves: + // `any` or `unknown` or a naked type parameter + if ( + unionTypeParts(type).some(part => + isTypeFlagSet( + part, + TypeFlags.Any | TypeFlags.Unknown | ts.TypeFlags.TypeParameter, + ), + ) + ) { return; } if (isTypeFlagSet(type, TypeFlags.Never)) { diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index f298495a26f8..c5d90fd01efa 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -72,6 +72,16 @@ const t1 = (b1 && b2) ? 'yes' : 'no'`, function test(t: T) { return t ? 'yes' : 'no' }`, + ` +// Naked type param +function test(t: T) { + return t ? 'yes' : 'no' +}`, + ` +// Naked type param in union +function test(t: T | []) { + return t ? 'yes' : 'no' +}`, // Boolean expressions ` From e2008e3878f46e9fc573a518f7e7e8d0d5aedfbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Fri, 15 Nov 2019 09:27:29 +0800 Subject: [PATCH 11/20] fix(eslint-plugin): [indent] fix decorator type (#1189) --- packages/eslint-plugin/src/rules/indent.ts | 1 + .../tests/rules/indent/indent.test.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 704bc09dc65b..a8845fb6cd90 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -81,6 +81,7 @@ const KNOWN_NODES = new Set([ AST_NODE_TYPES.TSTypeParameterInstantiation, AST_NODE_TYPES.TSTypeReference, AST_NODE_TYPES.TSUnionType, + AST_NODE_TYPES.Decorator, ]); export default util.createRule({ diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts index 9fb9ef7dadd6..f49be8330058 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts @@ -1717,5 +1717,26 @@ declare module "Validation" { }, ], }, + { + code: ` + @Decorator() +class Foo {} + `, + output: ` +@Decorator() +class Foo {} + `, + errors: [ + { + messageId: 'wrongIndentation', + data: { + expected: '0 spaces', + actual: 4, + }, + line: 2, + column: 1, + }, + ], + }, ], }); From 74192f86236501a8a0c170d37af692f6c97f0830 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 15 Nov 2019 08:56:49 -0800 Subject: [PATCH 12/20] chore: bump dependencies (#1208) --- .all-contributorsrc | 63 +- CONTRIBUTORS.md | 25 +- package.json | 29 +- .../eslint-plugin/docs/rules/array-type.md | 2 +- .../docs/rules/no-floating-promises.md | 5 +- .../eslint-plugin/docs/rules/no-type-alias.md | 2 +- packages/eslint-plugin/package.json | 14 +- packages/eslint-plugin/src/rules/indent.ts | 3 +- .../src/rules/interface-name-prefix.ts | 19 +- .../src/rules/space-before-function-paren.ts | 13 +- .../src/rules/triple-slash-reference.ts | 4 +- .../tools/validate-docs/parse-readme.ts | 1 - .../eslint-plugin/typings/eslint-rules.d.ts | 16 +- .../src/eslint-utils/deepMerge.ts | 37 +- packages/experimental-utils/src/index.ts | 4 +- packages/parser/package.json | 2 +- packages/typescript-estree/package.json | 5 +- packages/typescript-estree/src/node-utils.ts | 3 +- .../src/ts-estree/ts-nodes.ts | 3 +- packages/typescript-estree/tests/lib/parse.ts | 7 +- tools/generate-contributors.ts | 24 +- yarn.lock | 966 +++++++++--------- 22 files changed, 656 insertions(+), 591 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index f44ccc64c550..bdd6f75d8c99 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -58,6 +58,13 @@ "profile": "https://github.com/j-f1", "contributions": [] }, + { + "login": "a-tarasyuk", + "name": "Alexander T.", + "avatar_url": "https://avatars0.githubusercontent.com/u/509265?v=4", + "profile": "https://github.com/a-tarasyuk", + "contributions": [] + }, { "login": "uniqueiniquity", "name": "Ben Lichtman", @@ -65,6 +72,20 @@ "profile": "https://github.com/uniqueiniquity", "contributions": [] }, + { + "login": "scottohara", + "name": "Scott O'Hara", + "avatar_url": "https://avatars3.githubusercontent.com/u/289327?v=4", + "profile": "https://github.com/scottohara", + "contributions": [] + }, + { + "login": "JoshuaKGoldberg", + "name": "Josh Goldberg", + "avatar_url": "https://avatars1.githubusercontent.com/u/3335181?v=4", + "profile": "https://github.com/JoshuaKGoldberg", + "contributions": [] + }, { "login": "kaicataldo", "name": "Kai Cataldo", @@ -86,13 +107,6 @@ "profile": "https://github.com/mysticatea", "contributions": [] }, - { - "login": "JoshuaKGoldberg", - "name": "Josh Goldberg", - "avatar_url": "https://avatars1.githubusercontent.com/u/3335181?v=4", - "profile": "https://github.com/JoshuaKGoldberg", - "contributions": [] - }, { "login": "azz", "name": "Lucas Azzola", @@ -114,13 +128,6 @@ "profile": "https://github.com/ikatyang", "contributions": [] }, - { - "login": "scottohara", - "name": "Scott O'Hara", - "avatar_url": "https://avatars3.githubusercontent.com/u/289327?v=4", - "profile": "https://github.com/scottohara", - "contributions": [] - }, { "login": "macklinu", "name": "mackie", @@ -177,6 +184,13 @@ "profile": "https://github.com/octogonz", "contributions": [] }, + { + "login": "Retsam", + "name": "Retsam", + "avatar_url": "https://avatars0.githubusercontent.com/u/2281166?v=4", + "profile": "https://github.com/Retsam", + "contributions": [] + }, { "login": "mightyiam", "name": "Shahar Dawn Or", @@ -184,13 +198,6 @@ "profile": "https://github.com/mightyiam", "contributions": [] }, - { - "login": "a-tarasyuk", - "name": "Alexander T.", - "avatar_url": "https://avatars0.githubusercontent.com/u/509265?v=4", - "profile": "https://github.com/a-tarasyuk", - "contributions": [] - }, { "login": "webschik", "name": "Denys Kniazevych", @@ -198,6 +205,20 @@ "profile": "https://github.com/webschik", "contributions": [] }, + { + "login": "Validark", + "name": "Niles", + "avatar_url": "https://avatars2.githubusercontent.com/u/15217173?v=4", + "profile": "https://github.com/Validark", + "contributions": [] + }, + { + "login": "pablobirukov", + "name": "Pavel Birukov ", + "avatar_url": "https://avatars2.githubusercontent.com/u/1861546?v=4", + "profile": "https://github.com/pablobirukov", + "contributions": [] + }, { "login": "flying-sheep", "name": "Philipp A.", diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d458acc3c542..04023618bf81 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,39 +16,42 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri Nicholas C. Zakas
Nicholas C. Zakas

Jed Fox
Jed Fox

+ Alexander T.
Alexander T.

Ben Lichtman
Ben Lichtman

- Kai Cataldo
Kai Cataldo

- Rasmus Eneman
Rasmus Eneman

+ Scott O'Hara
Scott O'Hara

- Toru Nagashima
Toru Nagashima

Josh Goldberg
Josh Goldberg

+ Kai Cataldo
Kai Cataldo

+ Rasmus Eneman
Rasmus Eneman

+ Toru Nagashima
Toru Nagashima

Lucas Azzola
Lucas Azzola

- Danny Fritz
Danny Fritz

- Ika
Ika

- Scott O'Hara
Scott O'Hara

+ Danny Fritz
Danny Fritz

+ Ika
Ika

mackie
mackie

Kanitkorn Sujautra
Kanitkorn Sujautra

Ricky Lippmann
Ricky Lippmann

- Simen Bekkhus
Simen Bekkhus

+ Simen Bekkhus
Simen Bekkhus

Gavin Barron
Gavin Barron

Kevin Partington
Kevin Partington

Lucas Duailibe
Lucas Duailibe

Pete Gonzalez
Pete Gonzalez

- Shahar Dawn Or
Shahar Dawn Or

- Alexander T.
Alexander T.

+ Retsam
Retsam

+ Shahar Dawn Or
Shahar Dawn Or

Denys Kniazevych
Denys Kniazevych

+ Niles
Niles

+ Pavel Birukov
Pavel Birukov

+ + Philipp A.
Philipp A.

Pig Fang
Pig Fang

Thomas den Hollander
Thomas den Hollander

- - Bence DΓ‘nyi
Bence DΓ‘nyi

diff --git a/package.json b/package.json index 559b4e792715..111bf02de8ba 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "cz": "git-cz", "check:docs": "lerna run check:docs", "check:configs": "lerna run check:configs", - "generate-contributors": "yarn ts-node ./tools/generate-contributors.ts && yarn all-contributors generate", + "generate-contributors": "yarn ts-node --transpile-only ./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": "./tests/integration/run-all-tests.sh", @@ -53,33 +53,32 @@ "@commitlint/cli": "^8.1.0", "@commitlint/config-conventional": "^8.1.0", "@commitlint/travis-cli": "^8.1.0", - "@types/jest": "^24.0.18", - "@types/node": "^12.7.2", - "all-contributors-cli": "^6.8.1", + "@types/jest": "^24.0.23", + "@types/node": "^12.12.7", + "all-contributors-cli": "^6.11.0", "cz-conventional-changelog": "^3.0.2", - "eslint": "^6.2.2", + "eslint": "^6.6.0", "eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-eslint-plugin": "^2.1.0", "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jest": "^22.15.2", - "glob": "^7.1.4", - "husky": "^3.0.4", + "eslint-plugin-jest": "^23.0.4", + "husky": "^3.0.9", "isomorphic-fetch": "^2.2.1", "jest": "^24.9.0", - "lerna": "^3.16.4", - "lint-staged": "^9.2.5", + "lerna": "^3.18.4", + "lint-staged": "^9.4.3", "opencollective-postinstall": "^2.0.2", - "prettier": "^1.18.2", + "prettier": "^1.19.1", "ts-jest": "^24.0.0", - "ts-node": "^8.3.0", - "tslint": "^5.19.0", - "typescript": ">=3.2.1 <3.8.0 || >3.7.0-dev.0" + "ts-node": "^8.5.0", + "tslint": "^5.20.1", + "typescript": ">=3.2.1 <3.8.0" }, "collective": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "resolutions": { - "typescript": "^3.7.0-dev.20191021" + "typescript": "^3.7.2" } } diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 275b4fbd6172..9acab2200c83 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -74,7 +74,7 @@ Incorrect code for `"array-simple"`: ```ts const a: (string | number)[] = ['a', 'b']; -const b: ({ prop: string })[] = [{ prop: 'a' }]; +const b: { prop: string }[] = [{ prop: 'a' }]; const c: (() => void)[] = [() => {}]; const d: Array = ['a', 'b']; const e: Array = ['a', 'b']; diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index f52a510b5463..9af9aebf1e62 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -31,7 +31,10 @@ await promise; async function returnsPromise() { return 'value'; } -returnsPromise().then(() => {}, () => {}); +returnsPromise().then( + () => {}, + () => {}, +); Promise.reject('value').catch(() => {}); ``` diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index 1927fdd54c9a..285837f29359 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -500,7 +500,7 @@ type Foo = [number] | [number, number]; type Foo = [number] & [number, number]; -type Foo = [number] | [number, number] & [string, string]; +type Foo = [number] | ([number, number] & [string, string]); ``` Examples of **incorrect** code for the `{ "allowTupleTypes": "in-unions" }` option: diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index b315da580591..17eb148ab351 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -30,27 +30,27 @@ "main": "dist/index.js", "scripts": { "build": "tsc -b tsconfig.build.json", - "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", + "check:docs": "../../node_modules/.bin/ts-node --files --transpile-only ./tools/validate-docs/index.ts", + "check:configs": "../../node_modules/.bin/ts-node --files --transpile-only ./tools/validate-configs/index.ts", "clean": "tsc -b tsconfig.build.json --clean", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", - "generate:configs": "../../node_modules/.bin/ts-node --files tools/generate-configs.ts", + "generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { "@typescript-eslint/experimental-utils": "2.7.0", - "eslint-utils": "^1.4.2", + "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", - "regexpp": "^2.0.1", + "regexpp": "^3.0.0", "tsutils": "^3.17.1" }, "devDependencies": { "@types/json-schema": "^7.0.3", - "@types/marked": "^0.6.5", + "@types/marked": "^0.7.1", "@types/prettier": "^1.18.2", - "chalk": "^2.4.2", + "chalk": "^3.0.0", "marked": "^0.7.0", "prettier": "*", "typescript": "*" diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index a8845fb6cd90..571767d5e002 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -239,7 +239,8 @@ export default util.createRule({ type: AST_NODE_TYPES.ObjectExpression, properties: (node.members as ( | TSESTree.TSEnumMember - | TSESTree.TypeElement)[]).map( + | TSESTree.TypeElement + )[]).map( member => TSPropertySignatureToProperty(member) as TSESTree.Property, ), diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index 13284fc2aa34..6f2c57dc3159 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -9,16 +9,15 @@ type ParsedOptions = allowUnderscorePrefix: boolean; }; type Options = [ - - | 'never' - | 'always' - | { - prefixWithI?: 'never'; - } - | { - prefixWithI: 'always'; - allowUnderscorePrefix?: boolean; - }, + | 'never' + | 'always' + | { + prefixWithI?: 'never'; + } + | { + prefixWithI: 'always'; + allowUnderscorePrefix?: boolean; + }, ]; type MessageIds = 'noPrefix' | 'alwaysPrefix'; diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index 1def91e08f25..a23865f4a17b 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -9,13 +9,12 @@ type Option = 'never' | 'always'; type FuncOption = Option | 'ignore'; export type Options = [ - - | Option - | Partial<{ - anonymous: FuncOption; - named: FuncOption; - asyncArrow: FuncOption; - }>, + | Option + | Partial<{ + anonymous: FuncOption; + named: FuncOption; + asyncArrow: FuncOption; + }>, ]; export type MessageIds = 'unexpected' | 'missing'; diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts index 8ce64e5748af..6669fe940bcb 100644 --- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts @@ -52,10 +52,10 @@ export default util.createRule({ create(context, [{ lib, path, types }]) { let programNode: TSESTree.Node; const sourceCode = context.getSourceCode(); - const references: ({ + const references: { comment: TSESTree.Comment; importName: string; - })[] = []; + }[] = []; function hasMatchingReference(source: TSESTree.Literal): void { references.forEach(reference => { diff --git a/packages/eslint-plugin/tools/validate-docs/parse-readme.ts b/packages/eslint-plugin/tools/validate-docs/parse-readme.ts index 92afaa37dd21..aace3736fcbe 100644 --- a/packages/eslint-plugin/tools/validate-docs/parse-readme.ts +++ b/packages/eslint-plugin/tools/validate-docs/parse-readme.ts @@ -9,7 +9,6 @@ function parseReadme(): marked.Tokens.Table { ); const readme = marked.lexer(readmeRaw, { gfm: true, - tables: true, silent: false, }); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index c21b235be448..8037e624c4f2 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -53,7 +53,7 @@ declare module 'eslint/lib/rules/indent' { 'wrongIndentation', [ ('tab' | number)?, - ({ + { SwitchCase?: number; VariableDeclarator?: | ElementList @@ -81,7 +81,7 @@ declare module 'eslint/lib/rules/indent' { flatTernaryExpressions?: boolean; ignoredNodes?: string[]; ignoreComments?: boolean; - })?, + }?, ], { '*:exit'(node: TSESTree.Node): void; @@ -236,7 +236,8 @@ declare module 'eslint/lib/rules/no-restricted-globals' { | { name: string; message?: string; - })[], + } + )[], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; } @@ -296,7 +297,8 @@ declare module 'eslint/lib/rules/no-unused-vars' { argsIgnorePattern?: string; caughtErrors?: 'all' | 'none'; caughtErrorsIgnorePattern?: string; - })[], + } + )[], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; } @@ -316,7 +318,8 @@ declare module 'eslint/lib/rules/no-unused-expressions' { allowShortCircuit?: boolean; allowTernary?: boolean; allowTaggedTemplates?: boolean; - })[], + } + )[], { ExpressionStatement(node: TSESTree.ExpressionStatement): void; } @@ -335,7 +338,8 @@ declare module 'eslint/lib/rules/no-use-before-define' { functions?: boolean; classes?: boolean; variables?: boolean; - })[], + } + )[], { ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; } diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/experimental-utils/src/eslint-utils/deepMerge.ts index 3db67a594078..b11083014c6c 100644 --- a/packages/experimental-utils/src/eslint-utils/deepMerge.ts +++ b/packages/experimental-utils/src/eslint-utils/deepMerge.ts @@ -25,29 +25,26 @@ export function deepMerge( // get the unique set of keys across both objects const keys = new Set(Object.keys(first).concat(Object.keys(second))); - return Array.from(keys).reduce( - (acc, key) => { - const firstHasKey = key in first; - const secondHasKey = key in second; - const firstValue = first[key]; - const secondValue = second[key]; + return Array.from(keys).reduce((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(firstValue) && isObjectNotArray(secondValue)) { - // object type - acc[key] = deepMerge(firstValue, secondValue); - } else { - // value type - acc[key] = secondValue; - } - } else if (firstHasKey) { - acc[key] = firstValue; + if (firstHasKey && secondHasKey) { + if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) { + // object type + acc[key] = deepMerge(firstValue, secondValue); } else { + // value type acc[key] = secondValue; } + } else if (firstHasKey) { + acc[key] = firstValue; + } else { + acc[key] = secondValue; + } - return acc; - }, - {} as ObjectLike, - ); + return acc; + }, {} as ObjectLike); } diff --git a/packages/experimental-utils/src/index.ts b/packages/experimental-utils/src/index.ts index 98b643c344a1..c9bde462d14b 100644 --- a/packages/experimental-utils/src/index.ts +++ b/packages/experimental-utils/src/index.ts @@ -16,6 +16,4 @@ export { AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/typescript-estree/dist/ts-estree'; -export { - ParserServices, -} from '@typescript-eslint/typescript-estree/dist/parser-options'; +export { ParserServices } from '@typescript-eslint/typescript-estree/dist/parser-options'; diff --git a/packages/parser/package.json b/packages/parser/package.json index 549dda9e82fc..0511697a88c4 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -50,6 +50,6 @@ "devDependencies": { "@types/glob": "^7.1.1", "@typescript-eslint/shared-fixtures": "2.7.0", - "glob": "^7.1.4" + "glob": "*" } } diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 45386970cfa2..ac09e4972272 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -41,7 +41,7 @@ "dependencies": { "debug": "^4.1.1", "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.4", + "glob": "^7.1.6", "is-glob": "^4.0.1", "lodash.unescape": "4.0.1", "semver": "^6.3.0", @@ -57,11 +57,10 @@ "@types/is-glob": "^4.0.1", "@types/lodash.isplainobject": "^4.0.4", "@types/lodash.unescape": "^4.0.4", - "@types/semver": "^6.0.1", + "@types/semver": "^6.2.0", "@types/tmp": "^0.1.0", "@typescript-eslint/shared-fixtures": "2.7.0", "babel-code-frame": "^6.26.0", - "glob": "^7.1.4", "lodash.isplainobject": "4.0.6", "tmp": "^0.1.0", "typescript": "*" diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index da0034ee6ae0..69e4542b106a 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -22,7 +22,8 @@ const ASSIGNMENT_OPERATORS: ts.AssignmentOperator[] = [ const LOGICAL_OPERATORS: ( | ts.LogicalOperator - | ts.SyntaxKind.QuestionQuestionToken)[] = [ + | ts.SyntaxKind.QuestionQuestionToken +)[] = [ SyntaxKind.BarBarToken, SyntaxKind.AmpersandAmpersandToken, SyntaxKind.QuestionQuestionToken, diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index b4298fa1530a..4903ed3ab8b2 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -176,4 +176,5 @@ export type TSNode = ts.Node & | ts.Bundle | ts.InputFiles | ts.UnparsedSource - | ts.JsonMinusNumericLiteral); + | ts.JsonMinusNumericLiteral + ); diff --git a/packages/typescript-estree/tests/lib/parse.ts b/packages/typescript-estree/tests/lib/parse.ts index ebfb922b8392..9f469f4405db 100644 --- a/packages/typescript-estree/tests/lib/parse.ts +++ b/packages/typescript-estree/tests/lib/parse.ts @@ -268,7 +268,7 @@ describe('parse()', () => { jsxContent ? 'with' : 'without' } JSX content - parserOptions.jsx = ${jsxSetting}`, () => { let result; - let exp = expect(() => { + const exp = expect(() => { result = parser.parseAndGenerateServices(code, { ...config, jsx: jsxSetting, @@ -276,9 +276,10 @@ describe('parse()', () => { }); }); if (!shouldThrow) { - exp = exp.not; + exp.not.toThrow(); + } else { + exp.toThrow(); } - exp.toThrow(); if (!shouldThrow) { expect(result).toMatchSnapshot(); diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index 86de07723951..8fd51a820335 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -41,7 +41,13 @@ async function* fetchUsers(page = 1): AsyncIterableIterator { const response = await fetch(`${contributorsApiUrl}&page=${page}`, { method: 'GET', }); - const contributors: Contributor[] = await response.json(); + const contributors: + | Contributor[] + | { message: string } = await response.json(); + + if (!Array.isArray(contributors)) { + throw new Error(contributors.message); + } const thresholdedContributors = contributors.filter( user => user.contributions >= COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT, @@ -81,13 +87,15 @@ async function main(): Promise { // remove ignored users .filter(u => !IGNORED_USERS.has(u.login)) // fetch the in-depth information for each user - .map(u => ({ - login: u.login, - name: u.name, - avatar_url: u.avatar_url, // eslint-disable-line @typescript-eslint/camelcase - profile: u.html_url, - contributions: [], - })); + .map(usr => { + return { + login: usr.login, + name: usr.name || usr.login, + avatar_url: usr.avatar_url, // eslint-disable-line @typescript-eslint/camelcase + profile: usr.html_url, + contributions: [], + }; + }); // build + write the .all-contributorsrc const allContributorsConfig = { diff --git a/yarn.lock b/yarn.lock index 58e28ad5ec0a..d344f2f426c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -511,15 +511,15 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@lerna/add@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.16.2.tgz#90ecc1be7051cfcec75496ce122f656295bd6e94" - integrity sha512-RAAaF8aODPogj2Ge9Wj3uxPFIBGpog9M+HwSuq03ZnkkO831AmasCTJDqV+GEpl1U2DvnhZQEwHpWmTT0uUeEw== +"@lerna/add@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.18.4.tgz#0d97c75b64febc10a9a38546a3019f0f2c24b0e6" + integrity sha512-R+9RmYrSbcmnmaFL2aB0HJtTq95ePEa0FMS4r4NnA7Xw07l5buVBPOfxv6P8kFrVvIcNpaa7S0Eo/KkbycMhKA== dependencies: "@evocateur/pacote" "^9.6.3" - "@lerna/bootstrap" "3.16.2" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" + "@lerna/bootstrap" "3.18.4" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" @@ -527,31 +527,22 @@ p-map "^2.1.0" semver "^6.2.0" -"@lerna/batch-packages@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.16.0.tgz#1c16cb697e7d718177db744cbcbdac4e30253c8c" - integrity sha512-7AdMkANpubY/FKFI01im01tlx6ygOBJ/0JcixMUWoWP/7Ds3SWQF22ID6fbBr38jUWptYLDs2fagtTDL7YUPuA== +"@lerna/bootstrap@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.18.4.tgz#b5340800358e4916e9d2ba728d266a23fdd7665c" + integrity sha512-mvqMyionPSqhbeGhoUQYEBTgbJ47LkONHfQ1AKBET0fJOjIZf6x0pWC17KvfCjsiE017325ySLKDH23z1Kb9ww== dependencies: - "@lerna/package-graph" "3.16.0" - npmlog "^4.1.2" - -"@lerna/bootstrap@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.16.2.tgz#be268d940221d3c3270656b9b791b492559ad9d8" - integrity sha512-I+gs7eh6rv9Vyd+CwqL7sftRfOOsSzCle8cv/CGlMN7/p7EAVhxEdAw8SYoHIKHzipXszuqqy1Y3opyleD0qdA== - dependencies: - "@lerna/batch-packages" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/has-npm-version" "3.16.0" - "@lerna/npm-install" "3.16.0" - "@lerna/package-graph" "3.16.0" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" + "@lerna/has-npm-version" "3.16.5" + "@lerna/npm-install" "3.16.5" + "@lerna/package-graph" "3.18.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.14.2" + "@lerna/rimraf-dir" "3.16.5" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-parallel-batches" "3.16.0" - "@lerna/symlink-binary" "3.16.2" - "@lerna/symlink-dependencies" "3.16.2" + "@lerna/run-topologically" "3.18.0" + "@lerna/symlink-binary" "3.17.0" + "@lerna/symlink-dependencies" "3.17.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^4.2.0" @@ -565,88 +556,87 @@ read-package-tree "^5.1.6" semver "^6.2.0" -"@lerna/changed@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.16.4.tgz#c3e727d01453513140eee32c94b695de577dc955" - integrity sha512-NCD7XkK744T23iW0wqKEgF4R9MYmReUbyHCZKopFnsNpQdqumc3SOIvQUAkKCP6hQJmYvxvOieoVgy/CVDpZ5g== +"@lerna/changed@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.18.4.tgz#2453ad7b3545554eaa365347a229042918b6decc" + integrity sha512-Ui4UsneDk9gCuJRfTpR5js+Ctt9Je+j+3Q4z7H7HhBn6WeWDTp6FBGJZ7SfrBCdQ47EKK27Mr95LbJ4I77xFfQ== dependencies: - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/listable" "3.16.0" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.0" + "@lerna/listable" "3.18.4" "@lerna/output" "3.13.0" - "@lerna/version" "3.16.4" -"@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== +"@lerna/check-working-tree@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz#b4f8ae61bb4523561dfb9f8f8d874dd46bb44baa" + integrity sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ== dependencies: - "@lerna/collect-uncommitted" "3.14.2" - "@lerna/describe-ref" "3.14.2" + "@lerna/collect-uncommitted" "3.16.5" + "@lerna/describe-ref" "3.16.5" "@lerna/validation-error" "3.13.0" -"@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== +"@lerna/child-process@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.16.5.tgz#38fa3c18064aa4ac0754ad80114776a7b36a69b2" + integrity sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.16.0.tgz#1c134334cacea1b1dbeacdc580e8b9240db8efa1" - integrity sha512-5P9U5Y19WmYZr7UAMGXBpY7xCRdlR7zhHy8MAPDKVx70rFIBS6nWXn5n7Kntv74g7Lm1gJ2rsiH5tj1OPcRJgg== +"@lerna/clean@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.18.4.tgz#704b345dfec4610823d6670e37f9984196d58874" + integrity sha512-puuL0sBHIv3Tvq8cdu3kCGfRpdsXuaDGIRha33GVmRPfMBi2GN8nPPysVyWmP99PfgfafO6eT5R3jqXjvASAZA== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.14.2" + "@lerna/rimraf-dir" "3.16.5" p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" -"@lerna/cli@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.13.0.tgz#3d7b357fdd7818423e9681a7b7f2abd106c8a266" - integrity sha512-HgFGlyCZbYaYrjOr3w/EsY18PdvtsTmDfpUQe8HwDjXlPeCCUgliZjXLOVBxSjiOvPeOSwvopwIHKWQmYbwywg== +"@lerna/cli@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.18.0.tgz#2b6f8605bee299c6ada65bc2e4b3ed7bf715af3a" + integrity sha512-AwDyfGx7fxJgeaZllEuyJ9LZ6Tdv9yqRD9RX762yCJu+PCAFvB9bp6OYuRSGli7QQgM0CuOYnSg4xVNOmuGKDA== dependencies: "@lerna/global-options" "3.13.0" dedent "^0.7.0" npmlog "^4.1.2" - yargs "^12.0.1" + yargs "^14.2.0" -"@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== +"@lerna/collect-uncommitted@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz#a494d61aac31cdc7aec4bbe52c96550274132e63" + integrity sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" chalk "^2.3.1" figgy-pudding "^3.5.1" npmlog "^4.1.2" -"@lerna/collect-updates@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.16.0.tgz#6db3ce8a740a4e2b972c033a63bdfb77f2553d8c" - integrity sha512-HwAIl815X2TNlmcp28zCrSdXfoZWNP7GJPEqNWYk7xDJTYLqQ+SrmKUePjb3AMGBwYAraZSEJLbHdBpJ5+cHmQ== +"@lerna/collect-updates@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.18.0.tgz#6086c64df3244993cc0a7f8fc0ddd6a0103008a6" + integrity sha512-LJMKgWsE/var1RSvpKDIxS8eJ7POADEc0HM3FQiTpEczhP6aZfv9x3wlDjaHpZm9MxJyQilqxZcasRANmRcNgw== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/describe-ref" "3.14.2" + "@lerna/child-process" "3.16.5" + "@lerna/describe-ref" "3.16.5" minimatch "^3.0.4" npmlog "^4.1.2" slash "^2.0.0" -"@lerna/command@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.16.0.tgz#ba3dba49cb5ce4d11b48269cf95becd86e30773f" - integrity sha512-u7tE4GC4/gfbPA9eQg+0ulnoJ+PMoMqomx033r/IxqZrHtmJR9+pF/37S0fsxJ2hX/RMFPC7c9Q/i8NEufSpdQ== +"@lerna/command@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.18.0.tgz#1e40399324a69d26a78969d59cf60e19b2f13fc3" + integrity sha512-JQ0TGzuZc9Ky8xtwtSLywuvmkU8X62NTUT3rMNrUykIkOxBaO+tE0O98u2yo/9BYOeTRji9IsjKZEl5i9Qt0xQ== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/package-graph" "3.16.0" - "@lerna/project" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/package-graph" "3.18.0" + "@lerna/project" "3.18.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" dedent "^0.7.0" @@ -681,14 +671,14 @@ fs-extra "^8.1.0" npmlog "^4.1.2" -"@lerna/create@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.16.0.tgz#4de841ec7d98b29bb19fb7d6ad982e65f7a150e8" - integrity sha512-OZApR1Iz7awutbmj4sAArwhqCyKgcrnw9rH0aWAUrkYWrD1w4TwkvAcYAsfx5GpQGbLQwoXhoyyPwPfZRRWz3Q== +"@lerna/create@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.18.0.tgz#78ba4af5eced661944a12b9d7da8553c096c390d" + integrity sha512-y9oS7ND5T13c+cCTJHa2Y9in02ppzyjsNynVWFuS40eIzZ3z058d9+3qSBt1nkbbQlVyfLoP6+bZPsjyzap5ig== dependencies: "@evocateur/pacote" "^9.6.3" - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.0" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" @@ -705,49 +695,51 @@ validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" -"@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== +"@lerna/describe-ref@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.16.5.tgz#a338c25aaed837d3dc70b8a72c447c5c66346ac0" + integrity sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" npmlog "^4.1.2" -"@lerna/diff@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.16.0.tgz#6d09a786f9f5b343a2fdc460eb0be08a05b420aa" - integrity sha512-QUpVs5TPl8vBIne10/vyjUxanQBQQp7Lk3iaB8MnCysKr0O+oy7trWeFVDPEkBTCD177By7yPGyW5Yey1nCBbA== +"@lerna/diff@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.18.0.tgz#9638ff4b46e2a8b0d4ebf54cf2f267ac2f8fdb29" + integrity sha512-3iLNlpurc2nV9k22w8ini2Zjm2UPo3xtQgWyqdA6eJjvge0+5AlNAWfPoV6cV+Hc1xDbJD2YDSFpZPJ1ZGilRw== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.0" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" -"@lerna/exec@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.16.0.tgz#2b6c033cee46181b6eede0eb12aad5c2c0181e89" - integrity sha512-mH3O5NXf/O88jBaBBTUf+d56CUkxpg782s3Jxy7HWbVuSUULt3iMRPTh+zEXO5/555etsIVVDDyUR76meklrJA== +"@lerna/exec@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.18.4.tgz#7f722abc3c7074dffe6aa48bca71171e0635f84a" + integrity sha512-BpBFxyCQXcfess9Nmj/OwQ9e1IhzPzNxqF5JK7dPIjko5oBn5Hm2EWVAcgUGSHKPZGLiOWPu3Wx/C92NtDBS1w== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/run-topologically" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" + "@lerna/run-topologically" "3.18.0" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" -"@lerna/filter-options@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.16.0.tgz#b1660b4480c02a5c6efa4d0cd98b9afde4ed0bba" - integrity sha512-InIi1fF8+PxpCwir9bIy+pGxrdE6hvN0enIs1eNGCVS1TTE8osNgiZXa838bMQ1yaEccdcnVX6Z03BNKd56kNg== +"@lerna/filter-options@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.18.4.tgz#f5476a7ee2169abed27ad433222e92103f56f9f1" + integrity sha512-4giVQD6tauRwweO/322LP2gfVDOVrt/xN4khkXyfkJDfcsZziFXq+668otD9KSLL8Ps+To4Fah3XbK0MoNuEvA== dependencies: - "@lerna/collect-updates" "3.16.0" - "@lerna/filter-packages" "3.16.0" + "@lerna/collect-updates" "3.18.0" + "@lerna/filter-packages" "3.18.0" dedent "^0.7.0" + figgy-pudding "^3.5.1" + npmlog "^4.1.2" -"@lerna/filter-packages@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.16.0.tgz#7d34dc8530c71016263d6f67dc65308ecf11c9fc" - integrity sha512-eGFzQTx0ogkGDCnbTuXqssryR6ilp8+dcXt6B+aq1MaqL/vOJRZyqMm4TY3CUOUnzZCi9S2WWyMw3PnAJOF+kg== +"@lerna/filter-packages@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.18.0.tgz#6a7a376d285208db03a82958cfb8172e179b4e70" + integrity sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ== dependencies: "@lerna/validation-error" "3.13.0" multimatch "^3.0.0" @@ -769,12 +761,12 @@ ssri "^6.0.1" tar "^4.4.8" -"@lerna/github-client@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.16.0.tgz#619874e461641d4f59ab1b3f1a7ba22dba88125d" - integrity sha512-IVJjcKjkYaUEPJsDyAblHGEFFNKCRyMagbIDm14L7Ab94ccN6i4TKOqAFEJn2SJHYvKKBdp3Zj2zNlASOMe3DA== +"@lerna/github-client@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.16.5.tgz#2eb0235c3bf7a7e5d92d73e09b3761ab21f35c2e" + integrity sha512-rHQdn8Dv/CJrO3VouOP66zAcJzrHsm+wFuZ4uGAai2At2NkgKH+tpNhQy2H1PSC0Ezj9LxvdaHYrUzULqVK5Hw== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@octokit/plugin-enterprise-rest" "^3.6.1" "@octokit/rest" "^16.28.4" git-url-parse "^11.1.2" @@ -794,21 +786,21 @@ resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== -"@lerna/has-npm-version@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.16.0.tgz#55764a4ce792f0c8553cf996a17f554b9e843288" - integrity sha512-TIY036dA9J8OyTrZq9J+it2DVKifL65k7hK8HhkUPpitJkw6jwbMObA/8D40LOGgWNPweJWqmlrTbRSwsR7DrQ== +"@lerna/has-npm-version@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz#ab83956f211d8923ea6afe9b979b38cc73b15326" + integrity sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" semver "^6.2.0" -"@lerna/import@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.16.0.tgz#b57cb453f4acfc60f6541fcbba10674055cb179d" - integrity sha512-trsOmGHzw0rL/f8BLNvd+9PjoTkXq2Dt4/V2UCha254hMQaYutbxcYu8iKPxz9x86jSPlH7FpbTkkHXDsoY7Yg== +"@lerna/import@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.18.0.tgz#c6b124b346a097e6c0f3f1ed4921a278d18bc80b" + integrity sha512-2pYIkkBTZsEdccfc+dPsKZeSw3tBzKSyl0b2lGrfmNX2Y41qqOzsJCyI1WO1uvEIP8aOaLy4hPpqRIBe4ee7hw== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" @@ -816,44 +808,44 @@ fs-extra "^8.1.0" p-map-series "^1.0.0" -"@lerna/init@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.16.0.tgz#31e0d66bbededee603338b487a42674a072b7a7d" - integrity sha512-Ybol/x5xMtBgokx4j7/Y3u0ZmNh0NiSWzBFVaOs2NOJKvuqrWimF67DKVz7yYtTYEjtaMdug64ohFF4jcT/iag== +"@lerna/init@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.18.0.tgz#b23b9170cce1f4630170dd744e8ee75785ea898d" + integrity sha512-/vHpmXkMlSaJaq25v5K13mcs/2L7E32O6dSsEkHaZCDRiV2BOqsZng9jjbE/4ynfsWfLLlU9ZcydwG72C3I+mQ== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.0" fs-extra "^8.1.0" p-map "^2.1.0" write-json-file "^3.2.0" -"@lerna/link@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.16.2.tgz#6c3a5658f6448a64dddca93d9348ac756776f6f6" - integrity sha512-eCPg5Lo8HT525fIivNoYF3vWghO3UgEVFdbsiPmhzwI7IQyZro5HWYzLtywSAdEog5XZpd2Bbn0CsoHWBB3gww== +"@lerna/link@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.18.0.tgz#bc72dc62ef4d8fb842b3286887980f98b764781d" + integrity sha512-FbbIpH0EpsC+dpAbvxCoF3cn7F1MAyJjEa5Lh3XkDGATOlinMFuKCbmX0NLpOPQZ5zghvrui97cx+jz5F2IlHw== dependencies: - "@lerna/command" "3.16.0" - "@lerna/package-graph" "3.16.0" - "@lerna/symlink-dependencies" "3.16.2" + "@lerna/command" "3.18.0" + "@lerna/package-graph" "3.18.0" + "@lerna/symlink-dependencies" "3.17.0" p-map "^2.1.0" slash "^2.0.0" -"@lerna/list@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.16.0.tgz#883c00b2baf1e03c93e54391372f67a01b773c2f" - integrity sha512-TkvstoPsgKqqQ0KfRumpsdMXfRSEhdXqOLq519XyI5IRWYxhoqXqfi8gG37UoBPhBNoe64japn5OjphF3rOmQA== +"@lerna/list@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.18.4.tgz#4320f262cdb2df54b57b3ef0da935c568e30f1e9" + integrity sha512-bgtlhAwhjHOTLq0iIuPs30abeuLbwZvVB60Ym8kPp+chh939obKU3vy2KMyX+Gpxf8pzuQG+k986YXcUBvXVsw== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/listable" "3.16.0" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" + "@lerna/listable" "3.18.4" "@lerna/output" "3.13.0" -"@lerna/listable@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.16.0.tgz#e6dc47a2d5a6295222663486f50e5cffc580f043" - integrity sha512-mtdAT2EEECqrJSDm/aXlOUFr1MRE4p6hppzY//Klp05CogQy6uGaKk+iKG5yyCLaOXFFZvG4HfO11CmoGSDWzw== +"@lerna/listable@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.18.4.tgz#45d14ad4eba00d7da71deba839312bed78e02680" + integrity sha512-EKSsnST5k3dZfw+UTwBH1/sHQ1YfgjYjGxXCabyn55mMgc2GjoDekODMYzZ1TNF2NNy6RgIZ24X2JI8G22nZUw== dependencies: - "@lerna/query-graph" "3.16.0" + "@lerna/query-graph" "3.18.0" chalk "^2.3.1" columnify "^1.5.4" @@ -875,10 +867,10 @@ config-chain "^1.1.11" pify "^4.0.1" -"@lerna/npm-dist-tag@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.16.0.tgz#b2184cee5e1f291277396854820e1117a544b7ee" - integrity sha512-MQrBkqJJB9+eNphuj9w90QPMOs4NQXMuSRk9NqzeFunOmdDopPCV0Q7IThSxEuWnhJ2n3B7G0vWUP7tNMPdqIQ== +"@lerna/npm-dist-tag@3.18.1": + version "3.18.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.1.tgz#d4dd82ea92e41e960b7117f83102ebcd7a23e511" + integrity sha512-vWkZh2T/O9OjPLDrba0BTWO7ug/C3sCwjw7Qyk1aEbxMBXB/eEJPqirwJTWT+EtRJQYB01ky3K8ZFOhElVyjLw== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" "@lerna/otplease" "3.16.0" @@ -886,12 +878,12 @@ npm-package-arg "^6.1.0" npmlog "^4.1.2" -"@lerna/npm-install@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.16.0.tgz#8ec76a7a13b183bde438fd46296bf7a0d6f86017" - integrity sha512-APUOIilZCzDzce92uLEwzt1r7AEMKT/hWA1ThGJL+PO9Rn8A95Km3o2XZAYG4W0hR+P4O2nSVuKbsjQtz8CjFQ== +"@lerna/npm-install@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.16.5.tgz#d6bfdc16f81285da66515ae47924d6e278d637d3" + integrity sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^8.1.0" npm-package-arg "^6.1.0" @@ -914,12 +906,12 @@ pify "^4.0.1" read-package-json "^2.0.13" -"@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== +"@lerna/npm-run-script@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz#9c2ec82453a26c0b46edc0bb7c15816c821f5c15" + integrity sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" @@ -952,10 +944,10 @@ tar "^4.4.10" temp-write "^3.4.0" -"@lerna/package-graph@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.16.0.tgz#909c90fb41e02f2c19387342d2a5eefc36d56836" - integrity sha512-A2mum/gNbv7zCtAwJqoxzqv89As73OQNK2MgSX1SHWya46qoxO9a9Z2c5lOFQ8UFN5ZxqWMfFYXRCz7qzwmFXw== +"@lerna/package-graph@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.18.0.tgz#eb42d14404a55b26b2472081615e26b0817cd91a" + integrity sha512-BLYDHO5ihPh20i3zoXfLZ5ZWDCrPuGANgVhl7k5pCmRj90LCvT+C7V3zrw70fErGAfvkcYepMqxD+oBrAYwquQ== dependencies: "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/validation-error" "3.13.0" @@ -979,10 +971,10 @@ dependencies: semver "^6.2.0" -"@lerna/project@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.16.0.tgz#2469a4e346e623fd922f38f5a12931dfb8f2a946" - integrity sha512-NrKcKK1EqXqhrGvslz6Q36+ZHuK3zlDhGdghRqnxDcHxMPT01NgLcmsnymmQ+gjMljuLRmvKYYCuHrknzX8VrA== +"@lerna/project@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.18.0.tgz#56feee01daeb42c03cbdf0ed8a2a10cbce32f670" + integrity sha512-+LDwvdAp0BurOAWmeHE3uuticsq9hNxBI0+FMHiIai8jrygpJGahaQrBYWpwbshbQyVLeQgx3+YJdW2TbEdFWA== dependencies: "@lerna/package" "3.16.0" "@lerna/validation-error" "3.13.0" @@ -1005,22 +997,22 @@ inquirer "^6.2.0" npmlog "^4.1.2" -"@lerna/publish@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.16.4.tgz#4cd55d8be9943d9a68e316e930a90cda8590500e" - integrity sha512-XZY+gRuF7/v6PDQwl7lvZaGWs8CnX6WIPIu+OCcyFPSL/rdWegdN7HieKBHskgX798qRQc2GrveaY7bNoTKXAw== +"@lerna/publish@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.18.4.tgz#2f3de9d00ae63ec89b5411199e8bac96445b9f17" + integrity sha512-Q+MqM5DUZvk+uT6hdEyO3khXET6LwED0YEuCu8fRwtHad03HkZ9i8PtTY5h8Sn6D6RCyCOlHTuf8O0KKAUy3ow== dependencies: "@evocateur/libnpmaccess" "^3.1.2" "@evocateur/npm-registry-fetch" "^4.0.0" "@evocateur/pacote" "^9.6.3" - "@lerna/check-working-tree" "3.14.2" - "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/describe-ref" "3.14.2" + "@lerna/check-working-tree" "3.16.5" + "@lerna/child-process" "3.16.5" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.0" + "@lerna/describe-ref" "3.16.5" "@lerna/log-packed" "3.16.0" "@lerna/npm-conf" "3.16.0" - "@lerna/npm-dist-tag" "3.16.0" + "@lerna/npm-dist-tag" "3.18.1" "@lerna/npm-publish" "3.16.2" "@lerna/otplease" "3.16.0" "@lerna/output" "3.13.0" @@ -1029,9 +1021,9 @@ "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.0" "@lerna/validation-error" "3.13.0" - "@lerna/version" "3.16.4" + "@lerna/version" "3.18.4" figgy-pudding "^3.5.1" fs-extra "^8.1.0" npm-package-arg "^6.1.0" @@ -1048,12 +1040,12 @@ dependencies: npmlog "^4.1.2" -"@lerna/query-graph@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.16.0.tgz#e6a46ebcd9d5b03f018a06eca2b471735353953c" - integrity sha512-p0RO+xmHDO95ChJdWkcy9TNLysLkoDARXeRHzY5U54VCwl3Ot/2q8fMCVlA5UeGXDutEyyByl3URqEpcQCWI7Q== +"@lerna/query-graph@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.18.0.tgz#43801a2f1b80a0ea0bfd9d42d470605326a3035d" + integrity sha512-fgUhLx6V0jDuKZaKj562jkuuhrfVcjl5sscdfttJ8dXNVADfDz76nzzwLY0ZU7/0m69jDedohn5Fx5p7hDEVEg== dependencies: - "@lerna/package-graph" "3.16.0" + "@lerna/package-graph" "3.18.0" figgy-pudding "^3.5.1" "@lerna/resolve-symlink@3.16.0": @@ -1065,12 +1057,12 @@ npmlog "^4.1.2" read-cmd-shim "^1.0.1" -"@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== +"@lerna/rimraf-dir@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz#04316ab5ffd2909657aaf388ea502cb8c2f20a09" + integrity sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" @@ -1085,55 +1077,47 @@ npm-lifecycle "^3.1.2" npmlog "^4.1.2" -"@lerna/run-parallel-batches@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.16.0.tgz#5ace7911a2dd31dfd1e53c61356034e27df0e1fb" - integrity sha512-2J/Nyv+MvogmQEfC7VcS21ifk7w0HVvzo2yOZRPvkCzGRu/rducxtB4RTcr58XCZ8h/Bt1aqQYKExu3c/3GXwg== +"@lerna/run-topologically@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.18.0.tgz#9508604553cfbeba106cd84b711fade17947f94a" + integrity sha512-lrfEewwuUMC3ioxf9Z9NdHUakN6ihekcPfdYbzR2slmdbjYKmIA5srkWdrK8NwOpQCAuekpOovH2s8X3FGEopg== dependencies: - p-map "^2.1.0" - p-map-series "^1.0.0" - -"@lerna/run-topologically@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.16.0.tgz#39e29cfc628bbc8e736d8e0d0e984997ac01bbf5" - integrity sha512-4Hlpv4zDtKWa5Z0tPkeu0sK+bxZEKgkNESMGmWrUCNfj7xwvAJurcraK8+a2Y0TFYwf0qjSLY/MzX+ZbJA3Cgw== - dependencies: - "@lerna/query-graph" "3.16.0" + "@lerna/query-graph" "3.18.0" figgy-pudding "^3.5.1" p-queue "^4.0.0" -"@lerna/run@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.16.0.tgz#1ea568c6f303e47fa00b3403a457836d40738fd2" - integrity sha512-woTeLlB1OAAz4zzjdI6RyIxSGuxiUPHJZm89E1pDEPoWwtQV6HMdMgrsQd9ATsJ5Ez280HH4bF/LStAlqW8Ufg== +"@lerna/run@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.18.4.tgz#c3ab3bffe4f098761c210a3215582f3b5b0d7227" + integrity sha512-u2ZNO2fVk5kVEpbpn4DLJZZxZ08LFnIFuaXJMAhxvOgvm12ZF2rabA9kZc3NXp5+DedG5nHHgyoyLVVbStKzBA== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/npm-run-script" "3.14.2" + "@lerna/command" "3.18.0" + "@lerna/filter-options" "3.18.4" + "@lerna/npm-run-script" "3.16.5" "@lerna/output" "3.13.0" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.0" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" -"@lerna/symlink-binary@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.16.2.tgz#f98a3d9da9e56f1d302dc0d5c2efeb951483ee66" - integrity sha512-kz9XVoFOGSF83gg4gBqH+mG6uxfJfTp8Uy+Cam40CvMiuzfODrGkjuBEFoM/uO2QOAwZvbQDYOBpKUa9ZxHS1Q== +"@lerna/symlink-binary@3.17.0": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz#8f8031b309863814883d3f009877f82e38aef45a" + integrity sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/package" "3.16.0" fs-extra "^8.1.0" p-map "^2.1.0" -"@lerna/symlink-dependencies@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.16.2.tgz#91d9909d35897aebd76a03644a00cd03c4128240" - integrity sha512-wnZqGJQ+Jvr1I3inxrkffrFZfmQI7Ta8gySw/UWCy95QtZWF/f5yk8zVIocCAsjzD0wgb3jJE3CFJ9W5iwWk1A== +"@lerna/symlink-dependencies@3.17.0": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz#48d6360e985865a0e56cd8b51b308a526308784a" + integrity sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/resolve-symlink" "3.16.0" - "@lerna/symlink-binary" "3.16.2" + "@lerna/symlink-binary" "3.17.0" fs-extra "^8.1.0" p-finally "^1.0.0" p-map "^2.1.0" @@ -1151,26 +1135,27 @@ dependencies: npmlog "^4.1.2" -"@lerna/version@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.16.4.tgz#b5cc37f3ad98358d599c6196c30b6efc396d42bf" - integrity sha512-ikhbMeIn5ljCtWTlHDzO4YvTmpGTX1lWFFIZ79Vd1TNyOr+OUuKLo/+p06mCl2WEdZu0W2s5E9oxfAAQbyDxEg== +"@lerna/version@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.18.4.tgz#48261a8a69d1b15ab40a7cc6400381c4e480ec6b" + integrity sha512-+gR9H89qSP8iqzNi4tRVQUbWlFMOlhbY6+5TXkP72Ibb/z87O+C46DBqizSMVaPQYdSYjS1c9Xfa1oOhEWxGaw== dependencies: - "@lerna/check-working-tree" "3.14.2" - "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" + "@lerna/check-working-tree" "3.16.5" + "@lerna/child-process" "3.16.5" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.0" "@lerna/conventional-commits" "3.16.4" - "@lerna/github-client" "3.16.0" + "@lerna/github-client" "3.16.5" "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/prompt" "3.13.0" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.0" "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" + load-json-file "^5.3.0" minimatch "^3.0.4" npmlog "^4.1.2" p-map "^2.1.0" @@ -1180,6 +1165,7 @@ semver "^6.2.0" slash "^2.0.0" temp-write "^3.4.0" + write-json-file "^3.2.0" "@lerna/write-log-file@3.13.0": version "3.13.0" @@ -1329,6 +1315,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/color-name@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + "@types/debug@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" @@ -1378,17 +1369,12 @@ "@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.18": - version "24.0.18" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.18.tgz#9c7858d450c59e2164a8a9df0905fc5091944498" - integrity sha512-jcDDXdjTcrQzdN06+TSVsPPqxvsZA/5QkYfIZlq1JMw7FdP5AZylbOc+6B/cuDurctRe+MziUMtQ3xQdrbjqyQ== +"@types/jest@^24.0.23": + version "24.0.23" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.23.tgz#046f8e2ade026fe831623e361a36b6fb9a4463e4" + integrity sha512-L7MBvwfNpe7yVPTXLn32df/EK+AMBFAFvZrRuArGs7npEWnlziUXK+5GMIUTI4NIuwok3XibsjXCs5HxviYXjg== dependencies: - "@types/jest-diff" "*" + jest-diff "^24.3.0" "@types/json-schema@^7.0.3": version "7.0.3" @@ -1421,21 +1407,26 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.141.tgz#d81f4d0c562abe28713406b571ffb27692a82ae6" integrity sha512-v5NYIi9qEbFEUpCyikmnOYe4YlP8BMUdTcNCAquAKzu+FA7rZ1onj9x80mbnDdOW/K5bFf3Tv5kJplP33+gAbQ== -"@types/marked@^0.6.5": - version "0.6.5" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.6.5.tgz#3cf2a56ef615dad24aaf99784ef90a9eba4e29d8" - integrity sha512-6kBKf64aVfx93UJrcyEZ+OBM5nGv4RLsI6sR1Ar34bpgvGVRoyTgpxn4ZmtxOM5aDTAaaznYuYUH8bUX3Nk3YA== +"@types/marked@^0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.7.1.tgz#2f56cb2aa942efde23bd2beb9e07f4b6ddd25563" + integrity sha512-QMgeCgUMyNKfteIzmVuFcyGXORiD67fbEQbwbfJLIn+HejcyaQm0H00q66PJz8bMb8Ve4JrsJ2JXuStyZ4DjZg== "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.0.2", "@types/node@^12.7.2": +"@types/node@*", "@types/node@^12.0.2": version "12.7.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.11.tgz#be879b52031cfb5d295b047f5462d8ef1a716446" integrity sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw== +"@types/node@^12.12.7": + version "12.12.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.7.tgz#01e4ea724d9e3bd50d90c11fd5980ba317d8fa11" + integrity sha512-E6Zn0rffhgd130zbCbAr/JdXfXkoOUFAKNs/rF8qnafSJ8KYaA/j3oz7dcwal+lYjLA7xvdd5J4wdYpCTlP8+w== + "@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" @@ -1451,6 +1442,11 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.2.tgz#5e8b09f0e4af53034b1d0fb9977a277847836205" integrity sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ== +"@types/semver@^6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.2.0.tgz#d688d574400d96c5b0114968705366f431831e1a" + integrity sha512-1OzrNb4RuAzIT7wHSsgZRlMBlNsJl+do6UblR7JMW4oB7bbR+uBEYtUh7gEc/jM84GGilh68lSOokyM/zNUlBA== + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -1473,23 +1469,6 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/experimental-utils@^1.13.0": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" - integrity sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg== - dependencies: - "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "1.13.0" - eslint-scope "^4.0.0" - -"@typescript-eslint/typescript-estree@1.13.0": - version "1.13.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" - integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw== - dependencies: - lodash.unescape "4.0.1" - semver "5.5.0" - "@zkochan/cmd-shim@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" @@ -1525,10 +1504,10 @@ acorn-globals@^4.1.0: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" - integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== +acorn-jsx@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" + integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== acorn-walk@^6.0.1: version "6.2.0" @@ -1545,7 +1524,7 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" integrity sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA== -acorn@^7.0.0: +acorn@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== @@ -1589,14 +1568,14 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -all-contributors-cli@^6.8.1: - version "6.9.1" - resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.9.1.tgz#29f0867c6215a1691b25e83c23bc16f30f83f31a" - integrity sha512-z0I/u78s1Robx2p57X28gg+ZHgtRe7iABmEw1O/UFRDpqAHvlF3P7rmug0d99nsNIehrOSayO6XQey4bOHe4Iw== +all-contributors-cli@^6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/all-contributors-cli/-/all-contributors-cli-6.11.0.tgz#ee30151ef7df3971a968ccfe1e94e40d19555beb" + integrity sha512-QhOzpYHyzz9hmPCKO5nbRVjoeQDsCAovZpx3RlleeabfBRBohHkAZzJwPiQB5wmX5ZTwo3/9r3gkJ8zmj+j4vQ== dependencies: "@babel/runtime" "^7.2.0" async "^3.0.1" - chalk "^2.3.0" + chalk "^3.0.0" didyoumean "^1.2.1" inquirer "^6.2.1" json-fixer "^1.3.1-0" @@ -1610,6 +1589,13 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== +ansi-escapes@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.2.1.tgz#4dccdb846c3eee10f6d64dea66273eab90c37228" + integrity sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q== + dependencies: + type-fest "^0.5.2" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -1625,6 +1611,11 @@ ansi-regex@^4.0.0, ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -1637,6 +1628,14 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.0.tgz#5681f0dcf7ae5880a7841d8831c4724ed9cc0172" + integrity sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg== + dependencies: + "@types/color-name" "^1.1.1" + color-convert "^2.0.1" + any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" @@ -2137,6 +2136,14 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -2174,6 +2181,13 @@ cli-cursor@^2.0.0, cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -2187,15 +2201,6 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - 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" @@ -2235,11 +2240,23 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" @@ -2849,6 +2866,11 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -2980,20 +3002,12 @@ eslint-plugin-import@^2.18.2: read-pkg-up "^2.0.0" resolve "^1.11.0" -eslint-plugin-jest@^22.15.2: - version "22.17.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.17.0.tgz#dc170ec8369cd1bff9c5dd8589344e3f73c88cf6" - integrity sha512-WT4DP4RoGBhIQjv+5D0FM20fAdAUstfYAf/mkufLNTojsfgzc5/IYW22cIg/Q4QBavAZsROQlqppiWDpFZDS8Q== +eslint-plugin-jest@^23.0.4: + version "23.0.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.0.4.tgz#1ab81ffe3b16c5168efa72cbd4db14d335092aa0" + integrity sha512-OaP8hhT8chJNodUPvLJ6vl8gnalcsU/Ww1t9oR3HnGdEWjm/DdCCUXLOral+IPGAeWu/EwgVQCK/QtxALpH1Yw== dependencies: - "@typescript-eslint/experimental-utils" "^1.13.0" - -eslint-scope@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + "@typescript-eslint/experimental-utils" "^2.5.0" eslint-scope@^5.0.0: version "5.0.0" @@ -3003,22 +3017,22 @@ eslint-scope@^5.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" - integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== dependencies: - eslint-visitor-keys "^1.0.0" + eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^6.2.2: - version "6.5.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.5.1.tgz#828e4c469697d43bb586144be152198b91e96ed6" - integrity sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A== +eslint@^6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.6.0.tgz#4a01a2fb48d32aacef5530ee9c5a78f11a8afd04" + integrity sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -3027,9 +3041,9 @@ eslint@^6.2.2: debug "^4.0.1" doctrine "^3.0.0" eslint-scope "^5.0.0" - eslint-utils "^1.4.2" + eslint-utils "^1.4.3" eslint-visitor-keys "^1.1.0" - espree "^6.1.1" + espree "^6.1.2" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" @@ -3039,7 +3053,7 @@ eslint@^6.2.2: ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.4.1" + inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" @@ -3058,13 +3072,13 @@ eslint@^6.2.2: text-table "^0.2.0" v8-compile-cache "^2.0.3" -espree@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" - integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== +espree@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" + integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== dependencies: - acorn "^7.0.0" - acorn-jsx "^5.0.2" + acorn "^7.1.0" + acorn-jsx "^5.1.0" eslint-visitor-keys "^1.1.0" esprima@^3.1.3: @@ -3315,6 +3329,13 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +figures@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" + integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -3516,11 +3537,6 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -3663,6 +3679,18 @@ 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@*, glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + 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.4, glob@^7.0.0, 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" @@ -3781,6 +3809,11 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" @@ -3885,20 +3918,20 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^3.0.4: - version "3.0.8" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.8.tgz#8de3fed26ce9b43034ef51013c4ad368b6b74ea8" - integrity sha512-HFOsgcyrX3qe/rBuqyTt+P4Gxn5P0seJmr215LAZ/vnwK3jWB3r0ck7swbzGRUbufCf9w/lgHPVbF/YXQALgfQ== +husky@^3.0.9: + version "3.0.9" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.9.tgz#a2c3e9829bfd6b4957509a9500d2eef5dbfc8044" + integrity sha512-Yolhupm7le2/MqC1VYLk/cNmYxsSsqKkTyBhzQHhPK1jFnC89mmmNVuGtLNabjDI6Aj8UNIr0KpRNuBkiC4+sg== dependencies: chalk "^2.4.2" + ci-info "^2.0.0" cosmiconfig "^5.2.1" execa "^1.0.0" get-stdin "^7.0.0" - is-ci "^2.0.0" opencollective-postinstall "^2.0.2" pkg-dir "^4.2.0" please-upgrade-node "^3.2.0" - read-pkg "^5.1.1" + read-pkg "^5.2.0" run-node "^1.0.0" slash "^3.0.0" @@ -4033,7 +4066,7 @@ inquirer@6.5.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.4.1: +inquirer@^6.2.0, inquirer@^6.2.1: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -4052,6 +4085,25 @@ inquirer@^6.2.0, inquirer@^6.2.1, inquirer@^6.4.1: strip-ansi "^5.1.0" through "^2.3.6" +inquirer@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.0.tgz#9e2b032dde77da1db5db804758b8fea3a970519a" + integrity sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ== + dependencies: + ansi-escapes "^4.2.1" + chalk "^2.4.2" + cli-cursor "^3.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.15" + mute-stream "0.0.8" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^4.1.0" + 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" @@ -4064,11 +4116,6 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" @@ -4188,6 +4235,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-generator-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" @@ -4471,7 +4523,7 @@ jest-config@^24.9.0: pretty-format "^24.9.0" realpath-native "^1.1.0" -jest-diff@^24.9.0: +jest-diff@^24.3.0, jest-diff@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== @@ -4926,38 +4978,31 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - left-pad@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== -lerna@^3.16.4: - version "3.16.4" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.16.4.tgz#158cb4f478b680f46f871d5891f531f3a2cb31ec" - integrity sha512-0HfwXIkqe72lBLZcNO9NMRfylh5Ng1l8tETgYQ260ZdHRbPuaLKE3Wqnd2YYRRkWfwPyEyZO8mZweBR+slVe1A== - dependencies: - "@lerna/add" "3.16.2" - "@lerna/bootstrap" "3.16.2" - "@lerna/changed" "3.16.4" - "@lerna/clean" "3.16.0" - "@lerna/cli" "3.13.0" - "@lerna/create" "3.16.0" - "@lerna/diff" "3.16.0" - "@lerna/exec" "3.16.0" - "@lerna/import" "3.16.0" - "@lerna/init" "3.16.0" - "@lerna/link" "3.16.2" - "@lerna/list" "3.16.0" - "@lerna/publish" "3.16.4" - "@lerna/run" "3.16.0" - "@lerna/version" "3.16.4" +lerna@^3.18.4: + version "3.18.4" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.18.4.tgz#132858cabb8fc8393341ddddbbbd85dd0ca82a79" + integrity sha512-DiU53cvMxaU07Bj2HwBwUQ2O3c/ORNq/QwKj1vGJH4vSkZSTUxPryp2baSNlt8PmnLNXOVpw0vOTRkEF+6n/cA== + dependencies: + "@lerna/add" "3.18.4" + "@lerna/bootstrap" "3.18.4" + "@lerna/changed" "3.18.4" + "@lerna/clean" "3.18.4" + "@lerna/cli" "3.18.0" + "@lerna/create" "3.18.0" + "@lerna/diff" "3.18.0" + "@lerna/exec" "3.18.4" + "@lerna/import" "3.18.0" + "@lerna/init" "3.18.0" + "@lerna/link" "3.18.0" + "@lerna/list" "3.18.4" + "@lerna/publish" "3.18.4" + "@lerna/run" "3.18.4" + "@lerna/version" "3.18.4" import-local "^2.0.0" npmlog "^4.1.2" @@ -4979,10 +5024,10 @@ lines-and-columns@^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@^9.2.5: - version "9.4.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.4.1.tgz#60c0f85745bd398e6460aa7f5adb3cad3a2b862c" - integrity sha512-zFRbo1bAJEVf1m33paTTjDVfy2v3lICCqHfmQSgNoI+lWpi7HPG5y/R2Y7Whdce+FKxlZYs/U1sDSx8+nmQdDA== +lint-staged@^9.4.3: + version "9.4.3" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.4.3.tgz#f55ad5f94f6e105294bfd6499b23142961f7b982" + integrity sha512-PejnI+rwOAmKAIO+5UuAZU9gxdej/ovSEOAY34yMfC3OS4Ac82vCBPzAWLReR9zCPOMqeVwQRaZ3bUBpAsaL2Q== dependencies: chalk "^2.4.2" commander "^2.20.0" @@ -5183,7 +5228,7 @@ lodash@4.17.14: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -lodash@4.17.15, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.2.1: +lodash@4.17.15, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -5287,13 +5332,6 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -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" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -5321,15 +5359,6 @@ marked@^0.7.0: resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - meow@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" @@ -5435,7 +5464,7 @@ 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.1.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== @@ -5565,7 +5594,7 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -mute-stream@~0.0.4: +mute-stream@0.0.8, mute-stream@~0.0.4: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== @@ -5940,15 +5969,6 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= -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== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" @@ -5970,11 +5990,6 @@ osenv@^0.1.4, osenv@^0.1.5: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - p-each-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" @@ -5992,11 +6007,6 @@ p-finally@^2.0.0: 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" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -6326,10 +6336,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -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== +prettier@*, prettier@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-format@^24.9.0: version "24.9.0" @@ -6553,7 +6563,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -read-pkg@^5.1.1: +read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== @@ -6660,6 +6670,11 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== +regexpp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e" + integrity sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g== + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -6729,11 +6744,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-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" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -6801,6 +6811,14 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -6930,11 +6948,6 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -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@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" @@ -7254,7 +7267,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -7271,6 +7284,15 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" +string-width@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.0" + string.prototype.trimleft@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" @@ -7331,6 +7353,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-bom@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" @@ -7408,6 +7437,13 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" + integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + dependencies: + has-flag "^4.0.0" + symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" @@ -7632,10 +7668,10 @@ ts-jest@^24.0.0: semver "^5.5" yargs-parser "10.x" -ts-node@^8.3.0: - version "8.4.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.4.1.tgz#270b0dba16e8723c9fa4f9b4775d3810fd994b4f" - integrity sha512-5LpRN+mTiCs7lI5EtbXmF/HfMeCjzt7DH9CZwtkr6SywStrNQC723wG+aOWFiLNn7zT3kD/RnFqi3ZUfr4l5Qw== +ts-node@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.5.0.tgz#bc7d5a39133d222bf25b1693651e4d893785f884" + integrity sha512-fbG32iZEupNV2E2Fd2m2yt1TdAwR3GTCrJQBHDevIiEBNy1A8kqnyl1fv7jmRmmbtcapFab2glZXHJvfD1ed0Q== dependencies: arg "^4.1.0" diff "^4.0.1" @@ -7648,10 +7684,10 @@ tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tslint@^5.19.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.0.tgz#fac93bfa79568a5a24e7be9cdde5e02b02d00ec1" - integrity sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g== +tslint@^5.20.1: + version "5.20.1" + resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" + integrity sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg== dependencies: "@babel/code-frame" "^7.0.0" builtin-modules "^1.1.1" @@ -7705,6 +7741,11 @@ type-fest@^0.3.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== +type-fest@^0.5.2: + 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" @@ -7715,10 +7756,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, "typescript@>=3.2.1 <3.8.0 || >3.7.0-dev.0", typescript@^3.7.0-dev.20191021: - version "3.7.0-dev.20191021" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191021.tgz#e0238e0b3eed9fc265767a1b7f5346fea8ab5edb" - integrity sha512-SSx/+QkyW7PMcaGQXzVmVkrRmmaLFsdOYXhP9sY9eYMiHrfmtZE9EL2hjtbihfnpyWfCmPup69VgbB4dTTEQgg== +typescript@*, "typescript@>=3.2.1 <3.8.0", typescript@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" + integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== uglify-js@^3.1.4: version "3.6.0" @@ -7955,14 +7996,6 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" @@ -8059,7 +8092,7 @@ xtend@~4.0.1: 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: +y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== @@ -8076,14 +8109,6 @@ yargs-parser@10.x, yargs-parser@^10.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" - integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^13.1.1: version "13.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" @@ -8092,23 +8117,13 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs@^12.0.1: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== +yargs-parser@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.0.tgz#cdd7a97490ec836195f59f3f4dbe5ea9e8f75f08" + integrity sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ== dependencies: - cliui "^4.0.0" + camelcase "^5.0.0" decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^11.1.1" yargs@^13.3.0: version "13.3.0" @@ -8143,6 +8158,23 @@ yargs@^14.0.0: y18n "^4.0.0" yargs-parser "^13.1.1" +yargs@^14.2.0: + version "14.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.0.tgz#f116a9242c4ed8668790b40759b4906c276e76c3" + integrity sha512-/is78VKbKs70bVZH7w4YaZea6xcJWOAwkhbR0CFuZBmYtfTYF0xjGJF43AYd8g2Uii1yJwmS5GR2vBmrc32sbg== + dependencies: + cliui "^5.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + 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 "^15.0.0" + yn@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From 9aee06cf4c47e38b5959d45f28bad6499b605352 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 15 Nov 2019 19:26:00 +0200 Subject: [PATCH 13/20] fix(eslint-plugin): [indent] handle empty generic declarations (#1211) Co-authored-by: Brad Zacher --- packages/eslint-plugin/src/rules/indent.ts | 4 ++++ packages/eslint-plugin/tests/rules/indent/indent.test.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 571767d5e002..46ac924f4c74 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -444,6 +444,10 @@ export default util.createRule({ }, TSTypeParameterDeclaration(node: TSESTree.TSTypeParameterDeclaration) { + if (!node.params.length) { + return; + } + const [name, ...attributes] = node.params; // JSX is about the closest we can get because the angle brackets diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts index f49be8330058..fca5629655b7 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts @@ -770,6 +770,11 @@ const div: JQuery = $('
') }, // https://github.com/typescript-eslint/typescript-eslint/issues/441 `const;`, + + // https://github.com/typescript-eslint/typescript-eslint/issues/1115 + { + code: `const foo = function<> (): void {}`, + }, ], invalid: [ ...individualNodeTests.invalid, From d1de3a7eb02f1f0eb12a5b09fe32623d276367fb Mon Sep 17 00:00:00 2001 From: Alexander T Date: Sat, 16 Nov 2019 03:22:14 +0200 Subject: [PATCH 14/20] =?UTF-8?q?fix(eslint-plugin):=20[unified-signatures?= =?UTF-8?q?]=20crash:=20cannot=20read=20pro=E2=80=A6=20(#1096)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Brad Zacher --- .../src/rules/unified-signatures.ts | 3 +- .../tests/rules/unified-signatures.test.ts | 36 +++++++++++++++++++ .../src/ts-estree/ts-estree.ts | 1 - 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index c4c7f9bf4275..66f783ec1a87 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -535,7 +535,8 @@ export default util.createRule({ // collect overloads TSDeclareFunction(node): void { - addOverload(node, node.id.name, getExportingNode(node)); + const exportingNode = getExportingNode(node); + addOverload(node, node.id?.name ?? exportingNode?.type, exportingNode); }, TSCallSignatureDeclaration: addOverload, TSConstructSignatureDeclaration: addOverload, diff --git a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts index c8f9740662dd..38a74429af7f 100644 --- a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts @@ -128,6 +128,14 @@ export interface Foo { bar(baz: string): number[]; bar(): string[]; } +`, + ` +declare module "foo" { + export default function(foo: number): string[]; +} +`, + ` +export default function(foo: number): string[]; `, ], invalid: [ @@ -649,5 +657,33 @@ export function foo(line: number, character?: number): number; }, ], }, + { + code: ` +declare module "foo" { + export default function(foo: number): string[]; + export default function(foo: number, bar?: string): string[]; +} +`, + errors: [ + { + messageId: 'omittingSingleParameter', + line: 4, + column: 40, + }, + ], + }, + { + code: ` +export default function(foo: number): string[]; +export default function(foo: number, bar?: string): string[]; +`, + errors: [ + { + messageId: 'omittingSingleParameter', + line: 3, + column: 38, + }, + ], + }, ], }); diff --git a/packages/typescript-estree/src/ts-estree/ts-estree.ts b/packages/typescript-estree/src/ts-estree/ts-estree.ts index 10cd0b7e0fb2..afda76ead68d 100644 --- a/packages/typescript-estree/src/ts-estree/ts-estree.ts +++ b/packages/typescript-estree/src/ts-estree/ts-estree.ts @@ -1061,7 +1061,6 @@ export interface TSConstructSignatureDeclaration extends FunctionSignatureBase { } export interface TSDeclareFunction extends FunctionDeclarationBase { - id: Identifier; type: AST_NODE_TYPES.TSDeclareFunction; } From 9829dd34cae7e9bf4434f593186c92302d157a6b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 15 Nov 2019 17:24:26 -0800 Subject: [PATCH 15/20] fix(eslint-plugin): [nuta] correctly handle null/undefined separation (#1201) --- .../src/rules/no-unnecessary-type-assertion.ts | 15 +++++++++++---- .../rules/no-unnecessary-type-assertion.test.ts | 11 +++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) 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 61583878bae9..141959ca7afd 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -216,10 +216,17 @@ export default util.createRule({ contextualType, ts.TypeFlags.Null, ); - if ( - (typeIncludesUndefined && contextualTypeIncludesUndefined) || - (typeIncludesNull && contextualTypeIncludesNull) - ) { + + // make sure that the parent accepts the same types + // i.e. assigning `string | null | undefined` to `string | undefined` is invalid + const isValidUndefined = typeIncludesUndefined + ? contextualTypeIncludesUndefined + : true; + const isValidNull = typeIncludesNull + ? contextualTypeIncludesNull + : true; + + if (isValidUndefined && isValidNull) { context.report({ node, messageId: 'contextuallyUnnecessary', diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts index 4b4e496253f5..73a8619b6a48 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts @@ -104,6 +104,17 @@ class Mx { private prop = 1; } `, + // https://github.com/typescript-eslint/typescript-eslint/issues/1199 + ` +function testFunction(_param: string | undefined): void { /* noop */ } +const value = 'test' as string | null | undefined +testFunction(value!) + `, + ` +function testFunction(_param: string | null): void { /* noop */ } +const value = 'test' as string | null | undefined +testFunction(value!) + `, ], invalid: [ From eb83af1b00e29010d899bc461d0a883370faa962 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 15 Nov 2019 17:36:01 -0800 Subject: [PATCH 16/20] fix(eslint-plugin): [require-await] better handle nesting (#1193) --- .../eslint-plugin/src/rules/require-await.ts | 131 ++++-------------- .../tests/rules/require-await.test.ts | 9 ++ 2 files changed, 37 insertions(+), 103 deletions(-) diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index cc5ecc8bf609..5f27f8ad8a1d 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -1,6 +1,5 @@ import { TSESTree, - TSESLint, AST_NODE_TYPES, } from '@typescript-eslint/experimental-utils'; import baseRule from 'eslint/lib/rules/require-await'; @@ -11,11 +10,6 @@ import * as util from '../util'; type Options = util.InferOptionsTypeFromRule; type MessageIds = util.InferMessageIdsTypeFromRule; -interface ScopeInfo { - upper: ScopeInfo | null; - returnsPromise: boolean; -} - export default util.createRule({ name: 'require-await', meta: { @@ -35,82 +29,6 @@ export default util.createRule({ const parserServices = util.getParserServices(context); const checker = parserServices.program.getTypeChecker(); - let scopeInfo: ScopeInfo | null = null; - - /** - * Push the scope info object to the stack. - * - * @returns {void} - */ - function enterFunction( - node: - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression - | TSESTree.ArrowFunctionExpression, - ): void { - scopeInfo = { - upper: scopeInfo, - returnsPromise: false, - }; - - switch (node.type) { - case AST_NODE_TYPES.FunctionDeclaration: - rules.FunctionDeclaration(node); - break; - - case AST_NODE_TYPES.FunctionExpression: - rules.FunctionExpression(node); - break; - - case AST_NODE_TYPES.ArrowFunctionExpression: - rules.ArrowFunctionExpression(node); - - // If body type is not BlockStatment, we need to check the return type here - if (node.body.type !== AST_NODE_TYPES.BlockStatement) { - const expression = parserServices.esTreeNodeToTSNodeMap.get( - node.body, - ); - scopeInfo.returnsPromise = isThenableType(expression); - } - - break; - } - } - - /** - * Pop the top scope info object from the stack. - * Passes through to the base rule if the function doesn't return a promise - * - * @param {ASTNode} node - The node exiting - * @returns {void} - */ - function exitFunction( - node: - | TSESTree.FunctionDeclaration - | TSESTree.FunctionExpression - | TSESTree.ArrowFunctionExpression, - ): void { - if (scopeInfo) { - if (!scopeInfo.returnsPromise) { - switch (node.type) { - case AST_NODE_TYPES.FunctionDeclaration: - rules['FunctionDeclaration:exit'](node); - break; - - case AST_NODE_TYPES.FunctionExpression: - rules['FunctionExpression:exit'](node); - break; - - case AST_NODE_TYPES.ArrowFunctionExpression: - rules['ArrowFunctionExpression:exit'](node); - break; - } - } - - scopeInfo = scopeInfo.upper; - } - } - /** * Checks if the node returns a thenable type * @@ -124,34 +42,41 @@ export default util.createRule({ } return { - 'FunctionDeclaration[async = true]': enterFunction, - 'FunctionExpression[async = true]': enterFunction, - 'ArrowFunctionExpression[async = true]': enterFunction, - 'FunctionDeclaration[async = true]:exit': exitFunction, - 'FunctionExpression[async = true]:exit': exitFunction, - 'ArrowFunctionExpression[async = true]:exit': exitFunction, - - ReturnStatement(node): void { - if (!scopeInfo) { - return; + 'FunctionDeclaration[async = true]': rules.FunctionDeclaration, + 'FunctionExpression[async = true]': rules.FunctionExpression, + 'ArrowFunctionExpression[async = true]'( + node: TSESTree.ArrowFunctionExpression, + ): void { + rules.ArrowFunctionExpression(node); + + // If body type is not BlockStatment, we need to check the return type here + if (node.body.type !== AST_NODE_TYPES.BlockStatement) { + const expression = parserServices.esTreeNodeToTSNodeMap.get( + node.body, + ); + if (expression && isThenableType(expression)) { + // tell the base rule to mark the scope as having an await so it ignores it + rules.AwaitExpression(node as never); + } } + }, + 'FunctionDeclaration[async = true]:exit': + rules['FunctionDeclaration:exit'], + 'FunctionExpression[async = true]:exit': rules['FunctionExpression:exit'], + 'ArrowFunctionExpression[async = true]:exit': + rules['ArrowFunctionExpression:exit'], + AwaitExpression: rules.AwaitExpression, + ForOfStatement: rules.ForOfStatement, + ReturnStatement(node): void { const { expression } = parserServices.esTreeNodeToTSNodeMap.get< ts.ReturnStatement >(node); - if (!expression) { - return; + if (expression && isThenableType(expression)) { + // tell the base rule to mark the scope as having an await so it ignores it + rules.AwaitExpression(node as never); } - - scopeInfo.returnsPromise = isThenableType(expression); }, - - AwaitExpression: rules.AwaitExpression as TSESLint.RuleFunction< - TSESTree.Node - >, - ForOfStatement: rules.ForOfStatement as TSESLint.RuleFunction< - TSESTree.Node - >, }; }, }); diff --git a/packages/eslint-plugin/tests/rules/require-await.test.ts b/packages/eslint-plugin/tests/rules/require-await.test.ts index 38a925de1d2c..09b54bd3a99d 100644 --- a/packages/eslint-plugin/tests/rules/require-await.test.ts +++ b/packages/eslint-plugin/tests/rules/require-await.test.ts @@ -128,6 +128,15 @@ ruleTester.run('require-await', rule, { return Promise.resolve(x); }`, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/1188 + ` +async function testFunction(): Promise { + await Promise.all([1, 2, 3].map( + // this should not trigger an error on the parent function + async value => Promise.resolve(value) + )) +} + `, ], invalid: [ From ba891681ed39677347d1d70e198f050a3d6c28dd Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 15 Nov 2019 17:37:13 -0800 Subject: [PATCH 17/20] =?UTF-8?q?fix(typescript-estree):=20correctly=20acc?= =?UTF-8?q?ount=20for=20trailing=20slash=20in=E2=80=A6=20(#1205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/create-program/createWatchProgram.ts | 6 +- .../src/create-program/shared.ts | 17 ++++-- .../tests/lib/persistentParse.ts | 57 ++++++++++++++++--- 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/packages/typescript-estree/src/create-program/createWatchProgram.ts b/packages/typescript-estree/src/create-program/createWatchProgram.ts index 9223107986af..38bd209ff3f2 100644 --- a/packages/typescript-estree/src/create-program/createWatchProgram.ts +++ b/packages/typescript-estree/src/create-program/createWatchProgram.ts @@ -1,6 +1,5 @@ import debug from 'debug'; import fs from 'fs'; -import path from 'path'; import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports import { Extra } from '../parser-options'; import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; @@ -67,7 +66,7 @@ function saveWatchCallback( fileName: string, callback: ts.FileWatcherCallback, ): ts.FileWatcher => { - const normalizedFileName = getCanonicalFileName(path.normalize(fileName)); + const normalizedFileName = getCanonicalFileName(fileName); const watchers = ((): Set => { let watchers = trackingMap.get(normalizedFileName); if (!watchers) { @@ -246,8 +245,7 @@ function createWatchProgram( watchCompilerHost.readFile = (filePathIn, encoding): string | undefined => { const filePath = getCanonicalFileName(filePathIn); const fileContent = - path.normalize(filePath) === - path.normalize(currentLintOperationState.filePath) + filePath === currentLintOperationState.filePath ? currentLintOperationState.code : oldReadFile(filePath, encoding); if (fileContent) { diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 6509997094f9..a19bef274139 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -20,14 +20,21 @@ const DEFAULT_COMPILER_OPTIONS: ts.CompilerOptions = { // This narrows the type so we can be sure we're passing canonical names in the correct places type CanonicalPath = string & { __brand: unknown }; + // typescript doesn't provide a ts.sys implementation for browser environments const useCaseSensitiveFileNames = ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true; -const getCanonicalFileName = useCaseSensitiveFileNames - ? (filePath: string): CanonicalPath => - path.normalize(filePath) as CanonicalPath - : (filePath: string): CanonicalPath => - path.normalize(filePath).toLowerCase() as CanonicalPath; +const correctPathCasing = useCaseSensitiveFileNames + ? (filePath: string): string => filePath + : (filePath: string): string => filePath.toLowerCase(); + +function getCanonicalFileName(filePath: string): CanonicalPath { + let normalized = path.normalize(filePath); + if (normalized.endsWith('/')) { + normalized = normalized.substr(0, normalized.length - 1); + } + return correctPathCasing(normalized) as CanonicalPath; +} function getTsconfigPath(tsconfigPath: string, extra: Extra): CanonicalPath { return getCanonicalFileName( diff --git a/packages/typescript-estree/tests/lib/persistentParse.ts b/packages/typescript-estree/tests/lib/persistentParse.ts index e1cb8b9f9b76..502245977bdc 100644 --- a/packages/typescript-estree/tests/lib/persistentParse.ts +++ b/packages/typescript-estree/tests/lib/persistentParse.ts @@ -3,14 +3,6 @@ import path from 'path'; import tmp from 'tmp'; import { clearCaches, parseAndGenerateServices } from '../../src/parser'; -const tsConfigExcludeBar = { - include: ['src'], - exclude: ['./src/bar.ts'], -}; -const tsConfigIncludeAll = { - include: ['src'], - exclude: [], -}; const CONTENTS = { foo: 'console.log("foo")', bar: 'console.log("bar")', @@ -69,7 +61,10 @@ function parseFile(filename: 'foo' | 'bar' | 'baz/bar', tmpDir: string): void { }); } -describe('persistent lint session', () => { +function baseTests( + tsConfigExcludeBar: Record, + tsConfigIncludeAll: Record, +): void { it('parses both files successfully when included', () => { const PROJECT_DIR = setup(tsConfigIncludeAll); @@ -175,4 +170,48 @@ describe('persistent lint session', () => { }); // TODO - support the complex monorepo case with a tsconfig with no include/exclude +} + +describe('persistent parse', () => { + describe('includes not ending in a slash', () => { + const tsConfigExcludeBar = { + include: ['src'], + exclude: ['./src/bar.ts'], + }; + const tsConfigIncludeAll = { + include: ['src'], + exclude: [], + }; + + baseTests(tsConfigExcludeBar, tsConfigIncludeAll); + }); + + /* + If the includes ends in a slash, typescript will ask for watchers ending in a slash. + These tests ensure the normalisation code works as expected in this case. + */ + describe('includes ending in a slash', () => { + const tsConfigExcludeBar = { + include: ['src/'], + exclude: ['./src/bar.ts'], + }; + const tsConfigIncludeAll = { + include: ['src/'], + exclude: [], + }; + + baseTests(tsConfigExcludeBar, tsConfigIncludeAll); + }); + + /* + If there is no includes, then typescript will ask for a slightly different set of watchers. + */ + describe('tsconfig with no includes / files', () => { + const tsConfigExcludeBar = { + exclude: ['./src/bar.ts'], + }; + const tsConfigIncludeAll = {}; + + baseTests(tsConfigExcludeBar, tsConfigIncludeAll); + }); }); From 42a48de4b5e3bed5e4e1a58333e8830b8fcca6cd Mon Sep 17 00:00:00 2001 From: Alexander T Date: Sun, 17 Nov 2019 21:24:31 +0200 Subject: [PATCH 18/20] fix(eslint-plugin): [no-unnec-type-arg] throwing on call/new expr (#1217) Co-authored-by: Brad Zacher --- .../src/rules/no-unnecessary-type-arguments.ts | 6 +++++- .../rules/no-unnecessary-type-arguments.test.ts | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) 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 12d9c041dfea..c5c439c7bd0f 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -114,7 +114,11 @@ function getTypeParametersFromNode( return getTypeParametersFromType(node.typeName, checker); } - return getTypeParametersFromCall(node, checker); + if (ts.isCallExpression(node) || ts.isNewExpression(node)) { + return getTypeParametersFromCall(node, checker); + } + + return undefined; } function getTypeParametersFromType( 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 index 7bb37deda8fb..05794ee30f41 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -53,6 +53,9 @@ ruleTester.run('no-unnecessary-type-arguments', rule, { `declare const C: unknown; class D extends C { }`, `let a: A`, + `class Foo {} + const foo = new Foo();`, + `type Foo = import('foo').Foo;`, ], invalid: [ { @@ -123,5 +126,16 @@ ruleTester.run('no-unnecessary-type-arguments', rule, { output: `interface I { } class Impl implements I { }`, }, + { + code: `class Foo {} + const foo = new Foo();`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `class Foo {} + const foo = new Foo();`, + }, ], }); From 46b58b4e4d59ddd822774ff13cf1f815cb7423c8 Mon Sep 17 00:00:00 2001 From: Nikita Date: Mon, 18 Nov 2019 18:34:52 +0100 Subject: [PATCH 19/20] feat(eslint-plugin): add rule restrict-template-expressions (#850) Co-authored-by: Brad Zacher --- packages/eslint-plugin/README.md | 1 + .../rules/restrict-template-expressions.md | 69 ++++++ packages/eslint-plugin/src/configs/all.json | 1 + packages/eslint-plugin/src/rules/index.ts | 2 + .../rules/restrict-template-expressions.ts | 150 ++++++++++++ .../restrict-template-expressions.test.ts | 213 ++++++++++++++++++ 6 files changed, 436 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/restrict-template-expressions.md create mode 100644 packages/eslint-plugin/src/rules/restrict-template-expressions.ts create mode 100644 packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index 9f82b851d29b..4a7557f6f46c 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -200,6 +200,7 @@ Then you should add `airbnb` (or `airbnb-base`) to your `extends` section of `.e | [`@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 | :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/restrict-template-expressions`](./docs/rules/restrict-template-expressions.md) | Enforce template literal expressions to be of string type | | | :thought_balloon: | | [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | | [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | enforce consistent spacing before `function` definition opening parenthesis | | :wrench: | | | [`@typescript-eslint/strict-boolean-expressions`](./docs/rules/strict-boolean-expressions.md) | Restricts the types allowed in boolean expressions | | | :thought_balloon: | diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md new file mode 100644 index 000000000000..afd6976a227a --- /dev/null +++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -0,0 +1,69 @@ +# Enforce template literal expressions to be of string type. (restrict-template-expressions) + +Examples of **correct** code: + +```ts +const arg = 'foo'; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'default'}`; +``` + +Examples of **incorrect** code: + +```ts +const arg1 = [1, 2]; +const msg1 = `arg1 = ${arg1}`; + +const arg2 = { name: 'Foo' }; +const msg2 = `arg2 = ${arg2 || null}`; +``` + +## Options + +The rule accepts an options object with the following properties: + +```ts +type Options = { + // if true, also allow number type in template expressions + allowNumber?: boolean; + // if true, also allow boolean type in template expressions + allowBoolean?: boolean; + // if true, also allow null and undefined in template expressions + allowNullable?: boolean; +}; + +const defaults = { + allowNumber: false, + allowBoolean: false, + allowNullable: false, +}; +``` + +### allowNumber + +Examples of additional **correct** code for this rule with `{ allowNumber: true }`: + +```ts +const arg = 123; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'zero'}`; +``` + +### allowBoolean + +Examples of additional **correct** code for this rule with `{ allowBoolean: true }`: + +```ts +const arg = true; +const msg1 = `arg = ${arg}`; +const msg2 = `arg = ${arg || 'not truthy'}`; +``` + +### allowNullable + +Examples of additional **correct** code for this rule with `{ allowNullable: true }`: + +```ts +const arg = condition ? 'ok' : null; +const msg1 = `arg = ${arg}`; +``` diff --git a/packages/eslint-plugin/src/configs/all.json b/packages/eslint-plugin/src/configs/all.json index 23b38b458a3b..53d1cf8a87f6 100644 --- a/packages/eslint-plugin/src/configs/all.json +++ b/packages/eslint-plugin/src/configs/all.json @@ -75,6 +75,7 @@ "require-await": "off", "@typescript-eslint/require-await": "error", "@typescript-eslint/restrict-plus-operands": "error", + "@typescript-eslint/restrict-template-expressions": "error", "semi": "off", "@typescript-eslint/semi": "error", "space-before-function-paren": "off", diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 35f2d7582912..d706378e9340 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -57,6 +57,7 @@ import quotes from './quotes'; import requireArraySortCompare from './require-array-sort-compare'; import requireAwait from './require-await'; import restrictPlusOperands from './restrict-plus-operands'; +import restrictTemplateExpressions from './restrict-template-expressions'; import semi from './semi'; import spaceBeforeFunctionParen from './space-before-function-paren'; import strictBooleanExpressions from './strict-boolean-expressions'; @@ -128,6 +129,7 @@ export default { 'require-array-sort-compare': requireArraySortCompare, 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, + 'restrict-template-expressions': restrictTemplateExpressions, semi: semi, 'space-before-function-paren': spaceBeforeFunctionParen, 'strict-boolean-expressions': strictBooleanExpressions, diff --git a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts new file mode 100644 index 000000000000..199664036c99 --- /dev/null +++ b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts @@ -0,0 +1,150 @@ +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import ts from 'typescript'; +import * as util from '../util'; + +type Options = [ + { + allowNullable?: boolean; + allowNumber?: boolean; + allowBoolean?: boolean; + }, +]; + +type MessageId = 'invalidType'; + +export default util.createRule({ + name: 'restrict-template-expressions', + meta: { + type: 'problem', + docs: { + description: 'Enforce template literal expressions to be of string type', + category: 'Best Practices', + recommended: false, + requiresTypeChecking: true, + }, + messages: { + invalidType: 'Invalid type of template literal expression.', + }, + schema: [ + { + type: 'object', + properties: { + allowBoolean: { type: 'boolean' }, + allowNullable: { type: 'boolean' }, + allowNumber: { type: 'boolean' }, + }, + }, + ], + }, + defaultOptions: [{}], + create(context, [options]) { + const service = util.getParserServices(context); + const typeChecker = service.program.getTypeChecker(); + + type BaseType = + | 'string' + | 'number' + | 'bigint' + | 'boolean' + | 'null' + | 'undefined' + | 'other'; + + const allowedTypes: BaseType[] = [ + 'string', + ...(options.allowNumber ? (['number', 'bigint'] as const) : []), + ...(options.allowBoolean ? (['boolean'] as const) : []), + ...(options.allowNullable ? (['null', 'undefined'] as const) : []), + ]; + + function isAllowedType(types: BaseType[]): boolean { + for (const type of types) { + if (!allowedTypes.includes(type)) { + return false; + } + } + return true; + } + + return { + TemplateLiteral(node: TSESTree.TemplateLiteral): void { + // don't check tagged template literals + if (node.parent!.type === AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + + for (const expr of node.expressions) { + const type = getNodeType(expr); + if (!isAllowedType(type)) { + context.report({ + node: expr, + messageId: 'invalidType', + }); + } + } + }, + }; + + /** + * Helper function to get base type of node + * @param node the node to be evaluated. + */ + function getNodeType(node: TSESTree.Node): BaseType[] { + const tsNode = service.esTreeNodeToTSNodeMap.get(node); + const type = typeChecker.getTypeAtLocation(tsNode); + + return getBaseType(type); + } + + function getBaseType(type: ts.Type): BaseType[] { + const constraint = type.getConstraint(); + if ( + constraint && + // for generic types with union constraints, it will return itself + constraint !== type + ) { + return getBaseType(constraint); + } + + if (type.isStringLiteral()) { + return ['string']; + } + if (type.isNumberLiteral()) { + return ['number']; + } + if (type.flags & ts.TypeFlags.BigIntLiteral) { + return ['bigint']; + } + if (type.flags & ts.TypeFlags.BooleanLiteral) { + return ['boolean']; + } + if (type.flags & ts.TypeFlags.Null) { + return ['null']; + } + if (type.flags & ts.TypeFlags.Undefined) { + return ['undefined']; + } + + if (type.isUnion()) { + return type.types + .map(getBaseType) + .reduce((all, array) => [...all, ...array], []); + } + + const stringType = typeChecker.typeToString(type); + if ( + stringType === 'string' || + stringType === 'number' || + stringType === 'bigint' || + stringType === 'boolean' + ) { + return [stringType]; + } + + return ['other']; + } + }, +}); diff --git a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts new file mode 100644 index 000000000000..ef7657d6a002 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts @@ -0,0 +1,213 @@ +import path from 'path'; +import rule from '../../src/rules/restrict-template-expressions'; +import { RuleTester } from '../RuleTester'; + +const rootPath = path.join(process.cwd(), 'tests/fixtures/'); + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: rootPath, + project: './tsconfig.json', + }, +}); + +ruleTester.run('restrict-template-expressions', rule, { + valid: [ + // Base case + ` + const msg = \`arg = \${"foo"}\`; + `, + ` + const arg = "foo"; + const msg = \`arg = \${arg}\`; + `, + ` + const arg = "foo"; + const msg = \`arg = \${arg || "default"}\`; + `, + ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + // Base case - don't check tagged templates + ` + tag\`arg = \${null}\`; + `, + ` + const arg = {}; + tag\`arg = \${arg}\`; + `, + // allowNumber + { + options: [{ allowNumber: true }], + code: ` + const arg = 123; + const msg = \`arg = \${arg}\`; + `, + }, + { + options: [{ allowNumber: true }], + code: ` + const arg = 123; + const msg = \`arg = \${arg || "default"}\`; + `, + }, + { + options: [{ allowNumber: true }], + code: ` + const arg = 123n; + const msg = \`arg = \${arg || "default"}\`; + `, + }, + { + options: [{ allowNumber: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + { + options: [{ allowNumber: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + { + options: [{ allowNumber: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + // allowBoolean + { + options: [{ allowBoolean: true }], + code: ` + const arg = true; + const msg = \`arg = \${arg}\`; + `, + }, + { + options: [{ allowBoolean: true }], + code: ` + const arg = true; + const msg = \`arg = \${arg || "default"}\`; + `, + }, + { + options: [{ allowBoolean: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + { + options: [{ allowBoolean: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + // allowNullable + { + options: [{ allowNullable: true }], + code: ` + const arg = null; + const msg = \`arg = \${arg}\`; + `, + }, + { + options: [{ allowNullable: true }], + code: ` + declare const arg: string | null | undefined; + const msg = \`arg = \${arg}\`; + `, + }, + { + options: [{ allowNullable: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + { + options: [{ allowNullable: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + // allow ALL + { + options: [{ allowNumber: true, allowBoolean: true, allowNullable: true }], + code: ` + type All = string | number | boolean | null | undefined + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + }, + ], + + invalid: [ + { + code: ` + const msg = \`arg = \${123}\`; + `, + errors: [{ messageId: 'invalidType', line: 2, column: 30 }], + }, + { + code: ` + const msg = \`arg = \${false}\`; + `, + errors: [{ messageId: 'invalidType', line: 2, column: 30 }], + }, + { + code: ` + const msg = \`arg = \${null}\`; + `, + errors: [{ messageId: 'invalidType', line: 2, column: 30 }], + }, + { + code: ` + declare const arg: number; + const msg = \`arg = \${arg}\`; + `, + errors: [{ messageId: 'invalidType', line: 3, column: 30 }], + }, + { + code: ` + declare const arg: boolean; + const msg = \`arg = \${arg}\`; + `, + errors: [{ messageId: 'invalidType', line: 3, column: 30 }], + }, + { + options: [{ allowNumber: true, allowBoolean: true, allowNullable: true }], + code: ` + const arg = {}; + const msg = \`arg = \${arg}\`; + `, + errors: [{ messageId: 'invalidType', line: 3, column: 30 }], + }, + { + options: [{ allowNumber: true, allowBoolean: true, allowNullable: true }], + code: ` + function test(arg: T) { + return \`arg = \${arg}\`; + } + `, + errors: [{ messageId: 'invalidType', line: 3, column: 27 }], + }, + ], +}); From a9117f525e457966a718164ae6cf7ad086c0dd7b Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 18 Nov 2019 18:01:43 +0000 Subject: [PATCH 20/20] chore: publish v2.8.0 --- CHANGELOG.md | 31 ++++++++++++++++++++++ lerna.json | 2 +- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++ packages/eslint-plugin-tslint/package.json | 6 ++--- packages/eslint-plugin/CHANGELOG.md | 29 ++++++++++++++++++++ packages/eslint-plugin/package.json | 4 +-- packages/experimental-utils/CHANGELOG.md | 8 ++++++ packages/experimental-utils/package.json | 4 +-- packages/parser/CHANGELOG.md | 11 ++++++++ packages/parser/package.json | 8 +++--- packages/shared-fixtures/CHANGELOG.md | 8 ++++++ packages/shared-fixtures/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 13 +++++++++ packages/typescript-estree/package.json | 4 +-- 14 files changed, 123 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f800e619f2dc..f5b8fddd22bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,37 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + + +### Bug Fixes + +* **eslint-plugin:** [camelcase] handle optional member expr ([#1204](https://github.com/typescript-eslint/typescript-eslint/issues/1204)) ([9c8203f](https://github.com/typescript-eslint/typescript-eslint/commit/9c8203f)) +* **eslint-plugin:** [indent] fix decorator type ([#1189](https://github.com/typescript-eslint/typescript-eslint/issues/1189)) ([e2008e3](https://github.com/typescript-eslint/typescript-eslint/commit/e2008e3)) +* **eslint-plugin:** [indent] handle empty generic declarations ([#1211](https://github.com/typescript-eslint/typescript-eslint/issues/1211)) ([9aee06c](https://github.com/typescript-eslint/typescript-eslint/commit/9aee06c)) +* **eslint-plugin:** [no-type-alias] handle constructor aliases ([#1198](https://github.com/typescript-eslint/typescript-eslint/issues/1198)) ([1bb4d63](https://github.com/typescript-eslint/typescript-eslint/commit/1bb4d63)) +* **eslint-plugin:** [no-unnec-type-arg] throwing on call/new expr ([#1217](https://github.com/typescript-eslint/typescript-eslint/issues/1217)) ([42a48de](https://github.com/typescript-eslint/typescript-eslint/commit/42a48de)) +* **eslint-plugin:** [no-unnecessary-cond] fix naked type param ([#1207](https://github.com/typescript-eslint/typescript-eslint/issues/1207)) ([4fac6c5](https://github.com/typescript-eslint/typescript-eslint/commit/4fac6c5)) +* **eslint-plugin:** [nuta] correctly handle null/undefined separation ([#1201](https://github.com/typescript-eslint/typescript-eslint/issues/1201)) ([9829dd3](https://github.com/typescript-eslint/typescript-eslint/commit/9829dd3)) +* **eslint-plugin:** [require-await] better handle nesting ([#1193](https://github.com/typescript-eslint/typescript-eslint/issues/1193)) ([eb83af1](https://github.com/typescript-eslint/typescript-eslint/commit/eb83af1)) +* **eslint-plugin:** [unified-signatures] crash: cannot read pro… ([#1096](https://github.com/typescript-eslint/typescript-eslint/issues/1096)) ([d1de3a7](https://github.com/typescript-eslint/typescript-eslint/commit/d1de3a7)) +* **eslint-plugin:** disable base no-unused-expressions in all config ([ecb3f4e](https://github.com/typescript-eslint/typescript-eslint/commit/ecb3f4e)) +* **typescript-estree:** correctly account for trailing slash in… ([#1205](https://github.com/typescript-eslint/typescript-eslint/issues/1205)) ([ba89168](https://github.com/typescript-eslint/typescript-eslint/commit/ba89168)) +* **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) + + +### Features + +* **eslint-plugin:** [no-type-alias] handle conditional types ([#953](https://github.com/typescript-eslint/typescript-eslint/issues/953)) ([259ff20](https://github.com/typescript-eslint/typescript-eslint/commit/259ff20)) +* **eslint-plugin:** add rule restrict-template-expressions ([#850](https://github.com/typescript-eslint/typescript-eslint/issues/850)) ([46b58b4](https://github.com/typescript-eslint/typescript-eslint/commit/46b58b4)) +* **eslint-plugin:** add space-before-function-paren [extension] ([#924](https://github.com/typescript-eslint/typescript-eslint/issues/924)) ([d8b07a7](https://github.com/typescript-eslint/typescript-eslint/commit/d8b07a7)) +* **eslint-plugin:** added new rule no-dynamic-delete ([#565](https://github.com/typescript-eslint/typescript-eslint/issues/565)) ([864c811](https://github.com/typescript-eslint/typescript-eslint/commit/864c811)) +* **eslint-plugin:** added new rule no-untyped-public-signature ([#801](https://github.com/typescript-eslint/typescript-eslint/issues/801)) ([c5835f3](https://github.com/typescript-eslint/typescript-eslint/commit/c5835f3)) + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) diff --git a/lerna.json b/lerna.json index 991899f51336..2eec75f4f591 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.0", + "version": "2.8.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 9613287c0606..7b7467bd4579 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index b23071880ad8..631e7d54ad4c 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": "2.7.0", + "version": "2.8.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -31,7 +31,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.7.0", + "@typescript-eslint/experimental-utils": "2.8.0", "lodash.memoize": "^4.1.2" }, "peerDependencies": { @@ -41,6 +41,6 @@ }, "devDependencies": { "@types/lodash.memoize": "^4.1.4", - "@typescript-eslint/parser": "2.7.0" + "@typescript-eslint/parser": "2.8.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 1759b88a3c13..295a43be6cc8 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + + +### Bug Fixes + +* **eslint-plugin:** [camelcase] handle optional member expr ([#1204](https://github.com/typescript-eslint/typescript-eslint/issues/1204)) ([9c8203f](https://github.com/typescript-eslint/typescript-eslint/commit/9c8203f)) +* **eslint-plugin:** [indent] fix decorator type ([#1189](https://github.com/typescript-eslint/typescript-eslint/issues/1189)) ([e2008e3](https://github.com/typescript-eslint/typescript-eslint/commit/e2008e3)) +* **eslint-plugin:** [indent] handle empty generic declarations ([#1211](https://github.com/typescript-eslint/typescript-eslint/issues/1211)) ([9aee06c](https://github.com/typescript-eslint/typescript-eslint/commit/9aee06c)) +* **eslint-plugin:** [no-type-alias] handle constructor aliases ([#1198](https://github.com/typescript-eslint/typescript-eslint/issues/1198)) ([1bb4d63](https://github.com/typescript-eslint/typescript-eslint/commit/1bb4d63)) +* **eslint-plugin:** [no-unnec-type-arg] throwing on call/new expr ([#1217](https://github.com/typescript-eslint/typescript-eslint/issues/1217)) ([42a48de](https://github.com/typescript-eslint/typescript-eslint/commit/42a48de)) +* **eslint-plugin:** [no-unnecessary-cond] fix naked type param ([#1207](https://github.com/typescript-eslint/typescript-eslint/issues/1207)) ([4fac6c5](https://github.com/typescript-eslint/typescript-eslint/commit/4fac6c5)) +* **eslint-plugin:** [nuta] correctly handle null/undefined separation ([#1201](https://github.com/typescript-eslint/typescript-eslint/issues/1201)) ([9829dd3](https://github.com/typescript-eslint/typescript-eslint/commit/9829dd3)) +* **eslint-plugin:** [require-await] better handle nesting ([#1193](https://github.com/typescript-eslint/typescript-eslint/issues/1193)) ([eb83af1](https://github.com/typescript-eslint/typescript-eslint/commit/eb83af1)) +* **eslint-plugin:** [unified-signatures] crash: cannot read pro… ([#1096](https://github.com/typescript-eslint/typescript-eslint/issues/1096)) ([d1de3a7](https://github.com/typescript-eslint/typescript-eslint/commit/d1de3a7)) +* **eslint-plugin:** disable base no-unused-expressions in all config ([ecb3f4e](https://github.com/typescript-eslint/typescript-eslint/commit/ecb3f4e)) + + +### Features + +* **eslint-plugin:** [no-type-alias] handle conditional types ([#953](https://github.com/typescript-eslint/typescript-eslint/issues/953)) ([259ff20](https://github.com/typescript-eslint/typescript-eslint/commit/259ff20)) +* **eslint-plugin:** add rule restrict-template-expressions ([#850](https://github.com/typescript-eslint/typescript-eslint/issues/850)) ([46b58b4](https://github.com/typescript-eslint/typescript-eslint/commit/46b58b4)) +* **eslint-plugin:** add space-before-function-paren [extension] ([#924](https://github.com/typescript-eslint/typescript-eslint/issues/924)) ([d8b07a7](https://github.com/typescript-eslint/typescript-eslint/commit/d8b07a7)) +* **eslint-plugin:** added new rule no-dynamic-delete ([#565](https://github.com/typescript-eslint/typescript-eslint/issues/565)) ([864c811](https://github.com/typescript-eslint/typescript-eslint/commit/864c811)) +* **eslint-plugin:** added new rule no-untyped-public-signature ([#801](https://github.com/typescript-eslint/typescript-eslint/issues/801)) ([c5835f3](https://github.com/typescript-eslint/typescript-eslint/commit/c5835f3)) + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 17eb148ab351..0a84ab84ddbb 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "2.7.0", + "version": "2.8.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -40,7 +40,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.7.0", + "@typescript-eslint/experimental-utils": "2.8.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index fa483c6bd8f4..719fea3d87b8 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 2bbb6ddc9ec3..5fef538da56c 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "2.7.0", + "version": "2.8.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": "2.7.0", + "@typescript-eslint/typescript-estree": "2.8.0", "eslint-scope": "^5.0.0" }, "peerDependencies": { diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 45ba8b728f68..cd1688d72e5b 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + + +### Bug Fixes + +* **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) diff --git a/packages/parser/package.json b/packages/parser/package.json index 0511697a88c4..d494917898c8 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "2.7.0", + "version": "2.8.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -43,13 +43,13 @@ }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.7.0", - "@typescript-eslint/typescript-estree": "2.7.0", + "@typescript-eslint/experimental-utils": "2.8.0", + "@typescript-eslint/typescript-estree": "2.8.0", "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "2.7.0", + "@typescript-eslint/shared-fixtures": "2.8.0", "glob": "*" } } diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index aa253e3d46ee..4b84a123ae34 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) **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 c457e83d4dd3..dd930d1575d1 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "2.7.0", + "version": "2.8.0", "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 28d91bddc6b1..8500277af65c 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) + + +### Bug Fixes + +* **eslint-plugin:** [unified-signatures] crash: cannot read pro… ([#1096](https://github.com/typescript-eslint/typescript-eslint/issues/1096)) ([d1de3a7](https://github.com/typescript-eslint/typescript-eslint/commit/d1de3a7)) +* **typescript-estree:** correctly account for trailing slash in… ([#1205](https://github.com/typescript-eslint/typescript-eslint/issues/1205)) ([ba89168](https://github.com/typescript-eslint/typescript-eslint/commit/ba89168)) +* **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) + + + + + # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index ac09e4972272..c169fad437e6 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "2.7.0", + "version": "2.8.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -59,7 +59,7 @@ "@types/lodash.unescape": "^4.0.4", "@types/semver": "^6.2.0", "@types/tmp": "^0.1.0", - "@typescript-eslint/shared-fixtures": "2.7.0", + "@typescript-eslint/shared-fixtures": "2.8.0", "babel-code-frame": "^6.26.0", "lodash.isplainobject": "4.0.6", "tmp": "^0.1.0",