Rule Proposal: no-ascii
See original GitHub issueHi everyone. One day my teammate wrote object key with non-ASCII characters. It led to problems with renaming. So I want proposal new rule no-ascii
.
When does this rule warn? Please describe and show example code:
// Russian letter `Й`.
var obj = {
Й: 'value'
};
// Japanese variable.
var 日 = 'Japanese';
日.length; // 8
Is this rule preventing an error or is it stylistic?
In JS there isn’t prohibited non-ASCII characters (it works correctly), but in some projects this is disallowed.
Why is this rule a candidate for inclusion instead of creating a custom rule?
I think it’s global rule for everyone.
Are you willing to create the rule yourself?
I found solution by @fand, but I made some changes.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:7 (5 by maintainers)
Top Results From Across the Web
The Use of Non-ASCII Characters in RFCs RFC 7997
This document describes the rules under which non-ASCII characters may be used in an RFC. These rules will be applied as the necessary ......
Read more >The Use of Non-ASCII Characters in RFCs - WaterSprings.ORG
This document describes the rules under which non-ASCII characters may be used in an RFC. These rules will be applied as the necessary ......
Read more >The Use of Non-ASCII Characters in RFCs
This document describes the rules under which non-ASCII characters may be used in an RFC. These rules will be applied as the necessary...
Read more >PEP 3131 – Supporting Non-ASCII Identifiers
This PEP suggests to support non-ASCII letters (such as accented characters, Cyrillic, Greek, Kanji, etc.) in Python identifiers.
Read more >How do you ensure there are no non-ASCII characters in ...
There isn't a rule for it yet. Custom rule. From : https://github.com/palantir/tslint/#writing-custom-rules. The following is one idea:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this can already be accomplished with
id-match
rule with the following configuration:Oh, thank you @ilyavolodin. That’s what I need!