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
Implement default "never" option for check-line-alignment
rule: linting inside comments block spaces/tab to single space
#483
Comments
Not currently. One can use regexes on the description portion using |
This is quite complex given the lack of concrete syntax tree or parsers that can produce one for JSDoc. Neither Doctrine, nor comment-parser can do what espee does for js, namely tokenize input and keep information about all whitespaces and non-syntax important stuff. Some attempt were made in eslint-plugin-interfaced however, particularly JSDocTokenizer and some helper functions. And |
What about the use case where we want to disable multi space alignment in JSDoc? Does that feature requires complex parsing? Something that fixes: /**
* @param {string} foo This is foo.
* @param {object} bar This is bar.
* @returns {boolean} This is the returned value.
*/ to: /**
* @param {string} foo This is foo.
* @param {object} bar This is bar.
* @returns {boolean} This is the returned value.
*/ The rule may be very specific like "jsdoc/no-aligment" : "error" Or a more configurable rule similar to https://eslint.org/docs/rules/key-spacing but it looks lke we are limited by the JSDoc parser. So.. can we at least have a simple rule to disallow multi space alignment? PS: As a workaround can we have a generic |
@yvele : I think based on the title of the issue that that's what the original poster intended for the rule, though there could conceivably be a rule which automatically added whitespace with alignment. I'd be personally open to a whole-line regex solution as an interim solution if someone could put a PR together, though it'd be great as @l1bbcsg suggests if we could get AST for jsdoc, or at least build on |
check-line-alignment
rule: linting inside comments block spaces/tab to single space
I've renamed this issue to reflect the fact that we've made space for this functionality within a new rule |
🎉 This issue has been resolved in version 31.0.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I've gone ahead and implemented the "never" behavior as @renatho previously implemented "always" behavior. It'd probably be better if we switched internally for the "always" behavior to the new |
Just a question if this plugin has a rule to check for multiple spaces or tabs inside a comment block?
Thanks in advance.
The text was updated successfully, but these errors were encountered: