Skip to content

pipopotamasu/eslint-plugin-no-implicit-any

Repository files navigation

CI

eslint-plugin-no-implicit-any

typescript-eslint plugin for noImplicitAny.

Installation

npm install --save-dev eslint-plugin-no-implicit-any

Setup

  1. Add no-implicit-any to your list of plugins in your ESLint config.
{
  "plugins": ["no-implicit-any"]
}
  1. Add 'no-implicit-any/no-implicit-any' to your list of rules in your ESLint config.
{
  "rules": { "no-implicit-any/no-implicit-any": "error" }
}

Rule detail

no-implicit-any/no-implicit-any

Disallow no implict any usage. Automatically fixable by the --fix CLI option.

Examples of incorrect code for this rule:

function foo(arg) {}

const foo = (...args) => {};

const foo = { key: (arg) => {} };

const foo = {};
foo['key'];

Examples of correct code for this rule:

function foo(arg: any) {}

const foo = (...args: any[]) => {};

const foo = { key: (arg: any) => {} };

const foo = {};

(foo as any)['key'];

More examples here:

License

MIT