eslint的最大行长设置为120,但是我有一个svg并且它的路径长于120,我该怎么做才能满足max-line-length?
<path d="M47.2388, 12.45 ...................."/>
Run Code Online (Sandbox Code Playgroud)
Hei*_*erg 14
接受的答案是错误的,路径的“d”属性不是模板文字,因此 ignoreTemplateLiterals 没有意义。
同样,ignoreStrings 不起作用,至少在我的 vue 项目中。
对我来说最好的解决方案是像这样使用ignorePattern:
ignorePattern: 'd="([\\s\\S]*?)"'
Run Code Online (Sandbox Code Playgroud)
您可以随时查看文档:https : //eslint.org/docs/rules/max-len
小智 3
"max-len": ["error", {"ignoreTemplateLiterals": true, "ignoreStrings": true}]
Run Code Online (Sandbox Code Playgroud)
或者
| 归档时间: |
|
| 查看次数: |
4822 次 |
| 最近记录: |