Sfoglia il codice sorgente

Configure eslint to be more friendly to chai assertions

Alasdair Smith 8 anni fa
parent
commit
6f58c60026
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 12 0
      services/web/.eslintrc

+ 12 - 0
services/web/.eslintrc

@@ -1,9 +1,21 @@
 {
   "extends": ["standard"],
+  "plugins": [
+    "chai-expect",
+    "chai-friendly"
+  ],
   "env": {
     "mocha": true
   },
   "globals": {
     "expect": true
+  },
+  "rules": {
+    // 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"
   }
 }