[英]Expected a string, got object gatsby-plugin-prettier-eslint Gatsby
Have you tried using the following?您是否尝试过使用以下方法?
eslint: {
patterns: "**/*.{js,jsx,ts,tsx}",
customOptions: {
fix: true,
cache: true,
},
},
The eslint
pattern seems to be a string, not an array according to the plugin's example .根据 插件的示例, eslint
模式似乎是一个字符串,而不是一个数组。
This seems to be an unresolved issue of the plugin, according to this opened issue (from a week ago), so keep an eye on that stack trace to see how it evolves.根据这个打开的问题(一周前),这似乎是插件的一个未解决的问题,所以请密切关注该堆栈跟踪以了解它是如何演变的。 If the dependency has a bug when using the defaults (and suggested) configuration, there's nothing you can do except making a PR if you are able to spot the bug in the source code or wait for the resolution.如果在使用默认(和建议的)配置时依赖项有错误,如果您能够在源代码中发现错误或等待解决方案,那么除了制作 PR 之外,您无能为力。
I had the same issue.我遇到过同样的问题。 Turns out you must have a prettier config (.prettierrc or similar) set up.原来你必须有一个更漂亮的配置(.prettierrc 或类似的)设置。 Check to make sure you have a config as mentioned in the Prettier docs .检查以确保您拥有Prettier 文档中提到的配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.