From eaaa471beb96caf57a9f3c69d436bf2046ad413a Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 25 Feb 2019 09:04:54 -0500 Subject: [PATCH 1/8] fix: trigger new release --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab38f5e7a59..0aef0f23d0b 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,6 @@ If you use a non-supported version of TypeScript, the parser will log a warning **Please ensure that you are using a supported version before submitting any issues/bug reports.** -## Contributing - -COMING SOON! - ## License TypeScript ESLint inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. @@ -63,3 +59,7 @@ TypeScript ESLint inherits from the the original TypeScript ESLint Parser licens ## Contributors Thanks goes to the wonderful people listed in [`CONTRIBUTORS.md`](./CONTRIBUTORS.md). + +## Contributing Guide + +COMING SOON! From 2f4276fcb55b6a8ad6019c941648f44a434c9afa Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 25 Feb 2019 09:05:13 -0500 Subject: [PATCH 2/8] chore: publish v1.4.2 --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/eslint-plugin-tslint/CHANGELOG.md | 4 ++++ packages/eslint-plugin-tslint/package.json | 4 ++-- packages/eslint-plugin/CHANGELOG.md | 4 ++++ packages/eslint-plugin/package.json | 6 +++--- packages/parser/CHANGELOG.md | 4 ++++ packages/parser/package.json | 6 +++--- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 4 ++++ packages/typescript-estree/package.json | 4 ++-- 12 files changed, 42 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb91349b810..19e950868dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +### Bug Fixes + +- trigger new release ([eaaa471](https://github.com/typescript-eslint/typescript-eslint/commit/eaaa471)) + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) ### Bug Fixes diff --git a/lerna.json b/lerna.json index bbbc1c975b8..06b203850da 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.4.1", + "version": "1.4.2", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 0e51b5ccf75..eaa8acd6892 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) **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 c412989d549..955573693fe 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "1.4.1", + "version": "1.4.2", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -35,6 +35,6 @@ "devDependencies": { "@types/eslint": "^4.16.3", "@types/lodash.memoize": "^4.1.4", - "@typescript-eslint/parser": "1.4.1" + "@typescript-eslint/parser": "1.4.2" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 8bbf10f4a2b..c4c8d82eb58 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) ### Bug Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index ca82d78f6fb..95c90865e32 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "1.4.1", + "version": "1.4.2", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -35,8 +35,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/parser": "1.4.1", - "@typescript-eslint/typescript-estree": "1.4.1", + "@typescript-eslint/parser": "1.4.2", + "@typescript-eslint/typescript-estree": "1.4.2", "requireindex": "^1.2.0", "tsutils": "^3.7.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 3bba55647a4..30591e33637 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/parser + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index 3f9e52628a2..78dcd57c077 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "1.4.1", + "version": "1.4.2", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/parser.js", "files": [ @@ -37,13 +37,13 @@ "typescript": "*" }, "dependencies": { - "@typescript-eslint/typescript-estree": "1.4.1", + "@typescript-eslint/typescript-estree": "1.4.2", "eslint-scope": "^4.0.0", "eslint-visitor-keys": "^1.0.0" }, "devDependencies": { "@types/eslint": "^4.16.5", "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/shared-fixtures": "1.4.1" + "@typescript-eslint/shared-fixtures": "1.4.2" } } diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index a2f78595c1e..61c52cc2bd9 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. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) **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 4ecb32d4184..ce8b8ae975f 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "1.4.1", + "version": "1.4.2", "private": true } diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index fafdfdf6e44..9326f0eb6c9 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 40106ba1dd2..23188c301b9 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "1.4.1", + "version": "1.4.2", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -44,6 +44,6 @@ }, "devDependencies": { "@babel/types": "^7.3.2", - "@typescript-eslint/shared-fixtures": "1.4.1" + "@typescript-eslint/shared-fixtures": "1.4.2" } } From 00eae48cd64028238720e239f9ee04807c4311c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Sun, 3 Mar 2019 00:51:53 +0800 Subject: [PATCH 3/8] docs(eslint-plugin): fix no-useless-constructor examples (#329) it should be the plugin rule name, than eslint core rule name. --- packages/eslint-plugin/docs/rules/no-useless-constructor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index 0e136d122ac..821f6a5d105 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -23,7 +23,7 @@ This rule flags class constructors that can be safely removed without changing h Examples of **incorrect** code for this rule: ```js -/*eslint no-useless-constructor: "error"*/ +/*eslint @typescript-eslint/no-useless-constructor: "error"*/ class A { constructor() {} @@ -39,7 +39,7 @@ class A extends B { Examples of **correct** code for this rule: ```js -/*eslint no-useless-constructor: "error"*/ +/*eslint @typescript-eslint/no-useless-constructor: "error"*/ class A {} From 097262f6f800c387724143808e17608c0cced743 Mon Sep 17 00:00:00 2001 From: Cameron Crothers Date: Thu, 7 Mar 2019 03:11:02 +1100 Subject: [PATCH 4/8] fix(eslint-plugin): [interface-name-prefix] correct error message in always mode (#333) interface-name-prefix currenlty provides 'Interface name must not be prefixed with "I".' but when in always mode it should give an error message that matches the intent, added 'Interface name must be prefixed with "I".' for when "always" is enabled --- packages/eslint-plugin/src/rules/interface-name-prefix.ts | 5 +++-- .../eslint-plugin/tests/rules/interface-name-prefix.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/src/rules/interface-name-prefix.ts b/packages/eslint-plugin/src/rules/interface-name-prefix.ts index 175cbf41c3b..b9c3b91a052 100644 --- a/packages/eslint-plugin/src/rules/interface-name-prefix.ts +++ b/packages/eslint-plugin/src/rules/interface-name-prefix.ts @@ -1,7 +1,7 @@ import * as util from '../util'; type Options = ['never' | 'always']; -type MessageIds = 'noPrefix'; +type MessageIds = 'noPrefix' | 'alwaysPrefix'; export default util.createRule({ name: 'interface-name-prefix', @@ -15,6 +15,7 @@ export default util.createRule({ }, messages: { noPrefix: 'Interface name must not be prefixed with "I".', + alwaysPrefix: 'Interface name must be prefixed with "I".', }, schema: [ { @@ -51,7 +52,7 @@ export default util.createRule({ if (!isPrefixedWithI(node.id.name)) { context.report({ node: node.id, - messageId: 'noPrefix', + messageId: 'alwaysPrefix', }); } } diff --git a/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts b/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts index d954d160fa9..09cf548c7ac 100644 --- a/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts +++ b/packages/eslint-plugin/tests/rules/interface-name-prefix.test.ts @@ -77,7 +77,7 @@ interface Animal { options: ['always'], errors: [ { - messageId: 'noPrefix', + messageId: 'alwaysPrefix', line: 2, column: 11, }, @@ -92,7 +92,7 @@ interface Iguana { options: ['always'], errors: [ { - messageId: 'noPrefix', + messageId: 'alwaysPrefix', line: 2, column: 11, }, From b66363a017d4c9922e31f52e22f8eabf2bd69b82 Mon Sep 17 00:00:00 2001 From: Gavin Barron Date: Fri, 8 Mar 2019 08:33:52 -0800 Subject: [PATCH 5/8] deps(*): Update jest (#337) fixes #336 --- package.json | 2 +- yarn.lock | 841 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 490 insertions(+), 353 deletions(-) diff --git a/package.json b/package.json index 4e2eff52b00..57a5e6124b0 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "glob": "7.1.2", "husky": "^1.3.1", "isomorphic-fetch": "^2.2.1", - "jest": "24.1.0", + "jest": "24.3.0", "lerna": "^3.10.5", "lint-staged": "8.1.0", "lodash.isplainobject": "4.0.6", diff --git a/yarn.lock b/yarn.lock index fe9efe6c836..40864e48b49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -96,6 +96,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.3.tgz#092d450db02bdb6ccb1ca8ffd47d8774a91aef87" integrity sha512-xsH1CJoln2r74hR+y7cg2B5JCPaTh+Hd+EbBRk9nWGSNspuo6krjhX0Om6RnRQuIvFq8wVXCLKH3kwKDYhanSg== +"@babel/parser@^7.1.0": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" + integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== + "@babel/plugin-syntax-object-rest-spread@^7.0.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" @@ -143,6 +148,14 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + "@commitlint/cli@^7.1.2", "@commitlint/cli@^7.5.2": version "7.5.2" resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.5.2.tgz#2475cd8f7ed3b2f9c2ab96c06bc24d61d23f8716" @@ -297,6 +310,143 @@ log-update "^2.3.0" strip-ansi "^3.0.1" +"@jest/console@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.3.0.tgz#7bd920d250988ba0bf1352c4493a48e1cb97671e" + integrity sha512-NaCty/OOei6rSDcbPdMiCbYCI0KGFGPgGO6B09lwWt5QTxnkuhKYET9El5u5z1GAcSxkQmSMtM63e24YabCWqA== + dependencies: + "@jest/source-map" "^24.3.0" + "@types/node" "*" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.3.0.tgz#ae5732af96567205d79ed97dc0b9b9033acea298" + integrity sha512-kGnyXAEjFPK4SfikxyrugXZ/SpWYmA09jMOvZRxeRfarVy+yIE6NkilRA85MRqR2qOcQhWgZ48T3KXEVPZC1zw== + dependencies: + "@jest/console" "^24.3.0" + "@jest/reporters" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/transform" "^24.3.0" + "@jest/types" "^24.3.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.3.0" + jest-config "^24.3.0" + jest-haste-map "^24.3.0" + jest-message-util "^24.3.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.3.0" + jest-runner "^24.3.0" + jest-runtime "^24.3.0" + jest-snapshot "^24.3.0" + jest-util "^24.3.0" + jest-validate "^24.3.0" + jest-watcher "^24.3.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.3.0.tgz#45e7c5cc996cb8f2287a30f8de08b152fa226fe2" + integrity sha512-rPrnhX3cBvGqODfd6aUsCruUijVp2tmBC0YfeXIku0MciQSR9ek5tjdEk31iBvxE9WlGQus+E/slRLqJmCRZTw== + dependencies: + "@jest/fake-timers" "^24.3.0" + "@jest/transform" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/node" "*" + jest-mock "^24.3.0" + +"@jest/fake-timers@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.3.0.tgz#0a7f8b877b78780c3fa5c3f8683cc0aaf9488331" + integrity sha512-rHwVI17dGMHxHzfAhnZ04+wFznjFfZ246QugeBnbiYr7/bDosPD2P1qeNjWnJUUcfl0HpS6kkr+OB/mqSJxQFg== + dependencies: + "@jest/types" "^24.3.0" + "@types/node" "*" + jest-message-util "^24.3.0" + jest-mock "^24.3.0" + +"@jest/reporters@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.3.0.tgz#beaa8b7d0148db8438a12102daf4d36268a150f5" + integrity sha512-/Gwdcej9x4QuhFIWTKyiiMLAMzfCtIIvuk2AnreqmuxLRAyUbkR5BoUoPvwowKVyZn20ZdCG5Qf7/KaoHhCG8Q== + dependencies: + "@jest/environment" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/transform" "^24.3.0" + "@jest/types" "^24.3.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-api "^2.1.1" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-source-maps "^3.0.1" + jest-haste-map "^24.3.0" + jest-resolve "^24.3.0" + jest-runtime "^24.3.0" + jest-util "^24.3.0" + jest-worker "^24.3.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.3.0.tgz#4c0b1c9716212111920f7cf8c4329c69bc81924a" + integrity sha512-j7UZ49T8C4CVipEY99nLttnczVTtLyVzFfN20OiBVn7awOs0U3endXSTq7ouPrLR5y4YjI5GDcbcvDUjgeamzg== + dependencies: + "@jest/console" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/istanbul-lib-coverage" "^1.1.0" + +"@jest/transform@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.3.0.tgz#a18bfd18f25ca28566f5bc398551c047199f4c75" + integrity sha512-qrOIa34c+C5kqABGslBz7Lcwi9qbksO9/XcoCcYWD6AnrOmVUBRZSFHzo7Enk5iHUXRGnVnXvb8AyBXKlwpdGQ== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.3.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.3.0" + jest-regex-util "^24.3.0" + jest-util "^24.3.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.3.0.tgz#3f6e117e47248a9a6b5f1357ec645bd364f7ad23" + integrity sha512-VoO1F5tU2n/93QN/zaZ7Q8SeV/Rj+9JJOgbvKbBwy4lenvmdj1iDaQEPXGTKrO6OSvDeb2drTFipZJYxgo6kIQ== + dependencies: + "@types/istanbul-lib-coverage" "^1.1.0" + "@types/yargs" "^12.0.9" + "@lerna/add@3.13.0": version "3.13.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.13.0.tgz#e971a17c1f85cba40f22c816a2bb9d855b62d07d" @@ -991,6 +1141,39 @@ resolved "https://registry.yarnpkg.com/@types/babel-code-frame/-/babel-code-frame-6.20.2.tgz#d923c88d94e66b864fd3693f07b18ad78489a222" integrity sha512-HAdhFeYOZKIkrR2jbonCJxp3I/o2G/kxY+CIx7qX9Kmv5jY+9D7OgmgSLdRqeHacB5RlqE5efj2WIDFL9NXCyg== +"@types/babel__core@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" + integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + "@types/eslint-visitor-keys@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" @@ -1023,6 +1206,11 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/istanbul-lib-coverage@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#2cc2ca41051498382b43157c8227fea60363f94a" + integrity sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ== + "@types/jest-diff@*": version "20.0.1" resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" @@ -1086,6 +1274,16 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== +"@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" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.9" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0" + integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== + JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -1389,13 +1587,16 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-jest@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" - integrity sha512-MLcagnVrO9ybQGLEfZUqnOzv36iQzU7Bj4elm39vCukumLVSfoX+tRy3/jW7lUKc7XdpRmB/jech6L/UCsSZjw== +babel-jest@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.3.0.tgz#4f484d1a13e1be1b349e715cc41ad34fbe770ad7" + integrity sha512-YH62Flana1vImnB3Q59R9t7PzMUbFTlhI4KR/Ri/5hshm+WgxCTuFS8N2uSvEhQXcvzkhrvjBBciJWzOb+4rOA== dependencies: + "@jest/transform" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.1.0" + babel-preset-jest "^24.3.0" chalk "^2.4.2" slash "^2.0.0" @@ -1408,10 +1609,12 @@ babel-plugin-istanbul@^5.1.0: istanbul-lib-instrument "^3.0.0" test-exclude "^5.0.0" -babel-plugin-jest-hoist@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" - integrity sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw== +babel-plugin-jest-hoist@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz#f2e82952946f6e40bb0a75d266a3790d854c8b5b" + integrity sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w== + dependencies: + "@types/babel__traverse" "^7.0.6" babel-polyfill@6.26.0: version "6.26.0" @@ -1422,13 +1625,13 @@ babel-polyfill@6.26.0: core-js "^2.5.0" regenerator-runtime "^0.10.5" -babel-preset-jest@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" - integrity sha512-FfNLDxFWsNX9lUmtwY7NheGlANnagvxq8LZdl5PKnVG3umP+S/g0XbVBfwtA4Ai3Ri/IMkWabBz3Tyk9wdspcw== +babel-preset-jest@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz#db88497e18869f15b24d9c0e547d8e0ab950796d" + integrity sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw== dependencies: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.1.0" + babel-plugin-jest-hoist "^24.3.0" babel-runtime@6.26.0, babel-runtime@^6.23.0, babel-runtime@^6.26.0: version "6.26.0" @@ -2143,7 +2346,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: +debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -2192,11 +2395,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -2277,11 +2475,6 @@ detect-indent@^5.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -2295,10 +2488,10 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -diff-sequences@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.0.0.tgz#cdf8e27ed20d8b8d3caccb4e0c0d8fe31a173013" - integrity sha512-46OkIuVGBBnrC0soO/4LHu5LHGHx0uhP65OVz8XOrAJpqiCB2aVIuESvjI1F9oqebuvY8lekS1pt6TN7vt7qsw== +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== diff@^3.1.0, diff@^3.2.0, diff@^3.5.0: version "3.5.0" @@ -2575,12 +2768,10 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= -exec-sh@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" - integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== - dependencies: - merge "^1.2.0" +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== execa@0.9.0: version "0.9.0" @@ -2639,16 +2830,17 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.1.0.tgz#88e73301c4c785cde5f16da130ab407bdaf8c0f2" - integrity sha512-lVcAPhaYkQcIyMS+F8RVwzbm1jro20IG8OkvxQ6f1JfqhVZyyudCwYogQ7wnktlf14iF3ii7ArIUO/mqvrW9Gw== +expect@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.3.0.tgz#84c2bff9d3eaf4ffe088ec13e84a7d7a8d014945" + integrity sha512-maPswEFJ1mJaa3Hx0aeyiqlf/FhJnvTyCzeksmqHGgWyM8m+cIhf1t5Gz8qIRdJPm0m4XPiin/0wxdru2l+hCw== dependencies: + "@jest/types" "^24.3.0" ansi-styles "^3.2.0" - jest-get-type "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" + jest-get-type "^24.3.0" + jest-matcher-utils "^24.3.0" + jest-message-util "^24.3.0" + jest-regex-util "^24.3.0" extend-shallow@^2.0.1: version "2.0.1" @@ -2896,14 +3088,6 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.2.3: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - fstream@^1.0.0, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" @@ -3309,7 +3493,7 @@ husky@^1.3.1: run-node "^1.0.0" slash "^2.0.0" -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -3400,7 +3584,7 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -3748,7 +3932,7 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-api@^2.0.8: +istanbul-api@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-2.1.1.tgz#194b773f6d9cbc99a9258446848b0f988951c4d0" integrity sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw== @@ -3819,299 +4003,308 @@ istanbul-reports@^2.1.1: dependencies: handlebars "^4.1.0" -jest-changed-files@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.0.0.tgz#c02c09a8cc9ca93f513166bc773741bd39898ff7" - integrity sha512-nnuU510R9U+UX0WNb5XFEcsrMqriSiRLeO9KWDFgPrpToaQm60prfQYpxsXigdClpvNot5bekDY440x9dNGnsQ== +jest-changed-files@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.3.0.tgz#7050ae29aaf1d59437c80f21d5b3cd354e88a499" + integrity sha512-fTq0YAUR6644fgsqLC7Zi2gXA/bAplMRvfXQdutmkwgrCKK6upkj+sgXqsUfUZRm15CVr3YSojr/GRNn71IMvg== dependencies: + "@jest/types" "^24.3.0" execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.1.0.tgz#f7cc98995f36e7210cce3cbb12974cbf60940843" - integrity sha512-U/iyWPwOI0T1CIxVLtk/2uviOTJ/OiSWJSe8qt6X1VkbbgP+nrtLJlmT9lPBe4lK78VNFJtrJ7pttcNv/s7yCw== +jest-cli@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.3.0.tgz#b180ac1d3d0188d38d528268d99413e21baa8f64" + integrity sha512-FNGfJItAiXuJJBSZIQzaLCb63/BIAUEyucGf892Vg2n/dyk1M7O+o6YPFtwWOHMwVXX873MLsINBUbFNt1ugLQ== dependencies: - ansi-escapes "^3.0.0" + "@jest/core" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.1.15" import-local "^2.0.0" is-ci "^2.0.0" - istanbul-api "^2.0.8" - istanbul-lib-coverage "^2.0.2" - istanbul-lib-instrument "^3.0.1" - istanbul-lib-source-maps "^3.0.1" - jest-changed-files "^24.0.0" - jest-config "^24.1.0" - jest-environment-jsdom "^24.0.0" - jest-get-type "^24.0.0" - jest-haste-map "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" - jest-resolve-dependencies "^24.1.0" - jest-runner "^24.1.0" - jest-runtime "^24.1.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" - jest-watcher "^24.0.0" - jest-worker "^24.0.0" - micromatch "^3.1.10" - node-notifier "^5.2.1" - p-each-series "^1.0.0" - pirates "^4.0.0" + jest-config "^24.3.0" + jest-util "^24.3.0" + jest-validate "^24.3.0" prompts "^2.0.1" - realpath-native "^1.0.0" - rimraf "^2.5.4" - slash "^2.0.0" - string-length "^2.0.0" - strip-ansi "^5.0.0" - which "^1.2.12" + realpath-native "^1.1.0" yargs "^12.0.2" -jest-config@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.1.0.tgz#6ea6881cfdd299bc86cc144ee36d937c97c3850c" - integrity sha512-FbbRzRqtFC6eGjG5VwsbW4E5dW3zqJKLWYiZWhB0/4E5fgsMw8GODLbGSrY5t17kKOtCWb/Z7nsIThRoDpuVyg== +jest-config@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.3.0.tgz#d12296b5a8f700b13fb31eaea7c30f5473aab1a5" + integrity sha512-GrPEBZ1nIQ6KnHHNiQYN30ekJG+w7l2IWRctCQUDKbmV5IE5bnirz8tHpMzkTHyClZH2g1NcvW2tUX0Glqgp4A== dependencies: "@babel/core" "^7.1.0" - babel-jest "^24.1.0" + "@jest/types" "^24.3.0" + babel-jest "^24.3.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.0.0" - jest-environment-node "^24.0.0" - jest-get-type "^24.0.0" - jest-jasmine2 "^24.1.0" - jest-regex-util "^24.0.0" - jest-resolve "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" + jest-environment-jsdom "^24.3.0" + jest-environment-node "^24.3.0" + jest-get-type "^24.3.0" + jest-jasmine2 "^24.3.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.3.0" + jest-util "^24.3.0" + jest-validate "^24.3.0" micromatch "^3.1.10" - pretty-format "^24.0.0" - realpath-native "^1.0.2" + pretty-format "^24.3.0" + realpath-native "^1.1.0" -jest-diff@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.0.0.tgz#a3e5f573dbac482f7d9513ac9cfa21644d3d6b34" - integrity sha512-XY5wMpRaTsuMoU+1/B2zQSKQ9RdE9gsLkGydx3nvApeyPijLA8GtEvIcPwISRCer+VDf9W1mStTYYq6fPt8ryA== +jest-diff@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.3.0.tgz#38a76ccc52130e6d273ef952e4bac358924be8a6" + integrity sha512-B3FHbTaQObcew5H639Ok6Yv8MMkU4BZqwyt1TQgJXlOiR9TdSfjoViYmb0iWucOPMT3xvz3lN6n2phymdQRyEQ== dependencies: chalk "^2.0.1" - diff-sequences "^24.0.0" - jest-get-type "^24.0.0" - pretty-format "^24.0.0" + diff-sequences "^24.3.0" + jest-get-type "^24.3.0" + pretty-format "^24.3.0" -jest-docblock@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.0.0.tgz#54d77a188743e37f62181a91a01eb9222289f94e" - integrity sha512-KfAKZ4SN7CFOZpWg4i7g7MSlY0M+mq7K0aMqENaG2vHuhC9fc3vkpU/iNN9sOus7v3h3Y48uEjqz3+Gdn2iptA== +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== dependencies: detect-newline "^2.1.0" -jest-each@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.0.0.tgz#10987a06b21c7ffbfb7706c89d24c52ed864be55" - integrity sha512-gFcbY4Cu55yxExXMkjrnLXov3bWO3dbPAW7HXb31h/DNWdNc/6X8MtxGff8nh3/MjkF9DpVqnj0KsPKuPK0cpA== +jest-each@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.3.0.tgz#83ae8c6368791bf6ad6c5bf3f67ace0724e9d13e" + integrity sha512-FuAhGgS1k6MpOG9vHsEVYH7mwiHheRIH9vFf8xKxmM5vnuCMhoZqExojmw5vAglkEPJPVH9rjZakOD5kqWV0UA== dependencies: + "@jest/types" "^24.3.0" chalk "^2.0.1" - jest-get-type "^24.0.0" - jest-util "^24.0.0" - pretty-format "^24.0.0" - -jest-environment-jsdom@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0.tgz#5affa0654d6e44cd798003daa1a8701dbd6e4d11" - integrity sha512-1YNp7xtxajTRaxbylDc2pWvFnfDTH5BJJGyVzyGAKNt/lEULohwEV9zFqTgG4bXRcq7xzdd+sGFws+LxThXXOw== - dependencies: - jest-mock "^24.0.0" - jest-util "^24.0.0" + jest-get-type "^24.3.0" + jest-util "^24.3.0" + pretty-format "^24.3.0" + +jest-environment-jsdom@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.3.0.tgz#974d4293bd9d714eeeb1376c7235a8ab9d736db7" + integrity sha512-Cor5RiE8WMoDErKZSXDfh6KAEOP8lrz04PgNLczEV7IkB2++0U4NC+gTyrO0PenfIlKbCZ6g0sRubEJOgjiXUA== + dependencies: + "@jest/environment" "^24.3.0" + "@jest/fake-timers" "^24.3.0" + "@jest/types" "^24.3.0" + jest-mock "^24.3.0" + jest-util "^24.3.0" jsdom "^11.5.1" -jest-environment-node@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.0.0.tgz#330948980656ed8773ce2e04eb597ed91e3c7190" - integrity sha512-62fOFcaEdU0VLaq8JL90TqwI7hLn0cOKOl8vY2n477vRkCJRojiRRtJVRzzCcgFvs6gqU97DNqX5R0BrBP6Rxg== +jest-environment-node@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.3.0.tgz#127e214e4ebad9639f81d3c82ac5fb3d482024ad" + integrity sha512-VKJ1qE0Xn2IYNXusxce2M7IhHz4uARYDXO3JxkyQnFhLPE33e5UUx2MQHVpst2Qy98IFpO06WZtrHb5H06GGfQ== dependencies: - jest-mock "^24.0.0" - jest-util "^24.0.0" + "@jest/environment" "^24.3.0" + "@jest/fake-timers" "^24.3.0" + "@jest/types" "^24.3.0" + jest-mock "^24.3.0" + jest-util "^24.3.0" jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== -jest-get-type@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0.tgz#36e72930b78e33da59a4f63d44d332188278940b" - integrity sha512-z6/Eyf6s9ZDGz7eOvl+fzpuJmN9i0KyTt1no37/dHu8galssxz5ZEgnc1KaV8R31q1khxyhB4ui/X5ZjjPk77w== +jest-get-type@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.3.0.tgz#582cfd1a4f91b5cdad1d43d2932f816d543c65da" + integrity sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow== -jest-haste-map@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0.tgz#e9ef51b2c9257384b4d6beb83bd48c65b37b5e6e" - integrity sha512-CcViJyUo41IQqttLxXVdI41YErkzBKbE6cS6dRAploCeutePYfUimWd3C9rQEWhX0YBOQzvNsC0O9nYxK2nnxQ== +jest-haste-map@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.3.0.tgz#8fc0530c25b0705e9e908d9da8f1904cbec39058" + integrity sha512-LJCFLYZ9zgaZluzgyaum7HzApSYt2fFv39DoGwcLlWSDbjeI1tZuNOIWp5qHCHe7WXc99EgqLidpzsauA3HBBg== dependencies: + "@jest/types" "^24.3.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" - jest-serializer "^24.0.0" - jest-util "^24.0.0" - jest-worker "^24.0.0" + jest-serializer "^24.3.0" + jest-util "^24.3.0" + jest-worker "^24.3.0" micromatch "^3.1.10" - sane "^3.0.0" + sane "^4.0.3" -jest-jasmine2@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.1.0.tgz#8377324b967037c440f0a549ee0bbd9912055db6" - integrity sha512-H+o76SdSNyCh9fM5K8upK45YTo/DiFx5w2YAzblQebSQmukDcoVBVeXynyr7DDnxh+0NTHYRCLwJVf3tC518wg== +jest-jasmine2@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.3.0.tgz#60814a23992891b955cbfe453947320e2e66076b" + integrity sha512-X0bseienL6wLdgHIrTyBbn3+llmEiXkMTJKFmJvQf4yP84bYdy1HaQYfchOWw5H9JllROM0kEBhRz8OS3p6FEA== dependencies: "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.1.0" + expect "^24.3.0" is-generator-fn "^2.0.0" - jest-each "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - pretty-format "^24.0.0" + jest-each "^24.3.0" + jest-matcher-utils "^24.3.0" + jest-message-util "^24.3.0" + jest-runtime "^24.3.0" + jest-snapshot "^24.3.0" + jest-util "^24.3.0" + pretty-format "^24.3.0" throat "^4.0.0" -jest-leak-detector@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.0.0.tgz#78280119fd05ee98317daee62cddb3aa537a31c6" - integrity sha512-ZYHJYFeibxfsDSKowjDP332pStuiFT2xfc5R67Rjm/l+HFJWJgNIOCOlQGeXLCtyUn3A23+VVDdiCcnB6dTTrg== +jest-leak-detector@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.3.0.tgz#20216c2fb94a67d90b19c34e18880974bcd901f2" + integrity sha512-NUwLCYPVMnSo7mHaXY8ahKbzmPNBlRTPvmvoHK70Y2K17COFNfVz30wKhsa3Dpv3rmcnk2XaPq77DKjUAsyVGQ== dependencies: - pretty-format "^24.0.0" + pretty-format "^24.3.0" -jest-matcher-utils@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.0.0.tgz#fc9c41cfc49b2c3ec14e576f53d519c37729d579" - integrity sha512-LQTDmO+aWRz1Tf9HJg+HlPHhDh1E1c65kVwRFo5mwCVp5aQDzlkz4+vCvXhOKFjitV2f0kMdHxnODrXVoi+rlA== +jest-matcher-utils@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.3.0.tgz#c3277ee6d93583293f270e8d0ea864cfe17d2d1c" + integrity sha512-9imAV7r7dD1KGbGln2331RHAYfNQsZGYx1uLc45Fn+KuffFAqv5NS+8t9KaFZIo4rjBu/KNM3hBlu6l2/mRdqw== dependencies: chalk "^2.0.1" - jest-diff "^24.0.0" - jest-get-type "^24.0.0" - pretty-format "^24.0.0" + jest-diff "^24.3.0" + jest-get-type "^24.3.0" + pretty-format "^24.3.0" -jest-message-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.0.0.tgz#a07a141433b2c992dbaec68d4cbfe470ba289619" - integrity sha512-J9ROJIwz/IeC+eV1XSwnRK4oAwPuhmxEyYx1+K5UI+pIYwFZDSrfZaiWTdq0d2xYFw4Xiu+0KQWsdsQpgJMf3Q== +jest-message-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.3.0.tgz#e8f64b63ebc75b1a9c67ee35553752596e70d4a9" + integrity sha512-lXM0YgKYGqN5/eH1NGw4Ix+Pk2I9Y77beyRas7xM24n+XTTK3TbT0VkT3L/qiyS7WkW0YwyxoXnnAaGw4hsEDA== dependencies: "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/stack-utils" "^1.0.1" chalk "^2.0.1" micromatch "^3.1.10" slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.0.0.tgz#9a4b53e01d66a0e780f7d857462d063e024c617d" - integrity sha512-sQp0Hu5fcf5NZEh1U9eIW2qD0BwJZjb63Yqd98PQJFvf/zzUTBoUAwv/Dc/HFeNHIw1f3hl/48vNn+j3STaI7A== +jest-mock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.3.0.tgz#95a86b6ad474e3e33227e6dd7c4ff6b07e18d3cb" + integrity sha512-AhAo0qjbVWWGvcbW5nChFjR0ObQImvGtU6DodprNziDOt+pP0CBdht/sYcNIOXeim8083QUi9bC8QdKB8PTK4Q== + dependencies: + "@jest/types" "^24.3.0" -jest-regex-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.0.0.tgz#4feee8ec4a358f5bee0a654e94eb26163cb9089a" - integrity sha512-Jv/uOTCuC+PY7WpJl2mpoI+WbY2ut73qwwO9ByJJNwOCwr1qWhEW2Lyi2S9ZewUdJqeVpEBisdEVZSI+Zxo58Q== +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== -jest-resolve-dependencies@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.1.0.tgz#78f738a2ec59ff4d00751d9da56f176e3f589f6c" - integrity sha512-2VwPsjd3kRPu7qe2cpytAgowCObk5AKeizfXuuiwgm1a9sijJDZe8Kh1sFj6FKvSaNEfCPlBVkZEJa2482m/Uw== +jest-resolve-dependencies@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.3.0.tgz#fd364c149fcd9d330f1f3adce1ba2d6937eb9ed7" + integrity sha512-z4s8t+EM67sbsRG5j0VzW0a4cv3Fj4+oQWisUOJXOtPHaBVP5OySsQq9E+BSSwaS8YgNC1m0+PdfUZEp3DkDOw== dependencies: - jest-regex-util "^24.0.0" - jest-snapshot "^24.1.0" + "@jest/types" "^24.3.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.3.0" -jest-resolve@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.1.0.tgz#42ff0169b0ea47bfdbd0c52a0067ca7d022c7688" - integrity sha512-TPiAIVp3TG6zAxH28u/6eogbwrvZjBMWroSLBDkwkHKrqxB/RIdwkWDye4uqPlZIXWIaHtifY3L0/eO5Z0f2wg== +jest-resolve@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.3.0.tgz#484268892ceb25cc90694adc78aa99026907322b" + integrity sha512-lgU2nE475eZrB/KwrEdVwNhFKvHqgSB3G+yaJ6bpK3cOYt35uInteNu1BL5008F5AQsJKdmg3mIWwwizdgb/uA== dependencies: + "@jest/types" "^24.3.0" browser-resolve "^1.11.3" chalk "^2.0.1" - realpath-native "^1.0.0" + realpath-native "^1.1.0" -jest-runner@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.1.0.tgz#3686a2bb89ce62800da23d7fdc3da2c32792943b" - integrity sha512-CDGOkT3AIFl16BLL/OdbtYgYvbAprwJ+ExKuLZmGSCSldwsuU2dEGauqkpvd9nphVdAnJUcP12e/EIlnTX0QXg== +jest-runner@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.3.0.tgz#5bdc0378992b60f7b14f9d198c9cc1481883a27e" + integrity sha512-oAWdXY74DwXViSrczs6q8FSi2RdFEejM2q9KasgjI+b8+usOnxXpEpo6FEMUvSXzkjpPz4XND7jusUNhShu9jQ== dependencies: + "@jest/console" "^24.3.0" + "@jest/environment" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.1.0" - jest-docblock "^24.0.0" - jest-haste-map "^24.0.0" - jest-jasmine2 "^24.1.0" - jest-leak-detector "^24.0.0" - jest-message-util "^24.0.0" - jest-runtime "^24.1.0" - jest-util "^24.0.0" - jest-worker "^24.0.0" + jest-config "^24.3.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.3.0" + jest-jasmine2 "^24.3.0" + jest-leak-detector "^24.3.0" + jest-message-util "^24.3.0" + jest-resolve "^24.3.0" + jest-runtime "^24.3.0" + jest-util "^24.3.0" + jest-worker "^24.3.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.1.0.tgz#7c157a2e776609e8cf552f956a5a19ec9c985214" - integrity sha512-59/BY6OCuTXxGeDhEMU7+N33dpMQyXq7MLK07cNSIY/QYt2QZgJ7Tjx+rykBI0skAoigFl0A5tmT8UdwX92YuQ== - dependencies: - "@babel/core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" +jest-runtime@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.3.0.tgz#6ed1ba1260ad90c906a55fb4989021cfc7c967c4" + integrity sha512-ARqHo8nPQ0/QlTN9ZuE8ebIjleBVqJhdEcuoy7mEWNyOqEpuEMAVIp3asO+giAmwh5ih9NlbhWsx97DIt5N6KA== + dependencies: + "@jest/console" "^24.3.0" + "@jest/environment" "^24.3.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/yargs" "^12.0.2" chalk "^2.0.1" - convert-source-map "^1.4.0" exit "^0.1.2" - fast-json-stable-stringify "^2.0.0" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.1.0" - jest-haste-map "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" - jest-resolve "^24.1.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" - micromatch "^3.1.10" - realpath-native "^1.0.0" + jest-config "^24.3.0" + jest-haste-map "^24.3.0" + jest-message-util "^24.3.0" + jest-mock "^24.3.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.3.0" + jest-snapshot "^24.3.0" + jest-util "^24.3.0" + jest-validate "^24.3.0" + realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" - write-file-atomic "2.4.1" yargs "^12.0.2" -jest-serializer@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0.tgz#522c44a332cdd194d8c0531eb06a1ee5afb4256b" - integrity sha512-9FKxQyrFgHtx3ozU+1a8v938ILBE7S8Ko3uiAVjT8Yfi2o91j/fj81jacCQZ/Ihjiff/VsUCXVgQ+iF1XdImOw== +jest-serializer@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.3.0.tgz#074e307300d1451617cf2630d11543ee4f74a1c8" + integrity sha512-RiSpqo2OFbVLJN/PgAOwQIUeHDfss6NBUDTLhjiJM8Bb5rMrwRqHfkaqahIsOf9cXXB5UjcqDCzbQ7AIoMqWkg== -jest-snapshot@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.1.0.tgz#85e22f810357aa5994ab61f236617dc2205f2f5b" - integrity sha512-th6TDfFqEmXvuViacU1ikD7xFb7lQsPn2rJl7OEmnfIVpnrx3QNY2t3PE88meeg0u/mQ0nkyvmC05PBqO4USFA== +jest-snapshot@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.3.0.tgz#00baac770e25df9a6217108dc8a4df59d80aa4aa" + integrity sha512-0zxK7KBX35vwbnQbxdO0tVzIyliWfU5WoE4nU2tMajLH0lSg8+5mgr/6TKHzDB5fWVggXgOI/iMTgsaChEq9tQ== dependencies: "@babel/types" "^7.0.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" - jest-diff "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-resolve "^24.1.0" + expect "^24.3.0" + jest-diff "^24.3.0" + jest-matcher-utils "^24.3.0" + jest-message-util "^24.3.0" + jest-resolve "^24.3.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.0.0" + pretty-format "^24.3.0" semver "^5.5.0" -jest-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.0.0.tgz#fd38fcafd6dedbd0af2944d7a227c0d91b68f7d6" - integrity sha512-QxsALc4wguYS7cfjdQSOr5HTkmjzkHgmZvIDkcmPfl1ib8PNV8QUWLwbKefCudWS0PRKioV+VbQ0oCUPC691fQ== +jest-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.3.0.tgz#a549ae9910fedbd4c5912b204bb1bcc122ea0057" + integrity sha512-eKIAC+MTKWZthUUVOwZ3Tc5a0cKMnxalQHr6qZ4kPzKn6k09sKvsmjCygqZ1SxVVfUKoa8Sfn6XDv9uTJ1iXTg== dependencies: + "@jest/console" "^24.3.0" + "@jest/fake-timers" "^24.3.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/node" "*" callsites "^3.0.0" chalk "^2.0.1" graceful-fs "^4.1.15" is-ci "^2.0.0" - jest-message-util "^24.0.0" mkdirp "^0.5.1" slash "^2.0.0" source-map "^0.6.0" @@ -4126,42 +4319,48 @@ jest-validate@^23.5.0: leven "^2.1.0" pretty-format "^23.6.0" -jest-validate@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0.tgz#aa8571a46983a6538328fef20406b4a496b6c020" - integrity sha512-vMrKrTOP4BBFIeOWsjpsDgVXATxCspC9S1gqvbJ3Tnn/b9ACsJmteYeVx9830UMV28Cob1RX55x96Qq3Tfad4g== +jest-validate@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.3.0.tgz#1701990cba3ca8193ec987fea768811e9448cd9f" + integrity sha512-K4p5QrCA6MYacPupnWHrrYiMkeBWD+tXjiO9zoR4+/H1ApjQzYrhdsTzGltlTE0KKdKbpZhxnIJkPVJQ4Z3CkA== dependencies: + "@jest/types" "^24.3.0" camelcase "^5.0.0" chalk "^2.0.1" - jest-get-type "^24.0.0" + jest-get-type "^24.3.0" leven "^2.1.0" - pretty-format "^24.0.0" + pretty-format "^24.3.0" -jest-watcher@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.0.0.tgz#20d44244d10b0b7312410aefd256c1c1eef68890" - integrity sha512-GxkW2QrZ4YxmW1GUWER05McjVDunBlKMFfExu+VsGmXJmpej1saTEKvONdx5RJBlVdpPI5x6E3+EDQSIGgl53g== +jest-watcher@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.3.0.tgz#ee51c6afbe4b35a12fcf1107556db6756d7b9290" + integrity sha512-EpJS/aUG8D3DMuy9XNA4fnkKWy3DQdoWhY92ZUdlETIeEn1xya4Np/96MBSh4II5YvxwKe6JKwbu3Bnzfwa7vA== dependencies: + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/node" "*" + "@types/yargs" "^12.0.9" ansi-escapes "^3.0.0" chalk "^2.0.1" - jest-util "^24.0.0" + jest-util "^24.3.0" string-length "^2.0.0" -jest-worker@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0.tgz#3d3483b077bf04f412f47654a27bba7e947f8b6d" - integrity sha512-s64/OThpfQvoCeHG963MiEZOAAxu8kHsaL/rCMF7lpdzo7vgF0CtPml9hfguOMgykgH/eOm4jFP4ibfHLruytg== +jest-worker@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.3.0.tgz#2e02eea58f8e43d32e5d82e42aa411dee127dc2d" + integrity sha512-gJ5eGnHt73cCpwKGbx0drrVCypgUVINZ5nUAvzD57EUCFc1kzqA0wpPmn4LVWi7mkNeOE36daBbAyWPEmEf+CQ== dependencies: + "@types/node" "*" merge-stream "^1.0.1" supports-color "^6.1.0" -jest@24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.1.0.tgz#b1e1135caefcf2397950ecf7f90e395fde866fd2" - integrity sha512-+q91L65kypqklvlRFfXfdzUKyngQLOcwGhXQaLmVHv+d09LkNXuBuGxlofTFW42XMzu3giIcChchTsCNUjQ78A== +jest@24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.3.0.tgz#e16620880d9ce36b3f9341cd4d2808f85b8f16fd" + integrity sha512-c1EFvnRkTClSj9qcAF3r0UHCf5bpxdGs4+cKJwp53tct6S/ZhSk3NGjjMGBHxm41+6wnJSBl48u6nzIFxoNs9g== dependencies: import-local "^2.0.0" - jest-cli "^24.1.0" + jest-cli "^24.3.0" "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -4763,11 +4962,6 @@ merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== -merge@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" - integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== - micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -4936,11 +5130,6 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.9.2: - version "2.12.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" - integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -4963,15 +5152,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -5038,22 +5218,6 @@ node-notifier@^5.2.1: shellwords "^0.1.1" which "^1.3.0" -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -5061,14 +5225,6 @@ node-pre-gyp@^0.10.0: dependencies: abbrev "1" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -5120,7 +5276,7 @@ npm-lifecycle@^2.1.0: semver "^5.5.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.12, npm-packlist@^1.1.6: +npm-packlist@^1.1.12: version "1.3.0" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.3.0.tgz#7f01e8e44408341379ca98cfd756e7b29bd2626c" integrity sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA== @@ -5172,7 +5328,7 @@ npm-which@^3.0.1: npm-path "^2.0.2" which "^1.2.10" -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.2, npmlog@^4.1.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== @@ -5316,7 +5472,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@0, osenv@^0.1.4, osenv@^0.1.5: +osenv@0, osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -5600,7 +5756,7 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pirates@^4.0.0: +pirates@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== @@ -5656,11 +5812,12 @@ pretty-format@^23.6.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-format@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0.tgz#cb6599fd73ac088e37ed682f61291e4678f48591" - integrity sha512-LszZaKG665djUcqg5ZQq+XzezHLKrxsA86ZABTozp+oNhkdqa+tG2dX4qa6ERl5c/sRDrAa3lHmwnvKoP+OG/g== +pretty-format@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.3.0.tgz#e7eaefecd28d714fc6425dc2d5f9ed30e1188b26" + integrity sha512-oz+EQc2uda3ql4JluWTWEQgegTo9cMkVcqXxBieSV1opZ4SE1TKuFBDoSk7jGOb08UgwQVHMkVSINB8jQyUFQg== dependencies: + "@jest/types" "^24.3.0" ansi-regex "^4.0.0" ansi-styles "^3.2.0" @@ -5779,16 +5936,6 @@ quick-lru@^1.0.0: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" @@ -5900,7 +6047,7 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" -realpath-native@^1.0.0, realpath-native@^1.0.2: +realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== @@ -6099,7 +6246,7 @@ right-pad@^1.0.1: resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" integrity sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA= -rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -6154,22 +6301,20 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-3.1.0.tgz#995193b7dc1445ef1fe41ddfca2faf9f111854c6" - integrity sha512-G5GClRRxT1cELXfdAq7UKtUsv8q/ZC5k8lQGmjEm4HcAl3HzBy68iglyNCmw4+0tiXPCBZntslHlRhbnsSws+Q== +sane@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.0.3.tgz#e878c3f19e25cc57fbb734602f48f8a97818b181" + integrity sha512-hSLkC+cPHiBQs7LSyXkotC3UUtyn8C4FMn50TNaacRyvBlI+3ebcxMpqckmTdtXVtel87YS7GXN3UIOj7NiGVQ== dependencies: + "@cnakazawa/watch" "^1.0.3" anymatch "^2.0.0" capture-exit "^1.2.0" - exec-sh "^0.2.0" + exec-sh "^0.3.2" execa "^1.0.0" fb-watchman "^2.0.0" micromatch "^3.1.4" minimist "^1.1.1" walker "~1.0.5" - watch "~0.18.0" - optionalDependencies: - fsevents "^1.2.3" sax@^1.2.4: version "1.2.4" @@ -6591,7 +6736,7 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -6653,7 +6798,7 @@ tar@^2.0.0: fstream "^1.0.2" inherits "2" -tar@^4, tar@^4.4.8: +tar@^4.4.8: version "4.4.8" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== @@ -7052,14 +7197,6 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" -watch@~0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" - integrity sha1-KAlUdsbffJDJYxOJkMClQj60uYY= - dependencies: - exec-sh "^0.2.0" - minimist "^1.2.0" - wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -7112,7 +7249,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1, which@^1.2.10, which@^1.2.12, which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@1, which@^1.2.10, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== From f6e51182bfbb24d92348a1c5ce76465d34ee0d41 Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Fri, 8 Mar 2019 10:05:54 -0800 Subject: [PATCH 6/8] fix(eslint-plugin): fix false positives for adjacent-overload-signatures regarding computed property names (#340) Currently, the name of a method definition or a class property is always assumed to be a literal or an identifier. However, this fails to account for computed property names. In those cases, we currently sometimes give the name for a method definition with a computed name as `undefined`, which as a result causes methods with differing computed property names to be marked as overloads of each other. In this PR, we slice the text of the computed property name out to handle these cases. --- .../src/rules/adjacent-overload-signatures.ts | 4 ++- .../rules/explicit-member-accessibility.ts | 3 +- .../eslint-plugin/src/rules/member-naming.ts | 4 ++- .../src/rules/member-ordering.ts | 4 ++- packages/eslint-plugin/src/util/misc.ts | 29 +++++++++++++++++++ .../adjacent-overload-signatures.test.ts | 5 ++++ packages/eslint-plugin/typings/ts-eslint.d.ts | 1 + .../src/ts-estree/ts-estree.ts | 2 +- 8 files changed, 47 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index 7007b1c3bdf..8e864c9c4a2 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -26,6 +26,8 @@ export default util.createRule({ }, defaultOptions: [], create(context) { + const sourceCode = context.getSourceCode(); + /** * Gets the name of the member being processed. * @param member the member being processed. @@ -57,7 +59,7 @@ export default util.createRule({ case AST_NODE_TYPES.TSConstructSignatureDeclaration: return 'new'; case AST_NODE_TYPES.MethodDefinition: - return util.getNameFromPropertyName(member.key); + return util.getNameFromClassMember(member, sourceCode); } return null; diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index afae022c262..66029faa501 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -20,6 +20,7 @@ export default util.createRule({ }, defaultOptions: [], create(context) { + const sourceCode = context.getSourceCode(); /** * Checks if a method declaration has an accessibility modifier. * @param methodDefinition The node representing a MethodDefinition. @@ -36,7 +37,7 @@ export default util.createRule({ messageId: 'missingAccessibility', data: { type: 'method definition', - name: util.getNameFromPropertyName(methodDefinition.key), + name: util.getNameFromClassMember(methodDefinition, sourceCode), }, }); } diff --git a/packages/eslint-plugin/src/rules/member-naming.ts b/packages/eslint-plugin/src/rules/member-naming.ts index 23c14c8b39c..2efdf6ea307 100644 --- a/packages/eslint-plugin/src/rules/member-naming.ts +++ b/packages/eslint-plugin/src/rules/member-naming.ts @@ -51,6 +51,8 @@ export default util.createRule({ }, defaultOptions: [{}], create(context, [config]) { + const sourceCode = context.getSourceCode(); + const conventions = (Object.keys(config) as Modifiers[]).reduce< Config >((acc, accessibility) => { @@ -69,7 +71,7 @@ export default util.createRule({ function validateName( node: TSESTree.MethodDefinition | TSESTree.ClassProperty, ): void { - const name = util.getNameFromPropertyName(node.key); + const name = util.getNameFromClassMember(node, sourceCode); const accessibility: Modifiers = node.accessibility || 'public'; const convention = conventions[accessibility]; diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index dff4752bab4..f3ae6a439bd 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -164,6 +164,8 @@ export default util.createRule({ }, ], create(context, [options]) { + const sourceCode = context.getSourceCode(); + const functionExpressions = [ AST_NODE_TYPES.FunctionExpression, AST_NODE_TYPES.ArrowFunctionExpression, @@ -213,7 +215,7 @@ export default util.createRule({ case AST_NODE_TYPES.MethodDefinition: return node.kind === 'constructor' ? 'constructor' - : util.getNameFromPropertyName(node.key); + : util.getNameFromClassMember(node, sourceCode); case AST_NODE_TYPES.TSConstructSignatureDeclaration: return 'new'; default: diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index dbaaebc3f7a..ab56cd4e694 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -4,6 +4,7 @@ import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; import RuleModule from 'ts-eslint'; +import { SourceCode } from 'ts-eslint'; /** * Check if the context file name is *.ts or *.tsx @@ -63,3 +64,31 @@ export function getNameFromPropertyName( } return `${propertyName.value}`; } + +/** + * Gets a string name representation of the name of the given MethodDefinition + * or ClassProperty node, with handling for computed property names. + */ +export function getNameFromClassMember( + methodDefinition: TSESTree.MethodDefinition | TSESTree.ClassProperty, + sourceCode: SourceCode, +): string { + if (keyCanBeReadAsPropertyName(methodDefinition.key)) { + return getNameFromPropertyName(methodDefinition.key); + } + + return sourceCode.text.slice(...methodDefinition.key.range); +} + +/** + * This covers both actual property names, as well as computed properties that are either + * an identifier or a literal at the top level. + */ +function keyCanBeReadAsPropertyName( + node: TSESTree.Expression, +): node is TSESTree.PropertyName { + return ( + node.type === AST_NODE_TYPES.Literal || + node.type === AST_NODE_TYPES.Identifier + ); +} diff --git a/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts b/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts index 01680fef838..c040362a128 100644 --- a/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts @@ -217,6 +217,11 @@ class Test { // examples from https://github.com/nzakas/eslint-plugin-typescript/issues/138 'export default function(foo : T) {}', 'export default function named(foo : T) {}', + ` +interface Foo { + [Symbol.toStringTag](): void; + [Symbol.iterator](): void; +}`, ], invalid: [ { diff --git a/packages/eslint-plugin/typings/ts-eslint.d.ts b/packages/eslint-plugin/typings/ts-eslint.d.ts index 998c6958342..b757a1b5982 100644 --- a/packages/eslint-plugin/typings/ts-eslint.d.ts +++ b/packages/eslint-plugin/typings/ts-eslint.d.ts @@ -683,6 +683,7 @@ declare module 'ts-eslint' { RuleMetaData, RuleMetaDataDocs, Scope, + SourceCode, }; export default RuleModule; } diff --git a/packages/typescript-estree/src/ts-estree/ts-estree.ts b/packages/typescript-estree/src/ts-estree/ts-estree.ts index 4a9c7b91ae1..f15f50abca3 100644 --- a/packages/typescript-estree/src/ts-estree/ts-estree.ts +++ b/packages/typescript-estree/src/ts-estree/ts-estree.ts @@ -500,7 +500,7 @@ interface LiteralBase extends BaseNode { } interface MethodDefinitionBase extends BaseNode { - key: PropertyName; + key: Expression; value: FunctionExpression | TSEmptyBodyFunctionExpression; computed: boolean; static: boolean; From 18484a2d88aecba27b076bb6193b9ea98ece844d Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 11 Mar 2019 13:21:08 -0400 Subject: [PATCH 7/8] chore(*): add lib to tsconfig.base.json (#347) Fixes #343 --- tsconfig.base.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index fe87d8e95ab..ee6c33f86e5 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -14,6 +14,7 @@ "pretty": true, "sourceMap": true, "strict": true, - "target": "es2017" + "target": "es2017", + "lib": ["es2017"] } } From 3b28cacd49a1bc61ba0c3f8f76096f6902b92848 Mon Sep 17 00:00:00 2001 From: Tim Kraut Date: Wed, 13 Mar 2019 21:00:55 +0100 Subject: [PATCH 8/8] docs(eslint-plugin): rewrite member-ordering docs (#349) Part of the [PR to enforce an alphabetic order for members](https://github.com/typescript-eslint/typescript-eslint/pull/2639) is to rewrite the existing docs to better document the current behavior of `member-ordering`. As this touches almost any line in the rule documentation, I thought it makes sense to open a separate PR for that. In this PR, I've reworked the entire rule documentation to make it (hopefully) more clear how this rule works. The examples are mostly taken from the current rule documentation - some with little adaptations. Besides that, I've changed a few names and added some comments in the rule implementation to make it more understandable (basically the points I didn't understand immediately while trying to understand the current implementation to better describe the rule). --- .../docs/rules/member-ordering.md | 823 +++++++++--------- .../src/rules/member-ordering.ts | 69 +- 2 files changed, 474 insertions(+), 418 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index a0b8f898356..50c4a7eacd3 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -5,591 +5,638 @@ expressions easier to read, navigate and edit. ## Rule Details -This rule aims to standardise the way interfaces, type literals, classes and class expressions are structured. +This rule aims to standardize the way class declarations, class expressions, interfaces and type literals are structured. -## Options +It allows to group members by their type (e.g. `public-static-field`, `protected-static-field`, `private-static-field`, `public-instance-field`, ...). By default, their order is the same inside `classes`, `classExpressions`, `interfaces` and `typeLiterals` (note: not all member types apply to `interfaces` and `typeLiterals`). It is possible to define the order for any of those individually or to change the default order for all of them by setting the `default` option. -This rule, in its default state, does not require any argument, in which case the following order is enforced: - -- `public-static-field` -- `protected-static-field` -- `private-static-field` -- `public-instance-field` -- `protected-instance-field` -- `private-instance-field` -- `public-field` (ignores scope) -- `protected-field` (ignores scope) -- `private-field` (ignores scope) -- `static-field` (ignores accessibility) -- `instance-field` (ignores accessibility) -- `field` (ignores scope and/or accessibility) -- `constructor` (ignores scope and/or accessibility) -- `public-static-method` -- `protected-static-method` -- `private-static-method` -- `public-instance-method` -- `protected-instance-method` -- `private-instance-method` -- `public-method` (ignores scope) -- `protected-method` (ignores scope) -- `private-method` (ignores scope) -- `static-method` (ignores accessibility) -- `instance-method` (ignores accessibility) -- `method` (ignores scope and/or accessibility) - -The rule can also take one or more of the following options: - -- `default`, use this to change the default order (used when no specific configuration has been provided). -- `classes`, use this to change the order in classes. -- `classExpressions`, use this to change the order in class expressions. -- `interfaces`, use this to change the order in interfaces. -- `typeLiterals`, use this to change the order in type literals. - -### default - -Disable using `never` or use one of the following values to specify an order: - -- Fields: - `public-static-field` - `protected-static-field` - `private-static-field` - `public-instance-field` - `protected-instance-field` - `private-instance-field` - `public-field` (= public-_-field) - `protected-field` (= protected-_-field) - `private-field` (= private-_-field) - `static-field` (= _-static-field) - `instance-field` (= \*-instance-field) - `field` (= all) - -- Constructors: - `public-constructor` - `protected-constructor` - `private-constructor` - `constructor` (= \*-constructor) - -- Methods: - `public-static-method` - `protected-static-method` - `private-static-method` - `public-instance-method` - `protected-instance-method` - `private-instance-method` - `public-method` (= public-_-method) - `protected-method` (= protected-_-method) - `private-method` (= private-_-method) - `static-method` (= _-static-method) - `instance-method` (= \*-instance-method) - `method` (= all) - -Examples of **incorrect** code for the `{ "default": [...] }` option: +## Options ```ts -// { "default": ["method", "constructor", "field"] } +{ + default?: Array | never + classes?: Array | never + classExpressions?: Array | never + + interfaces?: ['field' | 'method' | 'constructor'] | never + typeLiterals?: ['field' | 'method' | 'constructor'] | never +} +``` + +See below for the possible definitions of `MemberType`. + +### Member types (granular form) + +There are multiple ways to specify the member types. The most explicit and granular form is the following: + +```json5 +[ + // Fields + 'public-static-field', + 'protected-static-field', + 'private-static-field', + 'public-instance-field', + 'protected-instance-field', + 'private-instance-field', + + // Constructors + 'public-constructor', + 'protected-constructor', + 'private-constructor', + + // Methods + 'public-static-method', + 'protected-static-method', + 'private-static-method', + 'public-instance-method', + 'protected-instance-method', + 'private-instance-method', +] +``` + +Note: If you only specify some of the possible types, the non-specified ones can have any particular order. This means that they can be placed before, within or after the specified types and the linter won't complain about it. + +### Member group types (with accessibility, ignoring scope) + +It is also possible to group member types by their accessibility (`static`, `instance`), ignoring their scope. + +```json5 +[ + // Fields + 'public-field', // = ['public-static-field', 'public-instance-field']) + 'protected-field', // = ['protected-static-field', 'protected-instance-field']) + 'private-field', // = ['private-static-field', 'private-instance-field']) + + // Constructors + // Only the accessibility of constructors is configurable. See below. + + // Methods + 'public-method', // = ['public-static-method', 'public-instance-method']) + 'protected-method', // = ['protected-static-method', 'protected-instance-method']) + 'private-method', // = ['private-static-method', 'private-instance-method']) +] +``` + +### Member group types (with scope, ignoring accessibility) + +Another option is to group the member types by their scope (`public`, `protected`, `private`), ignoring their accessibility. + +```json5 +[ + // Fields + 'static-field', // = ['public-static-field', 'protected-static-field', 'private-static-field']) + 'instance-field', // = ['public-instance-field', 'protected-instance-field', 'private-instance-field']) + + // Constructors + 'constructor', // = ['public-constructor', 'protected-constructor', 'private-constructor']) + + // Methods + 'static-method', // = ['public-static-method', 'protected-static-method', 'private-static-method']) + 'instance-method', // = ['public-instance-method', 'protected-instance-method', 'private-instance-method'] +] +``` + +### Member group types (with scope and accessibility) + +The third grouping option is to ignore both scope and accessibility. + +```json5 +[ + // Fields + 'field', // = ['public-static-field', 'protected-static-field', 'private-static-field', 'public-instance-field', 'protected-instance-field', 'private-instance-field']) + + // Constructors + // Only the accessibility of constructors is configurable. See above. + + // Methods + 'method', // = ['public-static-method', 'protected-static-method', 'private-static-method', 'public-instance-method', 'protected-instance-method', 'private-instance-method']) +] +``` + +### Default configuration + +The default configuration looks as follows: + +```json +{ + "default": [ + "public-static-field", + "protected-static-field", + "private-static-field", + + "public-instance-field", + "protected-instance-field", + "private-instance-field", + + "public-field", + "protected-field", + "private-field", + + "static-field", + "instance-field", + + "field", + + "constructor", + + "public-static-method", + "protected-static-method", + "private-static-method", + + "public-instance-method", + "protected-instance-method", + "private-instance-method", + + "public-method", + "protected-method", + "private-method", + + "static-method", + "instance-method", + + "method" + ] +} +``` + +Note: The default configuration contains member group types which contain other member types (see above). This is intentional to provide better error messages. + +## Examples + +### Custom `default` configuration + +Note: The `default` options are overwritten in these examples. +#### Configuration: `{ "default": ["method", "constructor", "field"] }` + +##### Incorrect examples + +```ts interface Foo { - // -> field - B: string; + B: string; // -> field - // -> constructor - new (); + new (); // -> constructor - // -> method - A(): void; + A(): void; // -> method } +``` + +Note: Wrong order. +```ts type Foo = { - // -> field - B: string; + B: string; // -> field // no constructor - // -> method - A(): void; + A(): void; // -> method }; +``` + +Note: Not all specified member types have to exist. +```ts class Foo { - // -> * field - private C: string; - public D: string; - protected static E: string; + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field - // -> constructor - constructor() {} + constructor() {} // -> constructor - // -> * method - public static A(): void {} - public B(): void {} + public static A(): void {} // -> method + public B(): void {} // -> method } +``` +Note: Accessibility or scope are ignored with this ignored. + +```ts const Foo = class { - // -> * field - private C: string; - public D: string; + private C: string; // -> field + public D: string; // -> field - // -> constructor - constructor() {} + constructor() {} // -> constructor - // -> * method - public static A(): void {} - public B(): void {} + public static A(): void {} // -> method + public B(): void {} // -> method - // * field - protected static E: string; + protected static E: string; // -> field }; +``` -// { "default": ["public-instance-method", "public-static-field"] } +Note: Not all members have to be grouped to find rule violations. -// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals) +##### Correct examples -class Foo { - // private instance field - private C: string; +```ts +interface Foo { + A(): void; // -> method - // public instance field - public D: string; + new (); // -> constructor - // -> public static field - public static E: string; + B: string; // -> field +} +``` - // constructor - constructor() {} +```ts +type Foo = { + A(): void; // -> method - // public static method - public static A(): void {} + // no constructor - // -> public instance method - public B(): void {} -} + B: string; // -> field +}; +``` -const Foo = class { - // private instance field - private C: string; +```ts +class Foo { + public static A(): void {} // -> method + public B(): void {} // -> method - // -> public static field - public static E: string; + constructor() {} // -> constructor - // public instance field - public D: string; + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +} +``` - // constructor - constructor() {} +```ts +const Foo = class { + public static A(): void {} // -> method + public B(): void {} // -> method - // public static method - public static A(): void {} + constructor() {} // -> constructor - // -> public instance method - public B(): void {} + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field }; ``` -Examples of **correct** code for the `{ "default": [...] }` option: +#### Configuration: `{ "default": ["public-instance-method", "public-static-field"] }` + +Note: This configuration does not apply to interfaces/type literals as accessibility and scope are not part of interfaces/type literals. + +##### Incorrect examples ```ts -// { "default": ["method", "constructor", "field"] } +class Foo { + private C: string; // (irrelevant) -interface Foo { - // -> method - A() : void; + public D: string; // (irrelevant) - // -> constructor - new(); + public static E: string; // -> public static field - // -> field - B: string; -} + constructor() {} // (irrelevant) -type Foo = { - // -> method - A() : void; + public static A(): void {} // (irrelevant) - // -> field - B: string; + public B(): void {} // -> public instance method } +``` -class Foo { - // -> * method - public static A(): void {} - public B(): void {} +Note: Public instance methods should come first before public static fields. Everything else can be placed anywhere. + +```ts +const Foo = class { + private C: string; // (irrelevant) - // -> constructor - constructor() {} + public static E: string; // -> public static field - // -> * field - private C: string - public D: string - protected static E: string -} + public D: string; // (irrelevant) -const Foo = class { - // -> * method - public static A(): void {} - public B(): void {} + constructor() {} // (irrelevant) - // -> constructor - constructor() {} + public static A(): void {} // (irrelevant) - // -> * field - private C: string - public D: string - protected static E: string -} + public B(): void {} // -> public instance method +}; +``` -// { "default": ["public-instance-method", "public-static-field"] } +Note: Public instance methods should come first before public static fields. Everything else can be placed anywhere. -// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals) +##### Correct examples +```ts class Foo { - // -> public instance method - public B(): void {} + public B(): void {} // -> public instance method - // private instance field - private C: string + private C: string; // (irrelevant) - // public instance field - public D: string + public D: string; // (irrelevant) - // -> public static field - public static E: string + public static E: string; // -> public static field - // constructor - constructor() {} + constructor() {} // (irrelevant) - // public static method - public static A(): void {} + public static A(): void {} // (irrelevant) } +``` +```ts const Foo = class { - // -> public instance method - public B(): void {} + public B(): void {} // -> public instance method - // private instance field - private C: string + private C: string; // (irrelevant) - // public instance field - public D: string + public D: string; // (irrelevant) - // constructor - constructor() {} + constructor() {} // (irrelevant) - // public static method - public static A(): void {} + public static A(): void {} // (irrelevant) - // -> protected static field - protected static: string -} + public static E: string; // -> public static field +}; +``` -// { "default": ["public-static-field", "static-field", "instance-field"] } +#### Configuration: `{ "default": ["public-static-field", "static-field", "instance-field"] }` -// does not apply for interfaces/type literals (accessibility and scope are not part of interfaces/type literals) +Note: This configuration does not apply to interfaces/type literals as accessibility and scope are not part of interfaces/type literals. +##### Incorrect examples + +```ts class Foo { - // -> public static field - public static A: string; + private E: string; // -> instance field - // -> * static field - private static B: string; - protected statis C:string; - private static D: string; + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field - // -> * instance field - private E: string; + public static A: string; // -> public static field } +``` + +Note: Public static fields should come first, followed by static fields and instance fields. +```ts const foo = class { - // * method - public T(): void {} + public T(): void {} // (irrelevant) - // -> public static field - public static A: string; + private static B: string; // -> static field - // constructor - constructor(){} + constructor() {} // (irrelevant) - // -> * static field - private static B: string; - protected statis C:string; - private static D: string; + private E: string; // -> instance field - // -> * instance field - private E: string; -} + protected static C: string; // -> static field + private static D: string; // -> static field + + public static A: string; // -> public static field +}; ``` -### classes +Issue: Public static fields should come first, followed by static fields and instance fields. + +##### Correct examples + +```ts +class Foo { + public static A: string; // -> public static field -Disable using `never` or use one of the valid values (see default) to specify an order. + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field -Examples of **incorrect** code for the `{ "classes": [...] }` option: + private E: string; // -> instance field +} +``` ```ts -// { "classes": ["method", "constructor", "field"] } +const foo = class { + public static A: string; // -> public static field -// does not apply for interfaces/type literals/class expressions. + constructor() {} // -> constructor -class Foo { - // -> field - private C: string; - public D: string; - protected static E: string; + private static B: string; // -> static field + protected static C: string; // -> static field + private static D: string; // -> static field - // -> constructor - constructor() {} + private E: string; // -> instance field - // -> method - public static A(): void {} - public B(): void {} -} + public T(): void {} // -> method +}; +``` -// { "classes": ["public-instance-method", "public-static-field"] } +### Custom `classes` configuration -// does not apply for interfaces/type literals/class expressions. +Note: If this is not set, the `default` will automatically be applied to classes as well. If a `classes` configuration is provided, only this configuration will be used for `classes` (i.e. nothing will be merged with `default`). -class Foo { - // private instance field - private C: string; +Note: The configuration for `classes` does not apply to class expressions (use `classExpressions` for them). - // public instance field - public D: string; +#### Configuration: `{ "classes": ["method", "constructor", "field"] }` - // -> public static field - public static E: string; +##### Incorrect example - // constructor - constructor() {} +```ts +class Foo { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field - // public static method - public static A(): void {} + constructor() {} // -> constructor - // -> public instance method - public B(): void {} + public static A(): void {} // -> method + public B(): void {} // -> method } ``` -Examples of **correct** code for `{ "classes": [...] }` option: +##### Correct example ```ts -// { "classes": ["method", "constructor", "field"] } - -// does not apply for interfaces/type literals/class expressions. - class Foo { - // -> * method - public static A(): void {} - public B(): void {} + public static A(): void {} // -> method + public B(): void {} // -> method - // -> constructor - constructor() {} + constructor() {} // -> constructor - // -> * field - private C: string; - public D: string; - protected static E: string; + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field } +``` -// { "classes": ["public-instance-method", "public-static-field"] } +#### Configuration: `{ "classes": ["public-instance-method", "public-static-field"] }` -// does not apply for interfaces/type literals/class expressions. +##### Incorrect example +```ts class Foo { - // private instance field - private C: string; + private C: string; // (irrelevant) - // public instance field - public D: string; + public D: string; // (irrelevant) - // -> public static field - public static E: string; + public static E: string; // -> public static field - // constructor - constructor() {} + constructor() {} // (irrelevant) - // public static method - public static A(): void {} + public static A(): void {} // (irrelevant) - // -> public instance method - public B(): void {} + public B(): void {} // -> public instance method } ``` -### classExpressions +##### Correct example -Disable using `never` or use one of the valid values (see default) to specify an order. - -Examples of **incorrect** code for the `{ "classExpressions": [...] }` option: +Examples of **correct** code for `{ "classes": [...] }` option: ```ts -// { "classExpressions": ["method", "constructor", "field"] } +class Foo { + private C: string; // (irrelevant) -// does not apply for interfaces/type literals/class expressions. + public D: string; // (irrelevant) -const foo = class { - // -> field - private C: string; - public D: string; - protected static E: string; + public static E: string; // -> public static field - // -> constructor - constructor() {} + constructor() {} // (irrelevant) - // -> method - public static A(): void {} - public B(): void {} -}; + public static A(): void {} // (irrelevant) -// { "classExpressions": ["public-instance-method", "public-static-field"] } + public B(): void {} // -> public instance method +} +``` -// does not apply for interfaces/type literals/class expressions. +### Custom `classExpressions` configuration -const foo = class { - // private instance field - private C: string; +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `classExpressions` configuration is provided, only this configuration will be used for `classExpressions` (i.e. nothing will be merged with `default`). - // public instance field - public D: string; +Note: The configuration for `classExpressions` does not apply to classes (use `classes` for them). - // -> public static field - public static E: string; +#### Configuration: `{ "classExpressions": ["method", "constructor", "field"] }` - // constructor - constructor() {} +##### Incorrect example + +```ts +const foo = class { + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field - // public static method - public static A(): void {} + constructor() {} // -> constructor - // -> public instance method - public B(): void {} + public static A(): void {} // -> method + public B(): void {} // -> method }; ``` -Examples of **correct** code for `{ "classExpressions": [...] }` option: +##### Correct example ```ts -// { "classExpressions": ["method", "constructor", "field"] } +const foo = class { + public static A(): void {} // -> method + public B(): void {} // -> method + + constructor() {} // -> constructor + + private C: string; // -> field + public D: string; // -> field + protected static E: string; // -> field +}; +``` + +#### Configuration: `{ "classExpressions": ["public-instance-method", "public-static-field"] }` -// does not apply for interfaces/type literals/class expressions. +##### Incorrect example +```ts const foo = class { - // -> * method - public static A(): void {} - public B(): void {} + private C: string; // (irrelevant) - // -> constructor - constructor() {} + public D: string; // (irrelevant) - // -> * field - private C: string; - public D: string; - protected static E: string; -}; + public static E: string; // -> public static field + + constructor() {} // (irrelevant) -// { "classExpressions": ["public-instance-method", "public-static-field"] } + public static A(): void {} // (irrelevant) -// does not apply for interfaces/type literals/class expressions. + public B(): void {} // -> public instance method +}; +``` + +##### Correct example +```ts const foo = class { - // private instance field - private C: string; + private C: string; // (irrelevant) - // public instance field - public D: string; + public D: string; // (irrelevant) - // -> public static field - public static E: string; + public B(): void {} // -> public instance method - // constructor - constructor() {} + public static E: string; // -> public static field - // public static method - public static A(): void {} + constructor() {} // (irrelevant) - // -> public instance method - public B(): void {} + public static A(): void {} // (irrelevant) }; ``` -### interfaces +### Custom `interfaces` configuration -Disable using `never` or use one of the following values to specify an order: -`field` -`constructor` -`method` +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `interfaces` configuration is provided, only this configuration will be used for `interfaces` (i.e. nothing will be merged with `default`). -Examples of **incorrect** code for the `{ "interfaces": [...] }` option: +Note: The configuration for `interfaces` only allows a limited set of member types: `field`, `constructor` and `method`. -```ts -// { "interfaces": ["method", "constructor", "field"] } +Note: The configuration for `interfaces` does not apply to type literals (use `typeLiterals` for them). -// does not apply for classes/class expressions/type literals +#### Configuration: `{ "interfaces": ["method", "constructor", "field"] }` +##### Incorrect example + +```ts interface Foo { - // -> field - B: string; + B: string; // -> field - // -> constructor - new (); + new (); // -> constructor - // -> method - A(): void; + A(): void; // -> method } ``` -Examples of **correct** code for the `{ "interfaces": [...] }` option: +##### Correct example ```ts -// { "interfaces": ["method", "constructor", "field"] } - -// does not apply for classes/class expressions/type literals - interface Foo { - // -> method - A(): void; + A(): void; // -> method - // -> constructor - new (); + new (); // -> constructor - // -> field - B: string; + B: string; // -> field } ``` -### typeLiterals +### Custom `typeLiterals` configuration -Disable using `never` or use one of the valid values (see interfaces) to specify an order. +Note: If this is not set, the `default` will automatically be applied to classes expressions as well. If a `typeLiterals` configuration is provided, only this configuration will be used for `typeLiterals` (i.e. nothing will be merged with `default`). -Examples of **incorrect** code for the `{ "typeLiterals": [...] }` option: +Note: The configuration for `typeLiterals` only allows a limited set of member types: `field`, `constructor` and `method`. -```ts -// { "typeLiterals": ["method", "constructor", "field"] } +Note: The configuration for `typeLiterals` does not apply to type literals (use `interfaces` for them). -// does not apply for classes/class expressions/interfaces +#### Configuration: `{ "typeLiterals": ["method", "constructor", "field"] }` +##### Incorrect example + +```ts type Foo = { - // -> field - B: string; + B: string; // -> field + + A(): void; // -> method - // -> method - A(): void; + new (); // -> constructor }; ``` -Examples of **correct** code for the `{ "typeLiterals": [...] }` option: +##### Correct example ```ts -// { "typeLiterals": ["method", "constructor", "field"] } - -// does not apply for classes/class expressions/interfaces - type Foo = { - // -> method - A(): void; + A(): void; // -> method - // -> constructor - new (); + new (); // -> constructor - // -> field - B: string; + B: string; // -> field }; ``` diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index f3ae6a439bd..6811cf5a2e4 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -13,23 +13,26 @@ type Options = [ } ]; -const schemaOptions = ['field', 'method', 'constructor'].reduce( - (options, type) => { - options.push(type); +const allMemberTypes = ['field', 'method', 'constructor'].reduce( + (all, type) => { + all.push(type); ['public', 'protected', 'private'].forEach(accessibility => { - options.push(`${accessibility}-${type}`); + all.push(`${accessibility}-${type}`); // e.g. `public-field` + if (type !== 'constructor') { + // There is no `static-constructor` or `instance-constructor ['static', 'instance'].forEach(scope => { - if (options.indexOf(`${scope}-${type}`) === -1) { - options.push(`${scope}-${type}`); + if (all.indexOf(`${scope}-${type}`) === -1) { + all.push(`${scope}-${type}`); } - options.push(`${accessibility}-${scope}-${type}`); + + all.push(`${accessibility}-${scope}-${type}`); }); } }); - return options; + return all; }, [], ); @@ -60,7 +63,7 @@ export default util.createRule({ { type: 'array', items: { - enum: schemaOptions, + enum: allMemberTypes, }, }, ], @@ -73,7 +76,7 @@ export default util.createRule({ { type: 'array', items: { - enum: schemaOptions, + enum: allMemberTypes, }, }, ], @@ -86,7 +89,7 @@ export default util.createRule({ { type: 'array', items: { - enum: schemaOptions, + enum: allMemberTypes, }, }, ], @@ -230,12 +233,14 @@ export default util.createRule({ * - If there is no order for accessibility-scope-type, then strip out the accessibility. * - If there is no order for scope-type, then strip out the scope. * - If there is no order for type, then return -1 - * @param names the valid names to be validated. + * @param memberTypes the valid names to be validated. * @param order the current order to be validated. + * + * @return Index of the matching member type in the order configuration. */ - function getRankOrder(names: string[], order: string[]): number { + function getRankOrder(memberTypes: string[], order: string[]): number { let rank = -1; - const stack = names.slice(); + const stack = memberTypes.slice(); // Get a copy of the member types while (stack.length > 0 && rank === -1) { rank = order.indexOf(stack.shift()!); @@ -248,7 +253,7 @@ export default util.createRule({ * Gets the rank of the node given the order. * @param node the node to be evaluated. * @param order the current order to be validated. - * @param supportsModifiers a flag indicating whether the type supports modifiers or not. + * @param supportsModifiers a flag indicating whether the type supports modifiers (scope or accessibility) or not. */ function getRank( node: TSESTree.ClassElement | TSESTree.TypeElement, @@ -267,19 +272,21 @@ export default util.createRule({ ? node.accessibility : 'public'; - const names = []; + const memberTypes = []; if (supportsModifiers) { if (type !== 'constructor') { - names.push(`${accessibility}-${scope}-${type}`); - names.push(`${scope}-${type}`); + // Constructors have no scope + memberTypes.push(`${accessibility}-${scope}-${type}`); + memberTypes.push(`${scope}-${type}`); } - names.push(`${accessibility}-${type}`); + + memberTypes.push(`${accessibility}-${type}`); } - names.push(type); + memberTypes.push(type); - return getRankOrder(names, order); + return getRankOrder(memberTypes, order); } /** @@ -318,12 +325,13 @@ export default util.createRule({ } /** - * Validates each member rank. - * @param members the members to be validated. - * @param order the current order to be validated. - * @param supportsModifiers a flag indicating whether the type supports modifiers or not. + * Validates if all members are correctly sorted. + * + * @param members Members to be validated. + * @param order Current order to be validated. + * @param supportsModifiers A flag indicating whether the type supports modifiers (scope or accessibility) or not. */ - function validateMembers( + function validateMembersOrder( members: (TSESTree.ClassElement | TSESTree.TypeElement)[], order: OrderConfig, supportsModifiers: boolean, @@ -331,6 +339,7 @@ export default util.createRule({ if (members && order !== 'never') { const previousRanks: number[] = []; + // Find first member which isn't correctly sorted members.forEach(member => { const rank = getRank(member, order, supportsModifiers); @@ -354,28 +363,28 @@ export default util.createRule({ return { ClassDeclaration(node) { - validateMembers( + validateMembersOrder( node.body.body, options.classes || options.default!, true, ); }, ClassExpression(node) { - validateMembers( + validateMembersOrder( node.body.body, options.classExpressions || options.default!, true, ); }, TSInterfaceDeclaration(node) { - validateMembers( + validateMembersOrder( node.body.body, options.interfaces || options.default!, false, ); }, TSTypeLiteral(node) { - validateMembers( + validateMembersOrder( node.members, options.typeLiterals || options.default!, false,