Skip to content

Latest commit

 

History

History
77 lines (50 loc) · 2.28 KB

README.md

File metadata and controls

77 lines (50 loc) · 2.28 KB

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