Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/platinumazure/eslint-plugin-qunit

ESLint plugin containing rules useful for QUnit tests.
https://github.com/platinumazure/eslint-plugin-qunit

eslint-plugin qunit

Last synced: 11 days ago
JSON representation

ESLint plugin containing rules useful for QUnit tests.

Awesome Lists containing this project

README

        

# eslint-plugin-qunit

[![NPM version](https://img.shields.io/npm/v/eslint-plugin-qunit.svg?style=flat)](https://npmjs.org/package/eslint-plugin-qunit)
![CI](https://github.com/platinumazure/eslint-plugin-qunit/workflows/CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/platinumazure/eslint-plugin-qunit/badge.svg?branch=main&service=github)](https://coveralls.io/github/platinumazure/eslint-plugin-qunit?branch=main)
[![Join the chat at https://gitter.im/platinumazure/eslint-plugin-qunit](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/platinumazure/eslint-plugin-qunit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

ESLint plugin containing rules useful for QUnit tests.

## Configurations

You can extend from a configuration in order to simplify manual configuration of plugin rules in your project.

For more details on how to extend your configuration from a plugin configuration, please see the [ESLint plugin configuration documentation](https://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin).

| | Name | Description |
| :--- | :--- | :--- |
| βœ… | `recommended` | This configuration includes rules which I recommend to avoid QUnit runtime errors or incorrect behavior, some of which can be difficult to debug. Some of these rules also encourage best practices that help QUnit work better for you. For ESLint `.eslintrc.js` legacy config, extend from `"plugin:qunit/recommended"`. For ESLint `eslint.config.js` flat config, load from `require('eslint-plugin-qunit/configs/recommended')`. |

## Rules

πŸ’Ό [Configurations](https://github.com/platinumazure/eslint-plugin-qunit/blob/main/README.md#configurations) enabled in.\
βœ… Set in the `recommended` [configuration](https://github.com/platinumazure/eslint-plugin-qunit/blob/main/README.md#configurations).\
πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ |
| :----------------------------------------------------------------------------- | :---------------------------------------------------------------------- | :- | :- | :- |
| [assert-args](docs/rules/assert-args.md) | enforce that the correct number of assert arguments are used | βœ… | | |
| [literal-compare-order](docs/rules/literal-compare-order.md) | enforce comparison assertions have arguments in the right order | βœ… | πŸ”§ | |
| [no-arrow-tests](docs/rules/no-arrow-tests.md) | disallow arrow functions as QUnit test/module callbacks | | πŸ”§ | |
| [no-assert-equal](docs/rules/no-assert-equal.md) | disallow the use of assert.equal | βœ… | | πŸ’‘ |
| [no-assert-equal-boolean](docs/rules/no-assert-equal-boolean.md) | require use of boolean assertions | βœ… | πŸ”§ | |
| [no-assert-logical-expression](docs/rules/no-assert-logical-expression.md) | disallow binary logical expressions in assert arguments | βœ… | | |
| [no-assert-ok](docs/rules/no-assert-ok.md) | disallow the use of assert.ok/assert.notOk | | | |
| [no-async-in-loops](docs/rules/no-async-in-loops.md) | disallow async calls in loops | βœ… | | |
| [no-async-module-callbacks](docs/rules/no-async-module-callbacks.md) | disallow async module callbacks | βœ… | | |
| [no-async-test](docs/rules/no-async-test.md) | disallow the use of asyncTest or QUnit.asyncTest | βœ… | | |
| [no-commented-tests](docs/rules/no-commented-tests.md) | disallow commented tests | βœ… | | |
| [no-compare-relation-boolean](docs/rules/no-compare-relation-boolean.md) | disallow comparing relational expressions to booleans in assertions | βœ… | πŸ”§ | |
| [no-conditional-assertions](docs/rules/no-conditional-assertions.md) | disallow assertions within if statements or conditional expressions | βœ… | | |
| [no-early-return](docs/rules/no-early-return.md) | disallow early return in tests | βœ… | | |
| [no-global-assertions](docs/rules/no-global-assertions.md) | disallow global QUnit assertions | βœ… | | |
| [no-global-expect](docs/rules/no-global-expect.md) | disallow global expect | βœ… | | |
| [no-global-module-test](docs/rules/no-global-module-test.md) | disallow global module/test/asyncTest | βœ… | | |
| [no-global-stop-start](docs/rules/no-global-stop-start.md) | disallow global stop/start | βœ… | | |
| [no-hooks-from-ancestor-modules](docs/rules/no-hooks-from-ancestor-modules.md) | disallow the use of hooks from ancestor modules | βœ… | | |
| [no-identical-names](docs/rules/no-identical-names.md) | disallow identical test and module names | βœ… | | |
| [no-init](docs/rules/no-init.md) | disallow use of QUnit.init | βœ… | | |
| [no-jsdump](docs/rules/no-jsdump.md) | disallow use of QUnit.jsDump | βœ… | | |
| [no-loose-assertions](docs/rules/no-loose-assertions.md) | disallow the use of assert.equal/assert.ok/assert.notEqual/assert.notOk | | | |
| [no-negated-ok](docs/rules/no-negated-ok.md) | disallow negation in assert.ok/assert.notOk | βœ… | πŸ”§ | |
| [no-nested-tests](docs/rules/no-nested-tests.md) | disallow nested QUnit.test() calls | βœ… | | |
| [no-ok-equality](docs/rules/no-ok-equality.md) | disallow equality comparisons in assert.ok/assert.notOk | βœ… | πŸ”§ | |
| [no-only](docs/rules/no-only.md) | disallow QUnit.only | βœ… | | |
| [no-qunit-push](docs/rules/no-qunit-push.md) | disallow QUnit.push | βœ… | | |
| [no-qunit-start-in-tests](docs/rules/no-qunit-start-in-tests.md) | disallow QUnit.start() within tests or test hooks | βœ… | | |
| [no-qunit-stop](docs/rules/no-qunit-stop.md) | disallow QUnit.stop | βœ… | | |
| [no-reassign-log-callbacks](docs/rules/no-reassign-log-callbacks.md) | disallow overwriting of QUnit logging callbacks | βœ… | | |
| [no-reset](docs/rules/no-reset.md) | disallow QUnit.reset | βœ… | | |
| [no-setup-teardown](docs/rules/no-setup-teardown.md) | disallow setup/teardown module hooks | βœ… | πŸ”§ | |
| [no-skip](docs/rules/no-skip.md) | disallow QUnit.skip | | | |
| [no-test-expect-argument](docs/rules/no-test-expect-argument.md) | disallow the expect argument in QUnit.test | βœ… | | |
| [no-throws-string](docs/rules/no-throws-string.md) | disallow assert.throws() with block, string, and message args | βœ… | | |
| [require-expect](docs/rules/require-expect.md) | enforce that `expect` is called | βœ… | | |
| [require-object-in-propequal](docs/rules/require-object-in-propequal.md) | enforce use of objects as expected value in `assert.propEqual` | βœ… | | |
| [resolve-async](docs/rules/resolve-async.md) | require that async calls are resolved | βœ… | | |

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):



Kevin Partington

πŸ’» πŸ“– ⚠️ πŸ› πŸ’‘ πŸ‘€

Jordan Eldredge

⚠️ πŸ’¬

Mitch Lloyd

πŸ’» πŸ“– ⚠️

John Mainz

⚠️ πŸ›

Tobias Bieniek

πŸ’» πŸ“– ⚠️

Stephen Edgar

πŸ›

Timo Tijhof

πŸ“– πŸ€”



Ed S

πŸ› πŸ’»

Brad Overton

πŸ› πŸ’»

Shane Martin

πŸ›

ventuno

πŸ’»

Anne-GaΓ«lle Schall

πŸ›

Steve Calvert

πŸ’»

Aliaksandr Yermalayeu

πŸ’»



Bryan Mishkin

πŸ› πŸ’» πŸ“– πŸ€”

XhmikosR

πŸ›

Andrey Fel

πŸ›

Ray Cohen

πŸ› πŸ’»

Baptiste Doucerain

πŸ’»

Darius Dzien

🚧

Derek Wickern

πŸ› πŸ’»

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## Semantic Versioning Policy

Like ESLint itself, this ESLint plugin follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy, based on the policy used by ESLint:

* Patch release (intended not to break your lint build)
* A bug fix in a plugin rule that results in ESLint reporting fewer errors.
* Improvements to documentation.
* Non-user-facing changes such as refactoring code; adding, deleting, or modifying tests; and increasing test coverage.
* Re-releasing after a failed release (i.e., after having published a release that doesn't work for anyone).
* Minor release (might break your lint build)
* A bug fix in a rule that results in ESLint reporting more errors.
* A new rule is created (without being added to plugin configuration).
* A new option to an existing rule is created (without any default options changing).
* A new plugin configuration is created.
* An existing rule is deprecated.
* Major release (likely to break your lint build)
* An existing plugin configuration is changed in any way, including but not limited to:
* A new rule is added to the configuration.
* A rule is removed from the configuration.
* The options used in configuration for a rule are changed
* An existing rule is removed.
* A backward-incompatible change is made to the options of a rule.