<a name="eslint-plugin-flowtype"></a>
# eslint-plugin-flowtype
[![NPM version](http://img.shields.io/npm/v/eslint-plugin-flowtype.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-flowtype)
[![Travis build status](http://img.shields.io/travis/gajus/eslint-plugin-flowtype/master.svg?style=flat-square)](https://travis-ci.org/gajus/eslint-plugin-flowtype)
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
[Flow type](http://flowtype.org/) linting rules for ESLint.
* [eslint-plugin-flowtype](#eslint-plugin-flowtype)
* [Installation](#eslint-plugin-flowtype-installation)
* [Configuration](#eslint-plugin-flowtype-configuration)
* [Shareable configurations](#eslint-plugin-flowtype-configuration-shareable-configurations)
* [Community maintained configurations](#eslint-plugin-flowtype-configuration-community-maintained-configurations)
* [Settings](#eslint-plugin-flowtype-settings)
* [`onlyFilesWithFlowAnnotation`](#eslint-plugin-flowtype-settings-onlyfileswithflowannotation)
* [Rules](#eslint-plugin-flowtype-rules)
* [`array-style-complex-type`](#eslint-plugin-flowtype-rules-array-style-complex-type)
* [`array-style-simple-type`](#eslint-plugin-flowtype-rules-array-style-simple-type)
* [`boolean-style`](#eslint-plugin-flowtype-rules-boolean-style)
* [`define-flow-type`](#eslint-plugin-flowtype-rules-define-flow-type)
* [`delimiter-dangle`](#eslint-plugin-flowtype-rules-delimiter-dangle)
* [`generic-spacing`](#eslint-plugin-flowtype-rules-generic-spacing)
* [`newline-after-flow-annotation`](#eslint-plugin-flowtype-rules-newline-after-flow-annotation)
* [`no-dupe-keys`](#eslint-plugin-flowtype-rules-no-dupe-keys)
* [`no-existential-type`](#eslint-plugin-flowtype-rules-no-existential-type)
* [`no-flow-fix-me-comments`](#eslint-plugin-flowtype-rules-no-flow-fix-me-comments)
* [`no-mutable-array`](#eslint-plugin-flowtype-rules-no-mutable-array)
* [`no-primitive-constructor-types`](#eslint-plugin-flowtype-rules-no-primitive-constructor-types)
* [`no-types-missing-file-annotation`](#eslint-plugin-flowtype-rules-no-types-missing-file-annotation)
* [`no-unused-expressions`](#eslint-plugin-flowtype-rules-no-unused-expressions)
* [`no-weak-types`](#eslint-plugin-flowtype-rules-no-weak-types)
* [`object-type-delimiter`](#eslint-plugin-flowtype-rules-object-type-delimiter)
* [`require-exact-type`](#eslint-plugin-flowtype-rules-require-exact-type)
* [`require-parameter-type`](#eslint-plugin-flowtype-rules-require-parameter-type)
* [`require-return-type`](#eslint-plugin-flowtype-rules-require-return-type)
* [`require-types-at-top`](#eslint-plugin-flowtype-rules-require-types-at-top)
* [`require-valid-file-annotation`](#eslint-plugin-flowtype-rules-require-valid-file-annotation)
* [`require-variable-type`](#eslint-plugin-flowtype-rules-require-variable-type)
* [`semi`](#eslint-plugin-flowtype-rules-semi)
* [`sort-keys`](#eslint-plugin-flowtype-rules-sort-keys)
* [`space-after-type-colon`](#eslint-plugin-flowtype-rules-space-after-type-colon)
* [`space-before-generic-bracket`](#eslint-plugin-flowtype-rules-space-before-generic-bracket)
* [`space-before-type-colon`](#eslint-plugin-flowtype-rules-space-before-type-colon)
* [`type-id-match`](#eslint-plugin-flowtype-rules-type-id-match)
* [`type-import-style`](#eslint-plugin-flowtype-rules-type-import-style)
* [`union-intersection-spacing`](#eslint-plugin-flowtype-rules-union-intersection-spacing)
* [`use-flow-type`](#eslint-plugin-flowtype-rules-use-flow-type)
* [`valid-syntax`](#eslint-plugin-flowtype-rules-valid-syntax)
<a name="eslint-plugin-flowtype-installation"></a>
## Installation
1. Install [ESLint](https://www.github.com/eslint/eslint).
1. Install [`babel-eslint`](https://github.com/babel/babel-eslint) parser (ESLint parser [does not support type annotations](https://github.com/eslint/eslint/issues/2157)).
1. Install [`eslint-plugin-flowtype`](https://github.com/gajus/eslint-plugin-flowtype) plugin.
<!-- -->
```sh
npm install eslint --save-dev
npm install babel-eslint --save-dev
npm install eslint-plugin-flowtype --save-dev
```
<a name="eslint-plugin-flowtype-configuration"></a>
## Configuration
1. Set `parser` property to `babel-eslint`.
1. Add `plugins` section and specify `eslint-plugin-flowtype` as a plugin.
1. Enable rules.
<!-- -->
```json
{
"parser": "babel-eslint",
"plugins": [
"flowtype"
],
"rules": {
"flowtype/boolean-style": [
2,
"boolean"
],
"flowtype/define-flow-type": 1,
"flowtype/delimiter-dangle": [
2,
"never"
],
"flowtype/generic-spacing": [
2,
"never"
],
"flowtype/no-primitive-constructor-types": 2,
"flowtype/no-types-missing-file-annotation": 2,
"flowtype/no-weak-types": 2,
"flowtype/object-type-delimiter": [
2,
"comma"
],
"flowtype/require-parameter-type": 2,
"flowtype/require-return-type": [
2,
"always",
{
"annotateUndefined": "never"
}
],
"flowtype/require-valid-file-annotation": 2,
"flowtype/semi": [
2,
"always"
],
"flowtype/space-after-type-colon": [
2,
"always"
],
"flowtype/space-before-generic-bracket": [
2,
"never"
],
"flowtype/space-before-type-colon": [
2,
"never"
],
"flowtype/type-id-match": [
2,
"^([A-Z][a-z0-9]+)+Type$"
],
"flowtype/union-intersection-spacing": [
2,
"always"
],
"flowtype/use-flow-type": 1,
"flowtype/valid-syntax": 1
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": false
}
}
}
```
<a name="eslint-plugin-flowtype-configuration-shareable-configurations"></a>
### Shareable configurations
<a name="eslint-plugin-flowtype-configuration-shareable-configurations-recommended"></a>
#### Recommended
This plugin exports a [recommended configuration](./src/configs/recommended.json) that enforces Flow type good practices.
To enable this configuration use the extends property in your `.eslintrc` config file:
```json
{
"extends": [
"plugin:flowtype/recommended"
],
"plugins": [
"flowtype"
]
}
```
See [ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information about extending configuration files.
<a name="eslint-plugin-flowtype-configuration-community-maintained-configurations"></a>
### Community maintained configurations
The following are third-party submitted/ maintained configurations of `eslint-plugin-flowtype`:
* https://github.com/wemake-services/eslint-config-flowtype-essential
<a name="eslint-plugin-flowtype-settings"></a>
## Settings
<a name="eslint-plugin-flowtype-settings-onlyfileswithflowannotation"></a>
### <code>onlyFilesWithFlowAnnotation</code>
When `true`, only checks files with a [`@flow` annotation](http://flowtype.org/docs/about-flow.html#gradual) in the first comment.
```js
{
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
}
}
```
<a name="eslint-plugin-flowtype-rules"></a>
## Rules
<!-- Rules are sorted alphabetically. -->
<a name="eslint-plugin-flowtype-rules-array-style-complex-type"></a>
### <code>array-style-complex-type</code>
_The `--fix` option on the command line automatically fixes problems reported by this rule._
Enforces a particular annotation style of complex types.
Type is considered complex in these cases:
* [Maybe type](https://flow.org/en/docs/types/maybe/)
* [Function type](https://flow.org/en/docs/types/functions/)
* [Object type](https://flow.org/en/docs/types/objects/)
* [Tuple type](https://flow.or
没有合适的资源?快使用搜索试试~ 我知道了~
点击缩略图,放大图片,大图以轮播的形式展现
共50253个文件
js:28115个
json:5446个
ts:5301个
需积分: 50 21 下载量 112 浏览量
2019-01-16
11:01:42
上传
评论
收藏 101.19MB ZIP 举报
温馨提示
点击缩略图,放大图片,大图以轮播的形式展现,轮播图中默认展现当前点击的图片
资源推荐
资源详情
资源评论
收起资源包目录
点击缩略图,放大图片,大图以轮播的形式展现 (50253个子文件)
sshpk-conv.1 4KB
he.1 3KB
jsesc.1 3KB
jsesc.1 3KB
jsesc.1 3KB
jsesc.1 3KB
sshpk-sign.1 2KB
sshpk-verify.1 2KB
cssesc.1 2KB
cssesc.1 2KB
123 0B
1777cc471a4344702741ab1c8a588998b1311a 3KB
package-lock.json.1909017369 0B
1f3ad7c9582f1723c33e0f9198ddfdfb25ecb7 218B
261ca47e6b4fd1be15ee98d59d9ff2c6779f1e 326B
29575de80483b005c29bfcac5061cd2f45313e 204B
2f141fafdeb1d31d85b008ec5132840c5e6362 208B
3182f3920a4d02bf8d1a4212056571bd604487 820B
39a02b1b6c8e92d9e466b9ea436d90d4c42f04 125B
54b201bf9c6caf5271293588189fb4210f99d1 179B
5e75da1cd0651f3c34f0d51aaa6abac634f4f2 280B
5f38439e59063915f3f2d17870fea8663a4a0c 236B
60c1042f58d9fabb75485aa3624dddcf633b5c 1KB
79a738f6d7690591fc512613cdd96b770d5f41 249B
83ff9ced126ba2ba3cadde952135b3728880f8 2KB
93aed8dc6a9860b41643125be487180062e919 154KB
9614c4fd32e65dcbefff34b758d7824b397181 1KB
a 0B
acorn 62B
acorn 59B
acorn 59B
acorn 59B
acorn 18B
acorn 18B
acorn 18B
acorn 18B
address 692B
license.after 4B
ansi-html 2KB
ansi-html 26B
LICENSE.APACHE2 586B
LICENSE.APACHE2 586B
openChrome.applescript 2KB
.arcconfig 462B
.arclint 748B
atob 19B
AUTHORS 1KB
AUTHORS 1KB
AUTHORS 1KB
AUTHORS 329B
AUTHORS 217B
AUTHORS 203B
AUTHORS 169B
AUTHORS 152B
AUTHORS 152B
AUTHORS 139B
AUTHORS 106B
autoprefixer 540B
autoprefixer 32B
.babelrc 374B
.babelrc 279B
.babelrc 225B
.babelrc 220B
.babelrc 195B
.babelrc 164B
.babelrc 145B
.babelrc 145B
.babelrc 145B
.babelrc 145B
.babelrc 145B
.babelrc 119B
.babelrc 118B
.babelrc 109B
.babelrc 74B
.babelrc 42B
.babelrc 30B
.babelrc 29B
.babelrc 28B
.babelrc 25B
babylon 25B
README.md.bak 7KB
foo.bar 0B
BUILD.bazel 1KB
BUILD.bazel 392B
BUILD.bazel 392B
BUILD.bazel 388B
BUILD.bazel 382B
beans 0B
license.before 4B
benchmark 692B
range.bnf 619B
range.bnf 619B
.bowerrc 26B
.branch 7B
browserslist 22B
browserslist 22B
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
LICENSE.BSD 1KB
共 50253 条
- 1
- 2
- 3
- 4
- 5
- 6
- 503
资源评论
热爱前端的小君同学
- 粉丝: 184
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功