New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[[FIX]] Improve handling of tab indentation. #3274
base: main
Are you sure you want to change the base?
Conversation
By tracking the column number both with and without soft tabs, we enable better messages for errors and warnings. This is especially useful for editor linting integrations. Fixed jshint#3151
Thanks for the patch! This problem has been causing a lot of headaches, as gh-3151 demonstrates. I'm definitely interested in moving forward with this, but I think we need to reformat it a bit first. The current behavior is somewhat surprising, but it is also poorly-documented. At the moment, the documentation of the data reported by JSHint is limited to a single example on jshint.com, and that example does not even include the corresponding input text. Over the years, consumers have been forced to discover the feature and learn its behavior experimentally. So as surprising as we may find the behavior, it's possible that code out there has come to rely on it. Of course, anyone could be relying on any flaw in JSHint's implementation, and this alone isn't enough to stop us from fixing bugs. The extenuating circumstance here is the poor state of the documentation and the ambiguity of the expected behavior. That's why I think we need to introduce this as a new feature rather than a bug fix. What do you think of this:
Like the first draft you've submitted here, this approach fixes the problem for the folks that need it. On top of that, it avoids disrupting existing code, and it also gives us a clear path to the next major release, where the confusing So what do you think? Would you be up for that work? Depending on how you want to proceed, it may involve rebasing your branch. As noted in that "work-in-progress" pull request for version 2.10.0, I'd be happy to help you with that. |
I'd certainly be happy with moving to a different property in the result if it means being able to close the ~40 issues I've got open tracking this 😆. |
Just fell over this issue again... |
By tracking the column number both with and without soft tabs,
we enable better messages for errors and warnings. This is especially
useful for editor linting integrations.
Fixes #3151