↧
Answer by Dylan for Getting an ESLint: Unnecessary escape character
Unnecessary escape character means you have a \ in front of a character in your regex that you don't actually need.I plugged the code you posted into https://eslint.org/demo and got:1:20 - Unnecessary...
View ArticleAnswer by Nicolas Hevia for Getting an ESLint: Unnecessary escape character
You have some unnecesary escape characters:\/\*\{\}You can fix it:if (!/^[a-zA-Z0-9\\/*+;&%?#@!^()_="\-:~`|[\]{}\s]*$/i.test(e.target.value)) { this.setState({ newFamilyName: e.target.value, });}Or...
View ArticleGetting an ESLint: Unnecessary escape character
I'm trying to validate a text field but, I'm getting an error for the below regex expression. if (!/^[a-zA-Z0-9\\\/\*+;&%?#@!^()_="\-:~`|[\]\{\}\s]*$/i.test(e.target.value)) { this.setState({...
View Article