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+.

testing
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.

ESM-only since v2.0.0; requires 'import' statement.

import deMorgan from 'eslint-plugin-de-morgan'

Flat config (eslint.config.js) uses deMorgan.configs.recommended; legacy config uses 'plugin:de-morgan/recommended-legacy'.

import deMorgan from 'eslint-plugin-de-morgan'; export default [deMorgan.configs.recommended]

Individual rules access via deMorgan.rules. Legacy require pattern fails in ESM.

import deMorgan from 'eslint-plugin-de-morgan'; const rules = deMorgan.rules['no-negated-conjunction']

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 footguns
breakingv2.0.0 dropped CommonJS support; require() fails.
breakingv2.0.0 dropped Node.js 18 support.
breakingv2.0.0 removed legacy getSourceCode() function.
gotchaLegacy config must use 'plugin:de-morgan/recommended-legacy' instead of 'plugin:de-morgan/recommended'.
gotchaFlat config users must not mix legacy extends; only use deMorgan.configs.recommended.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
5 hits · last 30 days
ahrefsbot
4
script
1
Resources