Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ESLint
  3. De Morgan

De Morgan

MITTypeScriptv2.1.3

An ESLint plugin that enforces logical consistency by transforming negated boolean expressions using De Morgan's laws.

GitHubGitHub
315 stars2 forks0 contributors

What is De Morgan?

ESLint Plugin De Morgan is an ESLint plugin that automatically transforms negated boolean expressions using De Morgan's laws. It rewrites expressions like `!(A && B)` into `!A || !B` and `!(A || B)` into `!A && !B` to improve logical clarity and consistency in code.

Target Audience

JavaScript and TypeScript developers who want to enforce consistent boolean logic transformations and improve code readability in their projects.

Value Proposition

It provides automated, mathematically grounded transformations that reduce logical errors and enhance code clarity, integrating seamlessly into existing ESLint workflows with auto-fix capabilities.

Overview

🧵 ESLint plugin for transforming negated boolean expressions via De Morgan’s laws

Use Cases

Best For

  • Enforcing consistent boolean expression styles across a codebase
  • Automatically simplifying complex negated logical conditions
  • Reducing subtle logical bugs in conditional statements
  • Improving code readability in projects with heavy boolean logic
  • Integrating mathematical Boolean algebra principles into code reviews
  • Teaching or reinforcing De Morgan's laws in programming contexts

Not Ideal For

  • Projects where boolean expressions are intentionally written with negations for specific readability or domain logic
  • Teams using minimal ESLint configurations or preferring linter-free development environments
  • Codebases that require comprehensive logical optimizations beyond De Morgan's laws, such as boolean simplification or other algebraic transformations

Pros & Cons

Pros

Automated Logical Fixes

Provides auto-fix capabilities via ESLint's --fix option, automatically rewriting negated expressions like !(a && b) into !a || !b without manual intervention.

Mathematical Foundation

Grounded in De Morgan's laws from Boolean algebra, ensuring transformations are logically correct and consistent, as emphasized in the README's philosophy.

Easy Integration

Offers ready-made configs for both flat and legacy ESLint configurations, simplifying setup with minimal configuration effort.

Clear Examples

Includes detailed examples in the README, such as transforming complex expressions like !(a || !b || c >= 10), making it easy to understand the transformations.

Cons

Limited Rule Set

Only includes two rules (no-negated-conjunction and no-negated-disjunction), missing broader boolean logic optimizations or edge cases like nested negations with mixed operators.

Style Override Risk

May enforce transformations that override team preferences for negation placement, potentially reducing readability in contexts where negated expressions are clearer.

ESLint Dependency

Requires ESLint to be installed and configured, adding overhead for projects not already using ESLint or opting for alternative linting tools.

Frequently Asked Questions

Quick Stats

Stars315
Forks2
Contributors0
Open Issues0
Last commit3 days ago
CreatedSince 2025

Tags

#developer-tools#boolean-logic#typescript#code-quality#eslint-rules#eslint-plugin#javascript#code-transformation#eslint#static-analysis

Included in

ESLint4.7k
Auto-fetched 1 day ago

Related Projects

UnicornUnicorn

More than 300 powerful ESLint rules

Stars5,224
Forks493
Last commit7 days ago
SonarJSSonarJS

SonarSource Static Analyzer for JavaScript and TypeScript

Stars1,265
Forks192
Last commit1 day ago
dependdepend

An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.

Stars492
Forks13
Last commit17 days ago
GitHubGitHub

An opinionated collection of ESLint rules used by GitHub.

Stars335
Forks68
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub