Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
4.4M
increased by0.34%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc