首页 > 解决方案 > 如何从 eslint react/no-unescaped-entities eslintrc 文件中排除某些字符?

问题描述

我正在尝试更新我的 eslintrc 文件以允许撇号而不需要使用'.

我查看了 repo 中的文档,但那里列出的内容似乎没有解释如何允许一个角色?它仅说明如何将更多字符添加到禁止列表中。

谁能告诉我我哪里出错了?

"react/no-unescaped-entities": ["error", {"forbid" <I would presume there is an 'allow' option here instead of 'forbid?': ["'"]}],

提前致谢

标签: eslinteslintrc

解决方案


到目前为止还没有“允许”,所以你应该做的是禁止除撇号之外的所有转义: "react/no-unescaped-entities": ["error", {"forbid": ['>', '"', '}']}]

希望能帮助到你。


推荐阅读