Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-flowtype-errors

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-flowtype-errors - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0-0

dist/config/recommended.js

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## v4.1.0
### Added
- Recommended config 🎉
## v4.0.0

@@ -2,0 +6,0 @@ ### Fixed

@@ -14,2 +14,4 @@ "use strict";

var _recommended = _interopRequireDefault(require("./config/recommended"));
var _collect = require("./collect");

@@ -126,2 +128,5 @@

var _default = {
configs: {
recommended: _recommended.default
},
rules: {

@@ -128,0 +133,0 @@ 'enforce-min-coverage': function enforceMinCoverage(context) {

26

package.json
{
"name": "eslint-plugin-flowtype-errors",
"version": "4.0.0",
"version": "4.1.0-0",
"description": "Retrieve Flow errors as ESLint errors.",

@@ -33,3 +33,3 @@ "author": "Amila Welihinda",

"dependencies": {
"@babel/runtime": "^7.0.0",
"@babel/runtime": "^7.4.2",
"find-up": "^3.0.0",

@@ -39,17 +39,17 @@ "slash": "^2.0.0"

"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/cli": "^7.2.3",
"@babel/core": "^7.4.0",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/register": "^7.4.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.1.0",
"babel-jest": "^24.5.0",
"chai": "^4.2.0",
"cross-env": "^5.2.0",
"cross-spawn": "^6.0.5",
"eslint": "5.14.1",
"eslint": "5.15.3",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.0.0",
"eslint-config-prettier": "^4.1.0",
"eslint-formatter-pretty": "^2.1.1",

@@ -62,7 +62,7 @@ "eslint-plugin-flowtype": "^3.4.2",

"execa": "^1.0.0",
"flow-bin": "0.93.0",
"flow-bin": "0.95.1",
"husky": "^1.3.1",
"jest-cli": "^24.1.0",
"jest-cli": "^24.5.0",
"prettier": "^1.16.4",
"regenerator-runtime": "^0.13.1"
"regenerator-runtime": "^0.13.2"
},

@@ -69,0 +69,0 @@ "peerDependencies": {

@@ -10,7 +10,7 @@ eslint-plugin-flowtype-errors

## Demo
![ESLint Flow Demo](https://github.com/amilajack/eslint-plugin-flowtype-errors/blob/master/flow-demo.gif?raw=true)
*NOTE:* This demo is using Atom and the packages `linter`, `linter-eslint`, `language-babel`
## Why?
## Why?
* **Lower barrier:** Any editor that has ESLint support now supports Flow 🎉

@@ -21,7 +21,8 @@ * **Less editor configuration:** No need to change your entire workflow to incorporate flow. No multiple-linters-per-file nonsense.

## Getting Started
This guide assumes that you have installed eslint, babel, babel-plugin-transform-flow-strip-types and configured flow. Check out the [from-scratch guide](https://github.com/amilajack/eslint-plugin-flowtype-errors/wiki/Getting-Started) for the full guide on getting started.
⚠️ Make sure the 64-bit version of your texteditor/IDE. For atom, [see this comment](https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/40#issuecomment-275983387)
⚠️ Make sure the 64-bit version of your text editor or IDE. For atom, [see this comment](https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/40#issuecomment-275983387)
**Step 1. Install**
### **1. Install**

@@ -32,53 +33,11 @@ ```bash

**Step 2. Configure**
### **2. Configure**
Add this line to the 'rules' section of your `.eslintrc` to report flow errors.
```js
"flowtype-errors/show-errors": "error"
Extend the recommended config:
```jsonc
{
"extends": ["plugin:flowtype-errors/recommended"]
}
```
Add this line to the 'rules' section of your `.eslintrc` to report flow warnings.
```js
"flowtype-errors/show-warnings": "warn"
```
Note that flow won't report warnings unless you add this setting to your `.flowconfig`:
```toml
[options]
include_warnings=true
```
Add this line to the 'rules' section of your `.eslintrc` to enforce a minimum percentage of flow coverage per file (optional). Here's an example of enforcing a converage of at least 50%:
```js
"flowtype-errors/enforce-min-coverage": ["error", 50]
```
Add this line to the 'plugins' section of your `.eslintrc`
```js
"flowtype-errors"
```
Add the `@flow` pragma to files that you want to lint
Also make sure that your `.flowconfig` is in the root of your project directory
```js
/**
* @flow
*/
```
**Step 3. Settings (optional)**
Add this line to the 'settings' section of your `.eslintrc` to force the Flow server to stop after it finishes checking types.
```js
"settings": {
"flowtype-errors": {
"stopOnExit": true
}
},
```
**Step 4. Lint**
Run `eslint` and you're all set!
## Support

@@ -95,27 +54,9 @@

## CI Configuration
**Flow is supported on all OS's except Windows 32bit. Add [this line](https://github.com/amilajack/eslint-plugin-flowtype-errors/blob/master/appveyor.yml#L12) to appveyor to make tests run properly.**
## Editor Configuration
### Atom
```bash
apm install linter linter-eslint language-babel
```
Flow is supported on all OS's except Windows 32bit. Add [this line](https://github.com/amilajack/eslint-plugin-flowtype-errors/blob/master/appveyor.yml#L12) to appveyor to make tests run properly.
### Sublime
* https://github.com/SublimeLinter/SublimeLinter3
* https://github.com/roadhump/SublimeLinter-eslint
* https://github.com/babel/babel-sublime
## Related:
### Others
http://eslint.org/docs/user-guide/integrations#editors
## Planned Implementations
* Add more extensive tests
* Allow passing arguments to flow binary
* Run flow minimal amount of times for faster linting
* Custom formatting of flow error messages
* Enable rules to allow and disallow specific flow errors
## Related flow tools:
* [flow-runtime](https://github.com/codemix/flow-runtime)
* [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype)
* [eslint-plugin-flowtype-errors-demo](https://github.com/amilajack/eslint-plugin-flowtype-errors-demo)
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