F
F
fessss2020-10-02 10:20:02
typescript
fessss, 2020-10-02 10:20:02

TSlinter swears at character?

phone: (value: string) => {
        // eslint-disable-next-line
        const pattern = /^\d[\d\(\)\ -]{4,14}\d$/;
        return pattern.test(value) || 'Введи корректный телефон';
},


132:32  error    Unnecessary escape character: \(   no-useless-escape
  132:34  error    Unnecessary escape character: \)   no-useless-escape
  132:36  error    Unnecessary escape character: \ .  no-useless-escape


Swears on a line with a regular expression. How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-10-02
@fessss

If you do not know English - throw out the linter. What is the use of the fact that he writes you "some" messages that you are not able to read?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question