【问题标题】:Flowtype with standard Failed to load plugin flowtype--parser带有标准的流类型无法加载插件流类型--解析器
【发布时间】:2018-06-10 18:38:49
【问题描述】:

安装在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",

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

错误:无法加载插件流类型--解析器:找不到模块 'eslint-plugin-flowtype--解析器' 在 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 ..

【问题讨论】:

  • 我不知道这是否与您的错误有关,但您在 package.json 中列出了两次 "eslint-plugin-flowtype"

标签: javascript babeljs eslint flowtype


【解决方案1】:

找不到模块“eslint-plugin-flowtype--parser”

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

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

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

【讨论】:

    猜你喜欢
    • 2020-05-23
    • 2018-01-18
    • 2017-11-13
    • 2013-11-04
    • 1970-01-01
    • 1970-01-01
    • 2022-06-10
    • 2014-05-09
    • 1970-01-01
    相关资源
    最近更新 更多