ihordiachenko / eslint-plugin-chai-friendly

Makes eslint friendly towards Chai.js 'expect' and 'should' statements.
MIT License
53 stars 10 forks source link

Install and making no difference to eslint errors #2

Closed chrisj-skinner closed 7 years ago

chrisj-skinner commented 7 years ago

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

ihordiachenko commented 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 }
chrisj-skinner commented 7 years ago

Thanks