我的.eslintrc文件包含:
"import/no-extraneous-dependencies": ["error", {
"devDependencies": ["**/*.stories.js", "**/*.spec.js"],
"optionalDependencies": ["**/*.stories.js", "**/*.spec.js"],
"peerDependencies": ["**/*.stories.js", "**/*.spec.js"]
}],
但是,运行我的短毛绒会引发很多这样的错误:
/Users/alan/src/myproject/packages/Textarea/tests/Textarea.spec.js
2:1 error 'react-testing-library' should be listed in the project's dependencies. Run 'npm i -S react-testing-library' to add it import/no-extraneous-dependencies
您可以清楚地看到它在* .spec.js文件上失败。
我已经尝试了一些这种变化(*.stories.js
,!packages/**/
),但是它一直向我显示规格文件。
我想念什么?