<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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
java毕业设计,包含完整前后端源码带数据库,项目可正常运行。 环境说明: 开发语言:Java 前端框架:小程序 JDK版本:JDK1.8 数据库:mysql 5.7+ 部署容器:tomcat7+ 数据库工具:Navicat11+ 开发软件:eclipse/myeclipse/idea(推荐idea) Maven包:Maven3.3.9 环境说明: 开发语言:Java 前端框架:小程序 JDK版本:JDK1.8 数据库:mysql 5.7+ 部署容器:tomcat7+ 数据库工具:Navicat11+ 开发软件:eclipse/myeclipse/idea(推荐idea) Maven包:Maven3.3.9
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计之留学生React Native计算器作业源码.zip (2007个子文件)
base.css 5KB
prettify.css 676B
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
readable_streambuffer.js.html 12KB
writable_streambuffer.js.html 9KB
index.html 5KB
index.html 3KB
constants.js.html 2KB
streambuffer.js.html 2KB
xregexp-all.js 370KB
source-map.debug.js 266KB
source-map.debug.js 254KB
source-map.debug.js 254KB
source-map.debug.js 254KB
js-yaml.js 108KB
source-map.js 104KB
source-map.js 100KB
source-map.js 100KB
source-map.js 100KB
xregexp.js 72KB
index.js 71KB
xregexp.js 70KB
categories.js 66KB
loader.js 43KB
js-yaml.min.js 42KB
index.js 41KB
index.es.js 40KB
sbcs.js 40KB
source-map-consumer.js 40KB
yargs.js 38KB
semver.js 38KB
index.js 38KB
typed.js 38KB
source-map-consumer.js 37KB
source-map-consumer.js 37KB
source-map-consumer.js 37KB
Server.js 35KB
regenerate.js 34KB
index.js 33KB
doctrine.js 32KB
index.js 32KB
getPropValue-babelparser-test.js 30KB
index.js 29KB
Components.js 27KB
dumper.js 27KB
getPropValue-flowparser-test.js 27KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
source-map.min.js 26KB
blocks.js 25KB
require.js 25KB
propTypes.js 25KB
index.js 25KB
react-refresh-babel.development.js 24KB
validateConfig.js 24KB
index.js 23KB
validateStreamConfig.js 23KB
index.js 23KB
Symbolication.js 21KB
scripts.js 21KB
Symbolication.js 20KB
x509.js 19KB
watchman.js 19KB
properties.js 19KB
traverseDependencies.js 17KB
react-refresh-runtime.development.js 17KB
prettify.js 17KB
usedPropTypes.js 17KB
mbcs.js 17KB
conversions.js 16KB
TerminalReporter.js 16KB
usage.js 16KB
command.js 15KB
jestFakeTimers.js 15KB
pkcs8.js 14KB
getPropLiteralValue-flowparser-test.js 14KB
getPropLiteralValue-babelparser-test.js 14KB
source-map-generator.js 14KB
source-map-generator.js 14KB
source-map-generator.js 14KB
source-map-generator.js 14KB
worker.js 14KB
jsx-curly-spacing.js 14KB
source-node.js 13KB
source-node.js 13KB
source-node.js 13KB
source-node.js 13KB
no-unused-state.js 13KB
jsx-indent.js 13KB
sort-comp.js 13KB
util.js 13KB
import-export-plugin.js 12KB
jsx-curly-brace-presence.js 12KB
共 2007 条
- 1
- 2
- 3
- 4
- 5
- 6
- 21
资源评论
大学生资源网
- 粉丝: 138
- 资源: 1334
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于SpringBoot+Vue的在线课程管理系统(后端代码)
- MindInsight为MindSpore提供了简单易用的调优调试能力 用于模型优化的可视化仪表板
- 野火霸道开发板485原工程
- 国产化自主可控的人工智能开源平台 平台面向人工智能研究中的数据处理、算法开发、模型训练、算力管理和推理应用等各个流程的技术难点
- 基于Springboot+Vue的江西红色旅游景点宣传网站(后端代码)
- 基于Springboot+Vue的江西红色旅游景点宣传网站(管理端代码)
- Screenshot_20241116_111214.jpg
- 普通话考试操作教程完整版
- 基于Springboot+Vue的江西红色旅游景点宣传网站(网页端代码)
- C语言基本语法入门练习题.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功