🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-no-array-any

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-array-any

A rule that prevents declaring arrays and objects without a type.

1.0.2
latest
Source
npm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-no-array-any

What is this?

This is a rule that disallows declaring arrays and objects that do not have a type. For example:

// Bad
const myArray = [];

// Good
const myArray: string[] = [];

// Bad
const myMap = new Map();

// Good
const myMap = new Map<string, string>();

This is useful because the noImplicitAny TypeScript compiler flag does not catch this pattern. Declaring objects without the type can make code harder to read, especially if the array/object is instantiated far away from where it is mutated.


How do I use it?

  • npm install --save-dev eslint-plugin-no-array-any
  • Add "plugin:no-array-any/recommended" to the extends section of your .eslintrc.js file.

What rules does this plugin provide?

It only provides one rule: "no-array-any/no-array-any"


Keywords

eslint

FAQs

Package last updated on 27 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts