Skip to content

no-multi-asterisks rule #730

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

Merged
merged 1 commit into from
May 15, 2021
Merged

no-multi-asterisks rule #730

merged 1 commit into from
May 15, 2021

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented May 13, 2021

feat: no-multi-asterisks rule to prevent multiple asterisks with middle delimiters or at end of blocks

Fixes #199 (other fixes have now been merged).

@brettz9 brettz9 requested a review from golopot May 13, 2021 13:03
@golopot
Copy link
Collaborator

golopot commented May 13, 2021

I think "ban multiple asterisks at line start" should be a special case of "require one space after asterisk".

/**
 ** @param a  // require one space after asterisk
 *@param b // require one space after asterisk
 */

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

Can you please clarify?

@golopot
Copy link
Collaborator

golopot commented May 13, 2021

Since the potential rule "require one space after leading asterisk" would included the functionality of this pr and do more, it looks like a better solution.

@golopot
Copy link
Collaborator

golopot commented May 13, 2021

Heuristically, what I want is to enforce the style of leading asterisks, instead of banning a particular occurrence of **.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

Enforce the style to what exactly? One space vs. what? No spaces and a fixed number of spaces?

While I can see allowing the parser to accept it in other styles or bad form, do a lot of projects actually use anything more than a single space in a consistent way? The spec, TS, Closure, etc., all seem, as I can recall, to just use just the one style.

@golopot
Copy link
Collaborator

golopot commented May 13, 2021

Enforce the style to what exactly? One space vs. what? No spaces and a fixed number of spaces?

Yes I mean the one style.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

So you mean ensure there is one space even if not multiple asterisks--but enforce no other style, right?

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

I suggest taking a look at my edit of #199 (comment) to ensure it clarifies what you want.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

I think what you are asking for is pretty much the expectation of check-line-alignment with either the "never" or "always" option.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 13, 2021

If it wasn't clear, I mean that that is how check-line-alignment already behaves.

@golopot
Copy link
Collaborator

golopot commented May 13, 2021

Ok

@brettz9
Copy link
Collaborator Author

brettz9 commented May 14, 2021

Are you ok with my going ahead with this (and the other PRs), or do you need more time to review?

@brettz9 brettz9 force-pushed the no-multi-asterisks branch from bb5213f to 4f2286c Compare May 15, 2021 06:57
@brettz9 brettz9 force-pushed the no-multi-asterisks branch from 4f2286c to a54079c Compare May 15, 2021 16:05
@brettz9 brettz9 force-pushed the no-multi-asterisks branch from a54079c to 584b76e Compare May 15, 2021 16:41
@brettz9 brettz9 merged commit 8848246 into gajus:master May 15, 2021
@brettz9 brettz9 deleted the no-multi-asterisks branch May 15, 2021 17:22
@gajus
Copy link
Owner

gajus commented May 15, 2021

🎉 This PR is included in version 34.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: rule to enforce asterisks
3 participants