eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

no-negated-conditions

ESLint plugin / no-negated-conditions

Disallows negated conditions.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/no-negated-conditions": "error"
  }
};

Examples of incorrect code

if (!x && y) {}
if (x !== -1 && y) {}

Examples of correct code

if (x && !y) {}
if (x && y !== -1) {}