GithubHelp home page GithubHelp logo

isabella232 / danger-plugin-flow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from withspectrum/danger-plugin-flow

0.0 0.0 0.0 417 KB

Ensure all JS files that get touched in a PR are flow typed

License: MIT License

TypeScript 74.03% JavaScript 25.97%

danger-plugin-flow's Introduction

danger-plugin-flow

Build Status npm version

Ensure all new .js files in a project are flow typed

Usage

Install:

yarn add danger-plugin-flow --dev

At a glance:

// dangerfile.js
import { schedule } from 'danger'
import flow from 'danger-plugin-flow'

schedule(flow());

Options

Recommended setup:

schedule(flow({
  modified: "warn",
  created: "fail"
}))

This will fail the build for any newly introduced file that isn't flow typed, but will only warn the developer if they touch a file that's not flow typed. This is what we use because it can be hard to type legacy code, but we want to ensure every newly incoming code is properly typed.

blacklist

Blacklist certain globs from being checked:

schedule(flow({
  blacklist: ['dist/**/*.js']
}))

created

Decide whether you want to warn, fail or ignore newly created files that are untyped:

schedule(flow({
  created: "warn"
}))

schedule(flow({
  created: "fail"
}))

schedule(flow({
  created: false
}))

modified

Decide whether you want to warn, fail or ignore modified files that are untyped:

schedule(flow({
  modified: "warn"
}))

schedule(flow({
  modified: "fail"
}))

schedule(flow({
  modified: false
}))

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

danger-plugin-flow's People

Contributors

brianlovin avatar depfu[bot] avatar jakubzitny avatar kevinsuttle avatar mxstbr avatar ryota-murakami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.