Registry / testing / eslint-plugin-no-null

eslint-plugin-no-null

JSON →
library1.0.2jsnpmunverified

An ESLint plugin that provides a single rule to disallow null literals, enforcing the use of undefined instead. Version 1.0.2 is the latest stable release. It has no dependencies beyond ESLint (peer dependency >=3.0.0) and is not actively maintained (last release likely older). Differentiators: simple, focused rule for teams preferring undefined over null.

npm install eslint-plugin-no-null
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NO-N
E
eslint-plugin-no-null
testingjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import noNull from 'eslint-plugin-no-null'
const noNull = require('eslint-plugin-no-null')
Plugin is a default export; CJS require also works but ESM is preferred for modern projects.

Shows installation, configuration, and usage of the no-null rule in an ESLint config.

// Install ESLint and plugin // npm install eslint eslint-plugin-no-null --save-dev // .eslintrc.json { "plugins": ["no-null"], "rules": { "no-null/no-null": "error" } } // Example file: app.js // Disallowed: let x = null; // Allowed: let y = undefined;
Debug
Known issues
deprecatedPlugin is no longer actively maintained; may not work with latest ESLint versions.
fix
Consider alternatives like ESLint's built-in 'no-restricted-syntax' rule or 'unicorn/no-null'.
affects: >=1.0.0
gotchaRule only flags null literals, not expressions that may evaluate to null.
fix
Use 'no-restricted-syntax' with a custom selector for more comprehensive null detection.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint: Failed to load plugin 'no-null': Cannot find module 'eslint-plugin-no-null'
The plugin is not installed or missing from node_modules.
fix
Run npm install eslint-plugin-no-null --save-dev
ESLint: Configuration for rule 'no-null/no-null' is invalid: Value "2" is invalid for rule severity.
Using numeric severity instead of string in ESLint config.
fix
Change "no-null/no-null": 2 to "no-null/no-null": "error"
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-no-null — npm install eslint-plugin-no-null · libregistry