Quantcast
Channel: Getting an ESLint: Unnecessary escape character - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Nicolas Hevia for Getting an ESLint: Unnecessary escape character

$
0
0

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 disable the rule:

//eslint-disable-next-lineif (!/^[a-zA-Z0-9\\\/\*+;&%?#@!^()_="\-:~`|[\]\{\}\s]*$/i.test(e.target.value)) {   this.setState({      newFamilyName: e.target.value,   });}

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>