Closed chrisj-skinner closed 7 years ago
Unfortunately, this plugin won't help you with mocha. It deals with chai.js assertations only.
Anyway, you just need to enable the mocha environment in the eslintrc.json
like this:
"env": { "browser": true, "commonjs": true, "es6": true, "node": true, "mocha": true }
Thanks
Not sure if I've followed correctly but here my eslintrc.json file.
{ "env": { "browser": true, "commonjs": true, "es6": true, "node": true }, "extends": "eslint:recommended", "parserOptions": { "ecmaFeatures": { "jsx": true }, "sourceType": "module" }, "plugins": [ "chai-friendly" ], "rules": { "indent": [ "error", 3 ], "linebreak-style": [ "error", "unix" ], "quotes": [ "error", "single" ], "semi": [ "error", "always" ], "no-console": [ "error", { "allow": [ "log" ] } ], "no-unused-expressions": 0, "chai-friendly/no-unused-expressions": 2 } }
package.json file
"devDependencies": { "eslint": "^3.17.1", "eslint-plugin-chai-friendly": "^0.3.6", .... },
I'm still getting syntax (no-undef) on 'describe' and 'it' etc