-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
extends: [ | ||
'plugin:flowtype/recommended', | ||
'wyze/rules/flow', | ||
], | ||
parser: 'babel-eslint', | ||
plugins: [ | ||
'flowtype', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
rules: { | ||
// same as comma-dangle from ESLint | ||
// https://github.com/gajus/eslint-plugin-flowtype#delimiter-dangle | ||
'flowtype/delimiter-dangle': [ 2, 'always-multiline' ], | ||
// disallow duplicate keys in types | ||
// https://github.com/gajus/eslint-plugin-flowtype#no-dupe-keys | ||
'flowtype/no-dupe-keys': 2, | ||
// better to be specific, but only warn | ||
// https://github.com/gajus/eslint-plugin-flowtype#no-weak-types | ||
'flowtype/no-weak-types': 1, | ||
// only use commas in object types | ||
// https://github.com/gajus/eslint-plugin-flowtype#object-type-delimiter | ||
'flowtype/object-type-delimiter': [ 2, 'comma' ], | ||
// type all the functions! | ||
// https://github.com/gajus/eslint-plugin-flowtype#require-parameter-type | ||
'flowtype/require-parameter-type': 2, | ||
// just warn about missing return types | ||
// https://github.com/gajus/eslint-plugin-flowtype#require-return-type | ||
'flowtype/require-return-type': 1, | ||
// warn when a file isn't typed | ||
// https://github.com/gajus/eslint-plugin-flowtype#require-valid-file-annotation | ||
'flowtype/require-valid-file-annotation': 1, | ||
// ew, semicolons | ||
// https://github.com/gajus/eslint-plugin-flowtype#semi | ||
'flowtype/semi': [ 2, 'never' ], | ||
// enforce type names to begin with uppercase letter | ||
// https://github.com/gajus/eslint-plugin-flowtype#type-id-match | ||
'flowtype/type-id-match': [ 2, '^[A-Z].*$' ], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import flow from '../flow' | ||
import test from 'ava' | ||
|
||
test('extends files', t => { | ||
const expected = [ | ||
'plugin:flowtype/recommended', | ||
'wyze/rules/flow', | ||
] | ||
|
||
t.deepEqual(flow.extends, expected, 'extending incorrect rules') | ||
}) | ||
|
||
test('parser is set correctly', t => { | ||
const expected = 'babel-eslint' | ||
|
||
t.is(flow.parser, expected) | ||
}) | ||
|
||
test('plugins are set correctly', t => { | ||
const expected = [ | ||
'flowtype', | ||
] | ||
|
||
t.deepEqual(flow.plugins, expected) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { rules } from '../../rules/flow' | ||
import test from 'ava' | ||
|
||
test('only flowtype rules', t => { | ||
Object.keys(rules).forEach(rule => { | ||
t.truthy(~rule.indexOf('flowtype/')) | ||
}) | ||
}) |