diff --git a/services/web/.eslintrc b/services/web/.eslintrc index 38d2ce50bb..3d0b68ae71 100644 --- a/services/web/.eslintrc +++ b/services/web/.eslintrc @@ -1,9 +1,23 @@ { "extends": ["standard"], + "plugins": [ + "chai-expect", + "chai-friendly" + ], "env": { "mocha": true }, "globals": { "expect": true + }, + "rules": { + "max-len": "error", + + // Add some chai specific rules + "chai-expect/missing-assertion": "error", + "chai-expect/terminating-properties": "error", + // Swap the no-unused-expressions rule with a more chai-friendly one + "no-unused-expressions": 0, + "chai-friendly/no-unused-expressions": "error" } } \ No newline at end of file diff --git a/services/web/npm-shrinkwrap.json b/services/web/npm-shrinkwrap.json index 1cce956554..2b7714dd4e 100644 --- a/services/web/npm-shrinkwrap.json +++ b/services/web/npm-shrinkwrap.json @@ -2981,6 +2981,18 @@ } } }, + "eslint-plugin-chai-expect": { + "version": "1.1.1", + "from": "eslint-plugin-chai-expect@latest", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-expect/-/eslint-plugin-chai-expect-1.1.1.tgz", + "dev": true + }, + "eslint-plugin-chai-friendly": { + "version": "0.4.1", + "from": "eslint-plugin-chai-friendly@latest", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", + "dev": true + }, "eslint-plugin-import": { "version": "2.9.0", "from": "eslint-plugin-import@>=2.9.0 <3.0.0", diff --git a/services/web/package.json b/services/web/package.json index 9d060afead..ffb75186b7 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -102,6 +102,8 @@ "eslint": "^4.18.1", "eslint-config-standard": "^11.0.0", "eslint-loader": "^1.9.0", + "eslint-plugin-chai-expect": "^1.1.1", + "eslint-plugin-chai-friendly": "^0.4.1", "eslint-plugin-import": "^2.9.0", "eslint-plugin-node": "^6.0.0", "eslint-plugin-promise": "^3.6.0",