Registry / testing / eslint-plugin-de-morgan

eslint-plugin-de-morgan

JSON →
library2.1.1jsnpmunverified

ESLint plugin that enforces De Morgan's laws to transform negated boolean expressions into clearer equivalents. Current stable version 2.1.1, released monthly. Ships TypeScript types. Supports ESLint 8, 9, and 10. Key differentiator: auto-fixes negated conjunctions and disjunctions in code, reducing logical errors. ESM-only since v2.0.0, requires Node.js 20+ or 22+.

npm install eslint-plugin-de-morgan
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-DE-M
E
eslint-plugin-de-morgan
testingjavascriptv2.1.1
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 deMorgan from 'eslint-plugin-de-morgan'
const deMorgan = require('eslint-plugin-de-morgan')
ESM-only since v2.0.0; requires 'import' statement.
recommended config
import deMorgan from 'eslint-plugin-de-morgan'; export default [deMorgan.configs.recommended]
module.exports = { extends: ['plugin:de-morgan/recommended'] }
Flat config (eslint.config.js) uses deMorgan.configs.recommended; legacy config uses 'plugin:de-morgan/recommended-legacy'.
rules
import deMorgan from 'eslint-plugin-de-morgan'; const rules = deMorgan.rules['no-negated-conjunction']
const rules = require('eslint-plugin-de-morgan').rules.no-negated-conjunction
Individual rules access via deMorgan.rules. Legacy require pattern fails in ESM.

Shows how to use the plugin with flat config and enable both rules.

import deMorgan from 'eslint-plugin-de-morgan'; export default [ deMorgan.configs.recommended, { plugins: { 'de-morgan': deMorgan }, rules: { 'de-morgan/no-negated-conjunction': 'warn', 'de-morgan/no-negated-disjunction': 'error' } } ];
Debug
Known issues
breakingv2.0.0 dropped CommonJS support; require() fails.
fix
Use ESM imports (import deMorgan from 'eslint-plugin-de-morgan').
affects: >=2.0.0
breakingv2.0.0 dropped Node.js 18 support.
fix
Upgrade to Node.js 20 or 22.
affects: >=2.0.0
breakingv2.0.0 removed legacy getSourceCode() function.
fix
Use context.sourceCode or sourceCode property from rule context.
affects: >=2.0.0
gotchaLegacy config must use 'plugin:de-morgan/recommended-legacy' instead of 'plugin:de-morgan/recommended'.
fix
Use 'recommended-legacy' in .eslintrc.js extends array.
affects: >=2.0.0
gotchaFlat config users must not mix legacy extends; only use deMorgan.configs.recommended.
fix
Use deMorgan.configs.recommended in eslint.config.js.
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() with plugin v2+ which is ESM-only.
fix
Change to 'import deMorgan from 'eslint-plugin-de-morgan'' and ensure package.json has 'type': 'module'.
Configuration for rule 'de-morgan/no-negated-conjunction' is invalid
Misconfigured rule severity or options in legacy config.
fix
Ensure rule is defined under 'rules' object: 'de-morgan/no-negated-conjunction': 'error'.
Cannot find module 'eslint-plugin-de-morgan'
Plugin not installed or missing from package.json.
fix
Run 'npm install --save-dev eslint-plugin-de-morgan'.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to function
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-de-morgan — npm install eslint-plugin-de-morgan · libregistry