Skip to content

Commit

Permalink
Merge pull request #229 from brettz9/recommended-rules
Browse files Browse the repository at this point in the history
Indicate whether rule is recommended
  • Loading branch information
lo1tuma authored Feb 18, 2020
2 parents 6ac703b + 04cdbaa commit c1f8049
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
44 changes: 23 additions & 21 deletions docs/rules/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# Rules

* [handle-done-callback](handle-done-callback.md) - enforces handling of callbacks for async tests
* [max-top-level-suites](max-top-level-suites.md) - limit the number of top-level suites in a single file
* [no-async-describe](no-async-describe.md) - disallow async functions passed to describe (fixable)
* [no-exclusive-tests](no-exclusive-tests.md) - disallow exclusive mocha tests
* [no-global-tests](no-global-tests.md) - disallow global tests
* [no-hooks](no-hooks.md) - disallow hooks
* [no-hooks-for-single-case](no-hooks-for-single-case.md) - disallow hooks for a single test or test suite
* [no-identical-title](no-identical-title.md) - disallow identical titles
* [no-mocha-arrows](no-mocha-arrows.md) - disallow arrow functions as arguments to mocha globals (fixable)
* [no-nested-tests](no-nested-tests.md) - disallow tests to be nested within other tests
* [no-pending-tests](no-pending-tests.md) - disallow pending/unimplemented mocha tests
* [no-return-and-callback](no-return-and-callback.md) - disallow returning in a test or hook function that uses a callback
* [no-return-from-async](no-return-from-async.md) - disallow returning from an async test or hook
* [no-setup-in-describe](no-setup-in-describe.md) - disallow calling functions and dot operators directly in describe blocks
* [no-sibling-hooks](no-sibling-hooks.md) - disallow duplicate uses of a hook at the same level inside a describe
* [no-skipped-tests](no-skipped-tests.md) - disallow skipped mocha tests (fixable)
* [no-synchronous-tests](no-synchronous-tests.md) - disallow synchronous tests
* [no-top-level-hooks](no-top-level-hooks.md) - disallow top-level hooks
* [prefer-arrow-callback](prefer-arrow-callback.md) - prefer arrow function callbacks (mocha-aware) (fixable)
* [valid-suite-description](valid-suite-description.md) - match suite descriptions against a pre-configured regular expression
* [valid-test-description](valid-test-description.md) - match test descriptions against a pre-configured regular expression
|recommended|fixable|rule|description|
|-|-|-|-|
|:heavy_check_mark:|| [handle-done-callback](handle-done-callback.md) | enforces handling of callbacks for async tests
|:heavy_check_mark:|| [max-top-level-suites](max-top-level-suites.md) | limit the number of top-level suites in a single file
|:heavy_check_mark:|:wrench:| [no-async-describe](no-async-describe.md) | disallow async functions passed to describe
|:heavy_check_mark:|| [no-exclusive-tests](no-exclusive-tests.md) | disallow exclusive mocha tests
|:heavy_check_mark:|| [no-global-tests](no-global-tests.md) | disallow global tests
||| [no-hooks](no-hooks.md) | disallow hooks
|:heavy_check_mark:|| [no-hooks-for-single-case](no-hooks-for-single-case.md) | disallow hooks for a single test or test suite
|:heavy_check_mark:|| [no-identical-title](no-identical-title.md) | disallow identical titles
|:heavy_check_mark:|:wrench:| [no-mocha-arrows](no-mocha-arrows.md) | disallow arrow functions as arguments to mocha globals
|:heavy_check_mark:|| [no-nested-tests](no-nested-tests.md) | disallow tests to be nested within other tests
|:heavy_check_mark:|| [no-pending-tests](no-pending-tests.md) | disallow pending/unimplemented mocha tests
|:heavy_check_mark:|| [no-return-and-callback](no-return-and-callback.md) | disallow returning in a test or hook function that uses a callback
||| [no-return-from-async](no-return-from-async.md) | disallow returning from an async test or hook
|:heavy_check_mark:|| [no-setup-in-describe](no-setup-in-describe.md) | disallow calling functions and dot operators directly in describe blocks
|:heavy_check_mark:|| [no-sibling-hooks](no-sibling-hooks.md) | disallow duplicate uses of a hook at the same level inside a describe
|:heavy_check_mark:|:wrench:| [no-skipped-tests](no-skipped-tests.md) | disallow skipped mocha tests
||| [no-synchronous-tests](no-synchronous-tests.md) | disallow synchronous tests
|:heavy_check_mark:|| [no-top-level-hooks](no-top-level-hooks.md) | disallow top-level hooks
||:wrench:| [prefer-arrow-callback](prefer-arrow-callback.md) | prefer arrow function callbacks (mocha-aware)
||| [valid-suite-description](valid-suite-description.md) | match suite descriptions against a pre-configured regular expression
||| [valid-test-description](valid-test-description.md) | match test descriptions against a pre-configured regular expression
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('eslint-plugin-mocha', function () {
it('should be linked in the documentation index', function () {
documentationFiles.forEach(function (file) {
const ruleName = path.basename(file, '.md');
const expectedLink = `* [${ ruleName }](${ file })`;
const expectedLink = `| [${ ruleName }](${ file }) |`;

expect(documentationIndex).to.contain(expectedLink);
});
Expand Down

0 comments on commit c1f8049

Please sign in to comment.