Issue
I am trying to disable eslint rule in a typescript file. I have a regular expression which contains more than 500 characters. So it's generated an eslint warning. Since this is a regular expression, better way is to add an eslint comment before declaring the regular expression only for that line. So my attempt is as below.
/* eslint-disable-next-line max-len */
export const URI_REGEX = "" // something which is very long
But still this is not working. I could see the eslint warning as This line has a length of 509. Maximum allowed is 270
. So how can I remove this warning?
Solution
Not sure, your method should be working but can you give this a try by wrapping it?
/* eslint-disable max-len */
export const URI_REGEX = "" // something which is very long
/* eslint-enable max-len */
Answered By - Harry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.