From c231d5642bb8a7a8b82200e91b366ab2eba1c232 Mon Sep 17 00:00:00 2001 From: "Ed Cole (OzoneTank)" Date: Tue, 6 Mar 2018 17:10:49 -0500 Subject: [PATCH] linter catches `.only(` and linter happens after unit tests --- .eslintrc | 8 +++++++- package.json | 3 ++- yarn.lock | 10 ++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 76d701e..c16dc54 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,9 @@ { - "extends": "smashing-boxes/react" + "extends": "smashing-boxes/react", + "plugins": [ + "mocha" + ], + "rules": { + "mocha/no-exclusive-tests": "error" + } } diff --git a/package.json b/package.json index 9ff63e0..5eff8c7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint:css": "stylelint 'src/css/**/*.css' || true", "lint:js": "eslint --format 'node_modules/eslint-friendly-formatter' --ext .js,.jsx ./src ./modules", "lint:dev": "npm run lint -- -w", - "pretest": "npm run lint:css && npm run lint:js", + "posttest": "npm run lint:css && npm run lint:js", "test": "NODE_ENV=test mocha --require babel-register --opts 'support/mocha.opts'", "test:dev": "npm test -- -w", "build": "webpack -d --progress --colors", @@ -64,6 +64,7 @@ "eslint-config-smashing-boxes": "^2.0.0", "eslint-friendly-formatter": "^2.0.6", "eslint-loader": "^1.6.1", + "eslint-plugin-mocha": "^4.12.1", "eslint-plugin-react": "^6.8.0", "extract-text-webpack-plugin": "^3.0.2", "faker": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index 5440c1b..18ec797 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2338,6 +2338,12 @@ eslint-loader@^1.6.1: object-assign "^4.0.1" object-hash "^1.1.4" +eslint-plugin-mocha@^4.12.1: + version "4.12.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-4.12.1.tgz#dbacc543b178b4536ec5b19d7f8e8864d85404bf" + dependencies: + ramda "^0.25.0" + eslint-plugin-react@^6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.8.0.tgz#741ab5438a094532e5ce1bbb935d6832356f492d" @@ -5612,6 +5618,10 @@ querystringify@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-1.0.0.tgz#6286242112c5b712fa654e526652bf6a13ff05cb" +ramda@^0.25.0: + version "0.25.0" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" + randomatic@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb"