Closed CreativeTechGuy closed 1 year ago
Hi @CreativeTechGuy
I appreciate the kind words.
Based on your examples it is very clear the this plugin was not suited for codebases indented using tabs. This was the case as this plugin has primarily been used internally, and as such this issue has never been relevant before.
However, it was fairly straightforward to add support and therefore tabs should be supported from v1.4.4. In case you encounter any bugs related to the implementation, then feel free that add a PR that fixes these issues.
NB: For overflow detection to function as expected, then the plugin needs to know your configured tab size. If you are using VSCode, then this option should match the editor.tabSize
option. (By default the configured tabSize is 2)
The tabSize can be configured by adding the snippet below to your ESLint rules config.
"comment-length/limit-single-line-comments": [
"warn",
{
tabSize: 2,
},
],
"comment-length/limit-multi-line-comments": [
"warn",
{
tabSize: 2,
},
],
When using the tab character for indentation, the auto-fix messes up formatting in some pretty bad ways. Here's two examples:
single-line comment:
This uses a tab to indent the comment, it is auto-fixed to: (Note that the newly added line is indented with the same number of spaces as there were tabs previously - this holds for any number of tabs)
multi-line comment:
This again uses tabs, when auto-fixed it looks like:
Here's an online sandbox to play around with the examples I listed above: https://stackblitz.com/edit/stackblitz-starters-fvft8y?file=src%2Ftest.js
Unfortunately as is currently this isn't usable with tabs. The practical problems are:
I think this tool is amazing and I'm so glad you made it. Is it possible that it can be compatible with those who use tabs?