Skip to content

Commit

Permalink
Merge pull request #200 from Lakitna/recommended-ruleset
Browse files Browse the repository at this point in the history
Added recommended ruleset
  • Loading branch information
lo1tuma authored Jul 17, 2019
2 parents 6fd87a9 + 0f4ab83 commit ae913c5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ ESLint rules for [mocha](http://mochajs.org/).

This plugin requires ESLint `4.0.0` or later.

`npm install --save-dev eslint-plugin-mocha`
```bash
npm install --save-dev eslint-plugin-mocha
```

Then add a reference to this plugin and selected rules in your eslint config:

Expand All @@ -21,16 +23,28 @@ Then add a reference to this plugin and selected rules in your eslint config:
"plugins": [
"mocha"
],
"rules": {
"mocha/no-exclusive-tests": "error"
}
}
```

### Recommended config

This plugin exports a recommended config that enforces good practices.

Enable it with the extends option:

```json
{
"extends": [
"plugin:mocha/recommended"
],
}
```

See [Configuring Eslint](http://eslint.org/docs/user-guide/configuring) on [eslint.org](http://eslint.org) for more info.

## Rules documentation

The documentation of the rules can be found [here](docs/rules).
The documentation of the rules [can be found here](docs/rules).

## When Not To Use It

Expand Down
21 changes: 20 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,26 @@ module.exports = {
configs: {
recommended: {
rules: {
'mocha/no-exclusive-tests': 2
'mocha/handle-done-callback': 'error',
'mocha/max-top-level-suites': [ 'error', { limit: 1 } ],
'mocha/no-exclusive-tests': 'warn',
'mocha/no-global-tests': 'error',
'mocha/no-hooks': 'off',
'mocha/no-hooks-for-single-case': 'warn',
'mocha/no-identical-title': 'error',
'mocha/no-mocha-arrows': 'error',
'mocha/no-nested-tests': 'error',
'mocha/no-pending-tests': 'warn',
'mocha/no-return-and-callback': 'error',
'mocha/no-setup-in-describe': 'error',
'mocha/no-sibling-hooks': 'error',
'mocha/no-skipped-tests': 'warn',
'mocha/no-synchronous-tests': 'off',
'mocha/no-top-level-hooks': 'warn',
'mocha/prefer-arrow-callback': 'off',
'mocha/valid-suite-description': 'off',
'mocha/valid-test-description': 'off',
'mocha/no-async-describe': 'error'
}
}
}
Expand Down

0 comments on commit ae913c5

Please sign in to comment.