eslint-plugin-de-morgan weekly downloads statistics
By azat-io (2 listings) · npm · ESLint plugins
ESLint plugin for transforming negated boolean expressions via De Morgan’s laws
eslint-plugin-de-morgan has 101,700 recorded weekly downloads on npm, an increase of 96.5% over the past 30 days, ranking #636 of 3,247 tracked listings.
About eslint-plugin-de-morgan
ESLint Plugin De Morgan
<img src="https://raw.githubusercontent.com/azat-io/eslint-plugin-de-morgan/main/assets/logo.svg" alt="ESLint Plugin De Morgan logo" align="right" height="160" />
An ESLint plugin that enforces logical consistency by transforming negated boolean expressions according to De Morgan’s laws.
This plugin automatically rewrites negated conjunctions and disjunctions to improve code clarity and reduce potential logical errors.
Why
In Boolean algebra, De Morgan’s laws are two transformation rules that are both valid rules of inference. They are named after Augustus De Morgan and are fundamental in the fields of mathematics, computer science, and digital logic. The laws state that:
First Law:
¬(A ∧ B) ≡ (¬A) ∨ (¬B)
Second Law:
¬(A ∨ B) ≡ (¬A) ∧ (¬B)
Using these principles, the plugin provides two ESLint rules:
- no-negated-conjunction — Transforms negated conjunctions (i.e. expressions of the form !(A && B)) into the equivalent disjunction of negations (!A || !B).
- no-negated-disjunction — Transforms negated disjunctions (i.e. expressions of the form !(A || B)) into the equivalent conjunction of negations (!A && !B).
These transformations are grounded in Boolean algebra and can help make the logic of your code more explicit and easier to understand.
Why Use De Morgan’s Laws?
De Morgan’s laws are a cornerstone of Boolean algebra and have several practical benefits in programming:
-
Clarity: Rewriting complex negations often results in expressions that more clearly communicate the underlying logic.
-
Avoiding Logical Errors: When dealing with nested logical expressions, small mistakes in the placement of negations can lead to subtle bugs. By enforcing a consistent style based on well-known laws, the plugin helps reduce such errors.
-
Simplification: In some cases, the transformed expression may be simpler to evaluate and optimize, both for human readers and for compilers / interpreters.
Examples
Base example
Before:
if (!(a && b)) {
/* ... */
}
After:
if (!a || !b) {
/* ... */
}
More complex example
Before:
if (!(a || !b || c >= 10 || d !== e)) {
/* ... */
}
After:
if (!a && b && !(c >= 10) && d === e) {
/* ... */
}
Installation
You'll first need to install ESLint or Oxlint:
npm install --save-dev eslint
# or
npm install --save-dev oxlint
Next, install eslint-plugin-de-morgan:
npm install --save-dev eslint-plugin-de-morgan
Usage
The easiest way to use eslint-plugin-de-morgan is to use ready-made config.
Flat Config (eslint.config.js)
<!-- prettier-ignore -->
import deMorgan from 'eslint-plugin-de-morgan'
export default [
deMorgan.configs.recommended,
]
Legacy Config (.eslintrc.js)
<!-- prettier-ignore -->
module.exports = {
extends: [
'plugin:de-morgan/recommended-legacy',
],
}
Oxlint (.oxlintrc.json)
Oxlint loads the plugin as a JS plugin and does not use its ready-made configs, so enable the rules directly:
{
"jsPlugins": ["eslint-plugin-de-morgan"],
"rules": {
"de-morgan/no-negated-conjunction": "error",
"de-morgan/no-negated-disjunction": "error"
}
}
Rules
🔧 Automatically fixable by the
--fix CLI option.
| Name | Description | 🔧 |
|---|---|---|
| no-negated-conjunction | Transforms the negation of a conjunction into the equivalent disjunction | 🔧 |
| no-negated-disjunction | Transforms the negation of a disjunction into the equivalent conjunction | 🔧 |
Further Reading
Versioning Policy
This plugin is following Semantic Versioning and ESLint's Semantic Versioning Policy.
Contributing
See Contributing Guide.
License
MIT © Azat S.
Description from the npm listing.
- eslint
- eslint-plugin
- de-morgan
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm ESLint plugins plugins
All 20 eslint-plugin-de-morgan alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-de-morgan. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.