From 8f86945a94eff232c7a25e00aeb8bd651436c40d Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 7 Nov 2022 11:33:09 -0600 Subject: [PATCH] Add lint to remind you not to leave an focused/exclusive test in Relevant rule: https://github.com/jest-community/eslint-plugin-jest/blob/ad04fcc97b5dcc676c5bd2152f84608c08e0c50a/docs/rules/no-focused-tests.md Spawning from https://github.com/matrix-org/matrix-js-sdk/pull/2856#discussion_r1015415938 --- .eslintrc.js | 1 + package.json | 1 + yarn.lock | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 918ae4365e2..db1c316d006 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { extends: [ "plugin:matrix-org/babel", "plugin:import/typescript", + "plugin:jest/recommended", ], env: { browser: true, diff --git a/package.json b/package.json index ac83abf6f8c..a2c9bf6aa4f 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "eslint-config-google": "^0.14.0", "eslint-import-resolver-typescript": "^3.5.1", "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jest": "^27.1.4", "eslint-plugin-matrix-org": "^0.7.0", "eslint-plugin-unicorn": "^44.0.2", "exorcist": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 9f3a92b9b4a..e94ea414a4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1853,6 +1853,14 @@ "@typescript-eslint/types" "5.42.0" "@typescript-eslint/visitor-keys" "5.42.0" +"@typescript-eslint/scope-manager@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.42.1.tgz#05e5e1351485637d466464237e5259b49f609b18" + integrity sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ== + dependencies: + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" + "@typescript-eslint/type-utils@5.42.0": version "5.42.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.42.0.tgz#4206d7192d4fe903ddf99d09b41d4ac31b0b7dca" @@ -1868,6 +1876,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.0.tgz#5aeff9b5eced48f27d5b8139339bf1ef805bad7a" integrity sha512-t4lzO9ZOAUcHY6bXQYRuu+3SSYdD9TS8ooApZft4WARt4/f2Cj/YpvbTe8A4GuhT4bNW72goDMOy7SW71mZwGw== +"@typescript-eslint/types@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.1.tgz#0d4283c30e9b70d2aa2391c36294413de9106df2" + integrity sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA== + "@typescript-eslint/typescript-estree@5.42.0": version "5.42.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.0.tgz#2592d24bb5f89bf54a63384ff3494870f95b3fd8" @@ -1881,6 +1894,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.1.tgz#f9a223ecb547a781d37e07a5ac6ba9ff681eaef0" + integrity sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw== + dependencies: + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.42.0": version "5.42.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.0.tgz#f06bd43b9a9a06ed8f29600273240e84a53f2f15" @@ -1895,6 +1921,20 @@ eslint-utils "^3.0.0" semver "^7.3.7" +"@typescript-eslint/utils@^5.10.0": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.1.tgz#2789b1cd990f0c07aaa3e462dbe0f18d736d5071" + integrity sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/typescript-estree" "5.42.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + "@typescript-eslint/visitor-keys@5.42.0": version "5.42.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.0.tgz#ee8d62d486f41cfe646632fab790fbf0c1db5bb0" @@ -1903,6 +1943,14 @@ "@typescript-eslint/types" "5.42.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.1.tgz#df10839adf6605e1cdb79174cf21e46df9be4872" + integrity sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A== + dependencies: + "@typescript-eslint/types" "5.42.1" + eslint-visitor-keys "^3.3.0" + "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" @@ -3391,6 +3439,13 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" +eslint-plugin-jest@^27.1.4: + version "27.1.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.4.tgz#bdfaf51ee9ed0b86dac1e83753e22da072acaa92" + integrity sha512-evJ9E9id/z2Fu6LR+ncNySJ6UMs5RiJiv4JsmdA3gPWoq0AR+uZyva738+Y9Uln+3WaYX+3OYP9HJoau94Iurg== + dependencies: + "@typescript-eslint/utils" "^5.10.0" + eslint-plugin-matrix-org@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-0.7.0.tgz#4b7456b31e30e7575b62c2aada91915478829f88"