简体   繁体   中英

React:TSLint - Ban the mac 'smart quote' character?

One of our designers likes to use mac smart quotes/apostrophes in his mockups, but we don't want them showing up ANYWHERE in the code. Is there a way to create a rule using TSLint that will warn (or even ban) specific characters like this from the entire codebase?

Smart quote example: you'll

Dumb quote example: you'll

As you can see, it's pretty hard to see the difference and catch them in real time. They don't cause errors, but for consistency we don't want them finding their way in from copy/pastes.

It seems that there is no rule that provides character banning. You can write custom rule as described in the documentation .

See also https://stackoverflow.com/a/40394298/3639633 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM