Skip to content
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

Inclusion of barely-more-than-formatting rules? #26

Closed
JoshuaKGoldberg opened this issue Oct 20, 2023 · 5 comments
Closed

Inclusion of barely-more-than-formatting rules? #26

JoshuaKGoldberg opened this issue Oct 20, 2023 · 5 comments

Comments

@JoshuaKGoldberg
Copy link

Following up on eslint/eslint#17522 & #19: I think there is a small discrepancy between the name (stylistic) of this plugin and what it's going to be used by most devs as at time of announcement (formatting). eslint/eslint#17522 mentions several rules that aren't covered by some or all formatters, but debatably may fall into the category of stylistic rules this plugin should cover:

  • curly
  • padding-line-between-statements
  • no-unexpected-multiline
  • no-mixed-operators

Would it be reasonable to include these rules in eslint-stylistic, but only enable them in a dedicated config for non-formatting stylistic rules? If not, and this config really is just for the formatting rules, maybe it should be named eslint-formatting after all? (is that a false dichotomy?)

For anecdotal context/evidence, in https://github.com/JoshuaKGoldberg/create-typescript-app (which uses Prettier for formatting):

cc @bradzacher

@ljharb
Copy link
Member

ljharb commented Oct 20, 2023

All of those are stylistic - stylistic rules objectively prevent bugs, despite the incorrect belief of some that they’re purely aesthetic.

@JoshuaKGoldberg
Copy link
Author

@ljharb I agree but don't see how that's relevant here? Does part of this issue imply otherwise accidentally?

@ljharb
Copy link
Member

ljharb commented Oct 20, 2023

ah, maybe i misread.

I think that it's better for the scope of this plugin to be stylistic and not just formatting, since it's likely that eslint will continue to remove swaths of rules over time and punt the work to the community.

@antfu
Copy link
Member

antfu commented Oct 21, 2023

From my point of view, I named it ESLint Stylistic instead of ESLint Formatting because I want to be inclusive, as sometimes the border between stylistic and formatting could also be ambiguous. Naming as Stylistic means that we are welcoming stylistic rules that could go beyond a bit of pure formatting.

curly to me is a "formatting" rule (despite that Prettier doesn't want to handle it). Under the name ESLint Stylistic, it doesn't matter whether it's been categorized as "formatting" or "stylistic" - we are happy to have it either way.

I think the current problem might not be "how we categorized them", but rather "what ESLint would let go". If ESLint team wants to keep maintaining curly et al. it makes less sense for us to port and maintain them because "we don't want to duplicate the effort" but rather "we don't think it's in the scope of ESLint Stylistic".

In short, I'd be happy to have them here as long as ESLint team also agrees on that.

@antfu
Copy link
Member

antfu commented Nov 17, 2023

Close in favor of eslint/eslint#17681

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants