[no-tabs] allow exceptions
See original GitHub issueWhat rule do you want to change?
no-tabs
(currently on eslint 6.5.1)
Does this change cause the rule to produce more or fewer warnings?
fewer warnings
How will the change be implemented?
New option.
Please provide some example code that this change will affect:
if (inTabIndentedCode) {
⇥ // if (commented) {
⇥ // ⇥ codeInBlocks();
⇥ // }
⇥ hasProblems();
}
const also = some`
⇥ string⇥ ${literals}
⇥ use⇥ ${tabulators}
`;
… // rules:
'indent': ['error', 'tab'],
'no-tabs': ['error', { 'allowIndentationTabs': true }],
What does the rule currently do for this code?
It complains about Unexpected tab character
inside the commented-out code and in the string string literal, which is too strict imo.
What will the rule do after it’s changed?
I would propose to add some configuration options that either
- could allow lines matching a certain regex
- could allow lines in a certain AST context, e.g. string literals or comments
so that the rule would accept above code examples but still complain about tabulator characters elsewhere.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:13 (4 by maintainers)
Top Results From Across the Web
[solved] eslint no-tabs errors | Quasar Framework Community
I use atom and the eslint atom package for other work. I keep an eslintrc.js file in my home directory for all projects....
Read more >no-tabs - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Style Rule Set | Detekt
This rule allows to set a list of rules whose suppression is forbidden. ... NoTabs. This rule reports if tabs are used in...
Read more >Best Practices for using Exceptions in Uniface
Best Practices for using Exceptions in Uniface ... Enable Referential Integrity in a Microsoft SQL Server Database ... 3024 No tabs allowed.
Read more >Select no tabs in a UITabBar - Stack Overflow
... a part of UITabBarController then application will crash with exception: 'Directly modifying a tab bar managed by a tab bar controller is...
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 Free
Top 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
Closing per our rules policies.
Understood, thank you. I think it would make sense to make the configuration option also accept an object with the following signature:
We could do this in a backwards compatible way and eventually remove the current string option in a future major release.
Thoughts?