ESLint plugin containing rules useful for QUnit tests.
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.
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') . |
πΌ Configurations enabled in.
β
Set in the recommended
configuration.
π§ Automatically fixable by the --fix
CLI option.
π‘ Manually fixable by editor suggestions.
NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | Description | πΌ | π§ | π‘ |
---|---|---|---|---|
assert-args | enforce that the correct number of assert arguments are used | β | ||
literal-compare-order | enforce comparison assertions have arguments in the right order | β | π§ | |
no-arrow-tests | disallow arrow functions as QUnit test/module callbacks | π§ | ||
no-assert-equal | disallow the use of assert.equal | β | π‘ | |
no-assert-equal-boolean | require use of boolean assertions | β | π§ | |
no-assert-logical-expression | disallow binary logical expressions in assert arguments | β | ||
no-assert-ok | disallow the use of assert.ok/assert.notOk | |||
no-async-in-loops | disallow async calls in loops | β | ||
no-async-module-callbacks | disallow async module callbacks | β | ||
no-async-test | disallow the use of asyncTest or QUnit.asyncTest | β | ||
no-commented-tests | disallow commented tests | β | ||
no-compare-relation-boolean | disallow comparing relational expressions to booleans in assertions | β | π§ | |
no-conditional-assertions | disallow assertions within if statements or conditional expressions | β | ||
no-early-return | disallow early return in tests | β | ||
no-global-assertions | disallow global QUnit assertions | β | ||
no-global-expect | disallow global expect | β | ||
no-global-module-test | disallow global module/test/asyncTest | β | ||
no-global-stop-start | disallow global stop/start | β | ||
no-hooks-from-ancestor-modules | disallow the use of hooks from ancestor modules | β | ||
no-identical-names | disallow identical test and module names | β | ||
no-init | disallow use of QUnit.init | β | ||
no-jsdump | disallow use of QUnit.jsDump | β | ||
no-loose-assertions | disallow the use of assert.equal/assert.ok/assert.notEqual/assert.notOk | |||
no-negated-ok | disallow negation in assert.ok/assert.notOk | β | π§ | |
no-nested-tests | disallow nested QUnit.test() calls | β | ||
no-ok-equality | disallow equality comparisons in assert.ok/assert.notOk | β | π§ | |
no-only | disallow QUnit.only | β | ||
no-qunit-push | disallow QUnit.push | β | ||
no-qunit-start-in-tests | disallow QUnit.start() within tests or test hooks | β | ||
no-qunit-stop | disallow QUnit.stop | β | ||
no-reassign-log-callbacks | disallow overwriting of QUnit logging callbacks | β | ||
no-reset | disallow QUnit.reset | β | ||
no-setup-teardown | disallow setup/teardown module hooks | β | π§ | |
no-skip | disallow QUnit.skip | |||
no-test-expect-argument | disallow the expect argument in QUnit.test | β | ||
no-throws-string | disallow assert.throws() with block, string, and message args | β | ||
require-expect | enforce that expect is called |
β | ||
require-object-in-propequal | enforce use of objects as expected value in assert.propEqual |
β | ||
resolve-async | require that async calls are resolved | β |
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Like ESLint itself, this ESLint plugin follows semantic versioning. 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.
- An existing plugin configuration is changed in any way, including but not limited to: