eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

no-unnecessary-initialization

ESLint plugin / no-unnecessary-initialization

Disallows unnecessary initialization.

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

Examples of incorrect code

const x = undefined;

class C {
  x = undefined;
}

Examples of correct code

const x = 1;

class C {
  x = 1;
}