Rule IDs are magic numbers
See original GitHub issueI think the rule IDs are pretty cryptic:
{
"comma-dangle": [2, "never"],
"no-console": 0,
"curly": [1, "multi-line"]
}
What about we use some mnemonic strings instead?
{
"comma-dangle": ["require", "never"],
"no-console": "ignore",
"curly": ["favor", "multi-line"]
}
Where require
generates errors, favor
generates warnings, and ignore
turns the rule off.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:21 (13 by maintainers)
Top Results From Across the Web
Magic number (programming) - Wikipedia
In computer programming, a magic number is any of the following: A unique value with unexplained meaning or multiple occurrences which could (preferably)...
Read more >What is a magic number, and why is it bad? - Stack Overflow
A magic number is a direct usage of a number in the code. ... is that you're reusing a space (that of signed...
Read more >Are magic numbers always magic in Programming?
However, we shouldn't blindly follow disallow magic number rule! We can argue that not all numbers are magic. For example, HTTP status codes...
Read more >Requirements numbering - No Magic Documentation
The default Requirement IDs in modeling tool are hierarchical numbers: 1, 1.1, 1.1.1, etc. As example, see the following figure. Requirements numbering. The ......
Read more >What is a magic number? - IBM
ANSWER: A magic number is a numeric or string constant that indicates the file type. This number is in the first 512 bytes...
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 agree that those magic numbers are a bad thing, especially for a code quality tool.
I’m not sure that your proposal really improves something because the enums aren’t very meaningful without context.
I would prefer something like this:
I don’t want two ways of doing configuration, that increases complexity for very little gain.
@lo1tuma if you want to think about some incremental improvements for 2.0.0, add that to the wish list.
For now, we aren’t going to make any changes. The documentation is pretty clear about these numbers, we should keep pointing people to it.