From cd05ee0054bcd0b4f97a1114a9948b84bff4a8e7 Mon Sep 17 00:00:00 2001 From: Connor Lindsey Date: Fri, 11 Feb 2022 07:59:30 -0700 Subject: [PATCH] Chore: Prevent focused tests by adding jest eslint rule (#45088) * Prevent focused tests by adding jest eslint rule * Remove redundant no-only-tests eslint plugin * Update lock file --- .eslintrc | 6 +++--- package.json | 2 +- yarn.lock | 28 +++++++++++++++++++--------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 56189b548d2..6c02955b708 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,12 +1,12 @@ { "extends": ["@grafana/eslint-config"], "root": true, - "plugins": ["no-only-tests", "@emotion", "lodash"], + "plugins": ["@emotion", "lodash", "jest"], "rules": { - "no-only-tests/no-only-tests": "error", "react/prop-types": "off", "@emotion/jsx-import": "error", - "lodash/import-scope": [2, "member"] + "lodash/import-scope": [2, "member"], + "jest/no-focused-tests": "error" }, "overrides": [ { diff --git a/package.json b/package.json index 6d64d2c145b..08ac67a5423 100644 --- a/package.json +++ b/package.json @@ -171,9 +171,9 @@ "enzyme-to-json": "3.6.2", "eslint": "8.8.0", "eslint-config-prettier": "8.3.0", + "eslint-plugin-jest": "^26.1.0", "eslint-plugin-jsdoc": "37.8.0", "eslint-plugin-lodash": "^7.2.0", - "eslint-plugin-no-only-tests": "2.6.0", "eslint-plugin-prettier": "4.0.0", "eslint-plugin-react": "7.28.0", "eslint-plugin-react-hooks": "4.3.0", diff --git a/yarn.lock b/yarn.lock index 724216c86f8..9f64a161e9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11337,7 +11337,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.11.0": +"@typescript-eslint/utils@npm:5.11.0, @typescript-eslint/utils@npm:^5.10.0": version: 5.11.0 resolution: "@typescript-eslint/utils@npm:5.11.0" dependencies: @@ -18160,6 +18160,23 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-jest@npm:^26.1.0": + version: 26.1.0 + resolution: "eslint-plugin-jest@npm:26.1.0" + dependencies: + "@typescript-eslint/utils": ^5.10.0 + peerDependencies: + "@typescript-eslint/eslint-plugin": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + "@typescript-eslint/eslint-plugin": + optional: true + jest: + optional: true + checksum: 5d796092640202dd519c44c4270a335e7b5e7cd74f36b41754c2a9ed007a0110f4cc9b4b721dafe6724b3f93a3c9d27f9a0267c7e2a86e0f71a4a9f920897adc + languageName: node + linkType: hard + "eslint-plugin-jsdoc@npm:37.7.0": version: 37.7.0 resolution: "eslint-plugin-jsdoc@npm:37.7.0" @@ -18207,13 +18224,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-no-only-tests@npm:2.6.0": - version: 2.6.0 - resolution: "eslint-plugin-no-only-tests@npm:2.6.0" - checksum: 4e3c9cc7e09c13e855fd7af4a8969128f766dcf32a0680715ebcaa903c7fe44db8e45e994c8b908443a6019cbd9ea1b51f413bf968a0c58214aded930a863df9 - languageName: node - linkType: hard - "eslint-plugin-prettier@npm:4.0.0": version: 4.0.0 resolution: "eslint-plugin-prettier@npm:4.0.0" @@ -20448,9 +20458,9 @@ __metadata: enzyme-to-json: 3.6.2 eslint: 8.8.0 eslint-config-prettier: 8.3.0 + eslint-plugin-jest: ^26.1.0 eslint-plugin-jsdoc: 37.8.0 eslint-plugin-lodash: ^7.2.0 - eslint-plugin-no-only-tests: 2.6.0 eslint-plugin-prettier: 4.0.0 eslint-plugin-react: 7.28.0 eslint-plugin-react-hooks: 4.3.0