Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to meet eslint max line length rules with long svg path?

Tags:

eslint

The eslint max line length is set to 120, but I have a svg and its path is longer than 120, what can I do to meet the max-line-length?

<path d="M47.2388, 12.45 ...................."/>
like image 397
vuvu Avatar asked Jul 10 '18 15:07

vuvu


2 Answers

The accepted answer is wrong, the "d" attribute of a path is not a Template Literal so ignoreTemplateLiterals does not make sense.

In the same way, ignoreStrings does not work, at least in my vue project.

The best solution for me is to use ignorePattern like this:

ignorePattern: 'd="([\\s\\S]*?)"'

You alway can check the documentation: https://eslint.org/docs/rules/max-len

like image 113
Heisenberg Avatar answered Oct 16 '22 08:10

Heisenberg


"max-len": ["error", {"ignoreTemplateLiterals": true, "ignoreStrings": true}]

or

ESLint-plugin-React

like image 39
exvayn Avatar answered Oct 16 '22 08:10

exvayn