🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

eslint-plugin-flowtype

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-flowtype

Flowtype linting rules for ESLint.

8.0.3
latest
Source
npm
Version published
Weekly downloads
3.3M
-27.73%
Maintainers
1
Weekly downloads
 
Created

What is eslint-plugin-flowtype?

eslint-plugin-flowtype is an ESLint plugin that provides linting rules for Flow type annotations. It helps ensure that your Flow type annotations are correct and consistent, improving the reliability and maintainability of your code.

What are eslint-plugin-flowtype's main functionalities?

Type Annotations

This rule ensures that every file has a valid Flow file annotation. The code sample demonstrates a simple function with Flow type annotations for the parameters and return type.

/* eslint flowtype/require-valid-file-annotation: [2, "always"] */
// @flow
function add(a: number, b: number): number {
  return a + b;
}

Type Definitions

This rule ensures that all Flow type definitions are defined correctly. The code sample shows a type definition for a User object and an instance of that type.

/* eslint flowtype/define-flow-type: 2 */
// @flow
type User = {
  name: string,
  age: number
};
const user: User = { name: 'John', age: 30 };

Type Casting

This rule enforces a naming convention for type identifiers. The code sample demonstrates a type definition that follows the specified naming convention.

/* eslint flowtype/type-id-match: [2, "^([A-Z][a-z0-9]+)+Type$"] */
// @flow
type UserType = {
  name: string,
  age: number
};
const user: UserType = { name: 'John', age: 30 };

Other packages similar to eslint-plugin-flowtype

Keywords

eslint

FAQs

Package last updated on 29 Oct 2021

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