From 8ce19b03e8681475cbbc38300769ea0c7b03e176 Mon Sep 17 00:00:00 2001 From: Walther Date: Wed, 15 Mar 2023 15:11:47 +0200 Subject: [PATCH] chore: eslint mocha plugin, disallow exclusive tests, warn on skip --- .eslintrc | 4 +++- package.json | 3 ++- yarn.lock | 13 +++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index a03b984d6a..45ec021297 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { "extends": [".eslintrc.autogenerated.js"], - "plugins": ["unused-imports"], + "plugins": ["unused-imports", "mocha"], "ignorePatterns": ["*.d.ts*"], "rules": { "@typescript-eslint/no-floating-promises": "warn", @@ -31,6 +31,8 @@ "ignoreTemplateLiterals": true } ], + "mocha/no-skipped-tests": "warn", + "mocha/no-exclusive-tests": "error", "unused-imports/no-unused-imports": "error" } } diff --git a/package.json b/package.json index 88e6c1f879..322474dfaa 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "eslint": "^8.33.0", "eslint-config-prettier": "^8.6.0", "eslint-plugin-jsdoc": "^39.7.5", + "eslint-plugin-mocha": "^10.1.0", "eslint-plugin-no-null": "^1.0.2", "eslint-plugin-react": "^7.32.2", "eslint-plugin-unused-imports": "^2.0.0", @@ -100,4 +101,4 @@ "plugins/*", "sdk" ] -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index ce164af80b..80442ff972 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4293,6 +4293,14 @@ eslint-plugin-jsdoc@^39.9.1: semver "^7.3.8" spdx-expression-parse "^3.0.1" +eslint-plugin-mocha@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.1.0.tgz#69325414f875be87fb2cb00b2ef33168d4eb7c8d" + integrity sha512-xLqqWUF17llsogVOC+8C6/jvQ+4IoOREbN7ZCHuOHuD6cT5cDD4h7f2LgsZuzMAiwswWE21tO7ExaknHVDrSkw== + dependencies: + eslint-utils "^3.0.0" + rambda "^7.1.0" + eslint-plugin-no-null@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/eslint-plugin-no-null/-/eslint-plugin-no-null-1.0.2.tgz#1236a812391390a1877ad4007c26e745341c951f" @@ -9663,6 +9671,11 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== +rambda@^7.1.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.5.0.tgz#1865044c59bc0b16f63026c6e5a97e4b1bbe98fe" + integrity sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"