依赖范围内的卷装与纱线

时间:2018-07-22 15:46:44

标签: npm yarnpkg npmjs

我已经创建了包含内容的作用域软件包@scope/eslint-config

{
  "name": "@scope/eslint-config",
  "version": "1.0.3",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "babel-eslint": "8.2.5",
    "eslint": "5.1.0",
    "eslint-config-airbnb": "17.0.0",
    "eslint-config-prettier": "2.9.0",
    "eslint-plugin-css-modules": "2.7.5",
    "eslint-plugin-flowtype": "2.50.0",
    "eslint-plugin-import": "2.13.0",
    "eslint-plugin-jsx-a11y": "6.1.0",
    "eslint-plugin-prettier": "2.6.2",
    "eslint-plugin-react": "7.10.0",
    "eslint-plugin-require-jsdoc-except": "1.1.0"
  }
}

,并在我的项目中将其添加为"@scoped/eslint-config": "1.0.2",

但是,在运行yarn install之后,我仅看到该程序包,而没有任何依赖性。但是它可以与npm一起使用

我已经尝试过yarn v1.8.0v1.7.0v1.6.0

您遇到了麻烦吗?有解决办法吗?

1 个答案:

答案 0 :(得分:0)

在npm中,由于使用flattern结构,因此可以工作。

对于纱线,您需要说--flat,但这会引起其他麻烦

https://github.com/eslint/eslint/issues/5501

https://github.com/eslint/eslint/issues/3458