标准的Flowtype无法加载插件流类型 - 解析器

时间:2017-09-21 13:39:33

标签: javascript babeljs eslint flowtype

enter image description here

安装在package.json

"babel-preset-flow": "^6.23.0",
"eslint-plugin-flowtype": "2.35.1",
"flow-bin": "^0.55.0",
"flow-typed": "2.1.5",
"standard-flow": "^1.0.0",
"babel-eslint": "8.0.0",
"eslint": "^4.7.1",
"eslint-plugin-flowtype": "2.35.1",
  

错误:无法加载插件flowtype - 解析器:找不到模块   'eslint-插件-流动型 - 解析器'

     

错误:无法加载插件flowtype - 解析器:找不到模块   'eslint-插件,流动型 - 解析器'       在Function.Module._resolveFilename(module.js:489:15)       在Function.resolve(internal / module.js:18:19)

我的标准配置..

 "standard": {
    "ignore": [
      "/flow-type/**/*"
    ],
    "env": [
      "mocha"
    ],
    "globals": [
      "fetch"
    ],
    "parser": "babel-eslint",
    "extends": [
      "plugin:flowtype/recommended"
    ],
    "plugins": [
      "flowtype"
    ]
  },

即使我在控制台中运行......

npx standard --fix | snazzy && npx flow
....
.../flow-typed/npm/sinon_vx.x.x.js
  203:27  error  '$Exports' is not defined
  206:27  error  '$Exports' is not defined
  209:27  error  '$Exports' is not defined
  ... // MORE ..

1 个答案:

答案 0 :(得分:0)

  

无法找到模块'eslint-plugin-flowtype - parser'

两个破折号必须是拼写错误。无论如何,应该使用babel-eslint作为解析器,使用eslint-plugin-flowtype作为插件之一。

是的,所有这些eslint / babel / flowtype插件和配置可能会令人困惑。你可以阅读他们所有的自述文件......

或者您可以查看最终配置here,例如。