wemake-services / eslint-config-flowtype-essential

Deprecated, use wemake-frontend-styleguide instead

Home Page:https://github.com/wemake-services/wemake-frontend-styleguide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eslint-config-flowtype-essential

wemake.services Build Status

Shareable configuration for eslint-plugin-flowtype.

The main idea of this configuration is to be:

  1. Strict about syntax
  2. Permissive about types
  3. Opened for further extensions

Installation

npm install --save-dev eslint-config-flowtype-essential

Then, modify your eslint configuration:

{
  "extends": [
    "flowtype-essential"
  ]
}

Done! Later you can modify your configuration to include any extra rules you need.

Code example

This code is considered valid (and beautiful):

type Client<T> = {
  name: string,
  surname: string,
  age: number | string,
  isRegular: boolean,
  reference: T,
  related: Array<T>,
  preferences: Array<string | Promise<string>>
}

function greetClient (client: Client<string>): string {
  return `Hi, ${client.name}-{$client.reference}`
}

License

MIT.

About

Deprecated, use wemake-frontend-styleguide instead

https://github.com/wemake-services/wemake-frontend-styleguide

License:MIT License


Languages

Language:JavaScript 100.0%