Registry /
testing / eslint-plugin-de-morgan
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+.
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
muslnode 18–226 runs
build_error
glibcnode 18–226 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'
}
}
];
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.