简体   繁体   English

如何禁用注入分隔符的eslint解析错误?

[英]How to disable eslint parsing error for injected delimiter?

I've been using haml for a decade. 我已经使用haml十年了。 Now that I'm writing React, I'm getting an eslint parsing error for the haml delimiter. 现在我正在编写React,我得到了针对haml分隔符的eslint解析错误。 I may get additional errors on this in the future, but for now I've only seen the following. 将来,我可能会在此上收到其他错误,但到目前为止,我仅看到以下内容。 Please help me disable the rule for this case. 请帮助我禁用这种情况下的规则。 Thank you. 谢谢。

Parsing error, unexpected token, epected "," (Fatal)

for working code that reloads just fine... 对于重新加载的工作代码就好了...

both samples work 两个样品都起作用

return (~
    <h2>hi</h2>
  ~)

and

return (
  (~ <h2>hi</h2> ~)
)

Eslint does not support haml and as far as I know there is no plugin to add a support. Eslint不支持haml,据我所知,没有插件可以添加支持。 Did you consider moving your hamls to separate files, which will not be targeted by eslint and lint them with haml-lint or any other similar util? 您是否考虑过将hamls移到单独的文件中,而eslint不会将它们定位为目标,而是使用haml-lint或任何其他类似的util将它们掉毛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM