gitwtfhub

wtf is eslint-node-test?

sindresorhus/eslint-node-test — explained in plain English

Analysis updated 2026-05-18

60JavaScriptAudience · developerComplexity · 2/5Setup · easy

TL;DR

An ESLint plugin with rules that catch mistakes and enforce consistency in tests written for Node.js's built-in test runner.

Mindmap

mindmap
  root((eslint-node-test))
    What it does
      Lints node test files
      Enforces consistent style
      Catches common mistakes
    Tech stack
      JavaScript
      ESLint
      node test
    Use cases
      Enforcing test conventions
      Catching assertion mistakes
      Auto fixing test style
    Audience
      Developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Catch common mistakes in tests written with Node.js's built-in node:test runner.

REASON 2

Enforce a consistent order for test setup and teardown hooks across a project.

REASON 3

Automatically fix simple test style issues using ESLint's fix option.

REASON 4

Prevent tests from mixing callback style and Promise style in the same test.

What's in the stack?

JavaScriptESLintnode:test

How it stacks up

sindresorhus/eslint-node-testektogamat/r3f-webgpu-perffreecodecamp/news-translation-tasks
Stars606060
LanguageJavaScriptJavaScriptJavaScript
Last pushed2026-03-16
MaintenanceMaintained
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Requires ESLint 10.4 or newer with flat config and an ESM project.

No license information was found in the README.

Wtf does this do

eslint-node-test is a plugin for ESLint, the popular JavaScript code checking tool, that focuses specifically on tests written with node:test, the test runner built directly into Node.js. Its job is to catch common mistakes in how tests are written and to nudge every test file in a project toward a more consistent style, the same way ESLint already does for regular application code. Setting it up means installing it alongside ESLint and adding it to a project's ESLint configuration file, either by turning on one of the ready made presets or by picking specific rules to enable one at a time. It requires a fairly recent version of ESLint that uses the newer flat config format, along with a project set up to use ES modules rather than the older CommonJS style. The rules are written so they only turn on inside files that actually import from node:test or Node's built in assert module, so the plugin can safely be applied across an entire codebase without interfering with unrelated files. The plugin ships a large collection of individual rules, each targeting a specific pattern such as enforcing a consistent order for setup and teardown hooks, disallowing assertions written directly inside a describe block instead of inside an actual test, requiring async test functions to actually use await, and preventing tests from mixing callback and Promise based styles at the same time. Several of these rules can automatically fix the code for you when ESLint is run with its fix option, while others offer suggested fixes that a developer can apply manually inside their editor.

Yoink these prompts

Prompt 1
Help me install eslint-node-test and enable the recommended preset in my eslint.config.js.
Prompt 2
Explain what the no-assert-in-describe rule catches and why it matters.
Prompt 3
Show me how to enable individual rules from this plugin instead of the full preset.
Prompt 4
Walk me through the ESLint and module requirements this plugin needs to run.

Frequently asked questions

wtf is eslint-node-test?

An ESLint plugin with rules that catch mistakes and enforce consistency in tests written for Node.js's built-in test runner.

What language is eslint-node-test written in?

Mainly JavaScript. The stack also includes JavaScript, ESLint, node:test.

What license does eslint-node-test use?

No license information was found in the README.

How hard is eslint-node-test to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is eslint-node-test for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.