eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

typescript/no-inferrable-types

ESLint plugin / typescript/no-inferrable-types

Reports inferrable types.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/typescript/no-inferrable-types": "error"
  }
};

Examples of incorrect code

function f<T>() {
  const x: T = {} as T;
}

Examples of correct code

function f<T>() {
  const x = {} as T;
}