Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
es lint max length rule disabling is not working

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?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Which version of eslint do you have? I think you can can try //eslint-disable-line for disable all rules for the specific line, or using // eslint-disable max-len

Taking from here: https://github.com/prettier/prettier/issues/3375

Edit

I think you can also add a ignoreRule for you speisifc regex. See here the docs: https://eslint.org/docs/rules/max-len of ignorePattern

about 4 years ago · Juan Pablo Isaza Report

0

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 */
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!