eslint-plugin-qunit
raw JSON → 8.2.6 verified Sat Apr 25 auth: no javascript
ESLint plugin with rules specific to QUnit testing framework. Current stable version is 8.2.6, released February 2026. The plugin provides 20+ rules including recommended configurations for catching common QUnit mistakes (e.g., assert argument order, async handling, global usage). Actively maintained, supporting ESLint 8 and 9 with flat config support since v8.1.0. Ships TypeScript types since v8.2.0. Compared to generic linting, it catches QUnit-specific runtime errors and anti-patterns. Peer dependency on eslint >=8.38.0.
Common errors
error Error: Failed to load plugin 'qunit': Cannot find module 'eslint-plugin-qunit' ↓
cause ESLint cannot locate the package; not installed or not in node_modules.
fix
Run npm install eslint-plugin-qunit --save-dev in your project root.
error Parsing error: 'import' and 'export' may only appear at the top level ↓
cause Using ESM import syntax in .eslintrc.js file without enabling sourceType.
fix
Set 'sourceType': 'module' in parserOptions, or rename to eslint.config.js.
error Configuration for rule 'qunit/no-assert-equal' is invalid: severity should be one of ... ↓
cause Rule configuration is malformed, e.g., severity level as string instead of number.
fix
Set severity as number: 'qunit/no-assert-equal': 2 (error) or 'error'.
Warnings
breaking ESLint v9 no longer supports .eslintrc config style; must use flat config. ↓
fix Migrate to eslint.config.js using import syntax; see QUnit plugin v8.1.0 release notes.
gotcha Setting 'qunit/assert-args' to error will flag missing or extra arguments in assertions, which may break existing test suites with intentionally loose calls. ↓
fix Review test code and fix assertion arguments to match QUnit's expected interface, or adjust rule severity.
gotcha Recommended config includes 'no-assert-equal' which disallows assert.equal/assert.strictEqual; use assert.deepEqual or assert.propEqual instead. ↓
fix Replace assert.equal with assert.deepEqual or assert.propEqual for deep comparison, or assert.strictEqual for strict equality (if strict equality is intended).
deprecated The 'qunit/no-commented-tests' rule is deprecated and will be removed in a future version. ↓
fix Use 'no-commented-tests' from eslint-plugin-qunit at your own risk; consider custom ESLint disable comments instead.
breaking Flat config requires importing plugin configs directly, not via 'plugin:qunit/recommended' string. ↓
fix Use import statement as shown in quickstart; see v8.1.0 migration notes.
Install
npm install eslint-plugin-qunit yarn add eslint-plugin-qunit pnpm add eslint-plugin-qunit Imports
- configs.recommended wrong
const recommended = require('eslint-plugin-qunit/configs/recommended');correctimport eslintPluginQunitRecommended from 'eslint-plugin-qunit/configs/recommended'; - plugin wrong
const { rules } = require('eslint-plugin-qunit');correctimport plugin from 'eslint-plugin-qunit'; - rules
import { rules } from 'eslint-plugin-qunit/rules';
Quickstart
// eslint.config.js (flat config)
import js from '@eslint/js';
import qunitPlugin from 'eslint-plugin-qunit';
import qunitRecommended from 'eslint-plugin-qunit/configs/recommended';
export default [
js.configs.recommended,
qunitRecommended,
{
plugins: {
qunit: qunitPlugin,
},
rules: {
'qunit/no-arrow-tests': 'error',
'qunit/no-async-in-loops': 'warn',
},
},
];