Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint-plugin-mocha to eslint configuration. #597

Merged
merged 5 commits into from
Feb 25, 2020
Merged

Add eslint-plugin-mocha to eslint configuration. #597

merged 5 commits into from
Feb 25, 2020

Conversation

jodator
Copy link
Contributor

@jodator jodator commented Feb 20, 2020

Suggested merge commit message (convention)

Feature: Add "eslint-plugin-mocha" rules to the default ESLint configuration and configure dangling-coma rule. Closes #481. Closes ckeditor/ckeditor5#6246.


Additional information

  1. These rule invalidates test() to be used inside it() as it prevents nesting it() or test() - which is an error. (simple rename test() to something else will do)
  2. Some beforeEach() duplication on the same level
  3. Some false-positives for no-top-level-hooks (this rule important to keep)

PRs for those will be linked here.

@jodator
Copy link
Contributor Author

jodator commented Feb 21, 2020

I've configured below rules for Mocha:

level fixable rule description
error handle-done-callback enforces handling of callbacks for async tests
error 🔧 no-async-describe disallow async functions passed to describe
error no-exclusive-tests disallow exclusive mocha tests
error no-global-tests disallow global tests
error no-nested-tests disallow tests to be nested within other tests
error no-pending-tests disallow pending/unimplemented mocha tests
error no-sibling-hooks disallow duplicate uses of a hook at the same level inside a describe
error no-top-level-hooks disallow top-level hooks
warn no-identical-title disallow identical titles

and dangling-comma.

@jodator jodator marked this pull request as ready for review February 21, 2020 14:58
@coveralls
Copy link

coveralls commented Feb 21, 2020

Coverage Status

Coverage remained the same at 91.604% when pulling fd239d9 on i/481 into 150fd8e on master.

@jodator
Copy link
Contributor Author

jodator commented Feb 21, 2020

ps.: I've found only this much .only removals (the bolded ones are mine :P )

Selection_179

@pomek pomek merged commit 0bd390a into master Feb 25, 2020
@pomek pomek deleted the i/481 branch February 25, 2020 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add eslint-plugin-mocha for eslint configuration. Disable dangling commas across the project
3 participants