From 654c1548260b3a7e03b5824d57ba7c610166ca9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabr=C3=ADcio=20Matt=C3=A9?= Date: Sun, 11 Feb 2018 21:02:07 -0200 Subject: [PATCH 1/2] Automatically include plugin when extending preset, fixes #313 --- src/configs/recommended.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/configs/recommended.json b/src/configs/recommended.json index a34caba0..3f226439 100644 --- a/src/configs/recommended.json +++ b/src/configs/recommended.json @@ -1,5 +1,8 @@ { "parser": "babel-eslint", + "plugins": [ + "flowtype" + ], "rules": { "flowtype/boolean-style": [ 2, From 3b49a324504e1af129630bd8ca33558b2dc842fa Mon Sep 17 00:00:00 2001 From: UltCombo Date: Sun, 11 Feb 2018 21:10:39 -0200 Subject: [PATCH 2/2] README: update recommended preset documentation --- .README/README.md | 3 --- README.md | 23 +++++++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.README/README.md b/.README/README.md index ab7558b2..d02b59e5 100644 --- a/.README/README.md +++ b/.README/README.md @@ -113,9 +113,6 @@ To enable this configuration use the extends property in your `.eslintrc` config { "extends": [ "plugin:flowtype/recommended" - ], - "plugins": [ - "flowtype" ] } ``` diff --git a/README.md b/README.md index d194ff1d..d0778da0 100644 --- a/README.md +++ b/README.md @@ -2436,7 +2436,7 @@ type FooType = { a: number, c: number, b: string } c: number, b: string, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2445,7 +2445,7 @@ type FooType = { a: number, c: number, b: string } c: number, b: string, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2454,7 +2454,7 @@ type FooType = { a: number, c: number, b: string } c: number, b: string, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2463,7 +2463,7 @@ type FooType = { a: number, c: number, b: string } c: ?number, b: string, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2472,7 +2472,7 @@ type FooType = { a: number, c: number, b: string } c: number, b: (param: string) => number, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2481,7 +2481,7 @@ type FooType = { a: number, c: number, b: string } c: number, b: (param: string) => number, } - + // Message: Expected type annotations to be in ascending order. "b" should be before "c". @@ -2490,7 +2490,7 @@ type FooType = { a: number, c: number, b: string } a: number | string | boolean, b: (param: string) => number, } - + // Message: Expected type annotations to be in ascending order. "a" should be before "c". @@ -2503,7 +2503,7 @@ type FooType = { a: number, c: number, b: string } a: number | string | boolean, b: (param: string) => number, } - + // Message: Expected type annotations to be in ascending order. "x" should be before "z". // Message: Expected type annotations to be in ascending order. "a" should be before "c". @@ -2521,7 +2521,7 @@ type FooType = { a: number, c: number, b: string } a: number | string | boolean, b: (param: string) => number, } - + // Message: Expected type annotations to be in ascending order. "k" should be before "l". // Message: Expected type annotations to be in ascending order. "x" should be before "z". // Message: Expected type annotations to be in ascending order. "a" should be before "c". @@ -2647,7 +2647,7 @@ The following patterns are considered problems: { a: string, b: number }) => {} // Message: There must not be a line break after "foo" parameter type annotation colon. -(foo: +(foo: { a: string, b: number }) => {} // Message: There must not be a line break after "foo" parameter type annotation colon. @@ -3023,7 +3023,7 @@ The following patterns are not considered problems: { a: string, b: number }) => {} // Options: ["always",{"allowLineBreak":true}] -(foo: +(foo: { a: string, b: number }) => {} // Options: ["never"] @@ -4128,4 +4128,3 @@ function x(i: Y) { i }; type A = {}; x() **Deprecated** Babylon (the Babel parser) v6.10.0 fixes parsing of the invalid syntax this plugin warned against. Checks for simple Flow syntax errors. -