platinumazure / eslint-plugin-qunit

ESLint plugin containing rules useful for QUnit tests.
MIT License
30 stars 22 forks source link
eslint-plugin qunit

eslint-plugin-qunit

NPM version CI Coverage Status Join the chat at https://gitter.im/platinumazure/eslint-plugin-qunit

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.

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 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 βœ…

Contributors

Thanks goes to these wonderful people (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 specification. Contributions of any kind welcome!

Semantic Versioning Policy

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: