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

Deprecate stylistic rules handled by Prettier #6342

Closed
jeddy3 opened this issue Sep 12, 2022 · 7 comments · Fixed by #6504
Closed

Deprecate stylistic rules handled by Prettier #6342

jeddy3 opened this issue Sep 12, 2022 · 7 comments · Fixed by #6504
Assignees
Labels
status: wip is being worked on by someone type: enhancement a new feature that isn't related to rules
Milestone

Comments

@jeddy3
Copy link
Member

jeddy3 commented Sep 12, 2022

We should deprecate that stylistic rules that we froze a year ago.

Even though deprecating is a non-breaking change, we should do this as part of a major release so that we can communicate this significant change in direction.

We'd release a new version of our standard config that removes the deprecated rules. Therefore, most of our users will never see the deprecation warnings.

As such, we won't need to prepare a plugin pack of the stylistic rules. If people want to continue using the stylistic rules, they can port the rules they need to a plugin under their own namespace and outside of the Stylelint organisation.

Ref: #6311 (comment)
Ref: #5674

@jeddy3 jeddy3 added the status: needs discussion triage needs further discussion label Sep 12, 2022
@ybiquitous
Copy link
Member

@jeddy3 Thanks for opening the issue. I agree with the deprecation included in a major release. 👍🏼

@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules and removed status: needs discussion triage needs further discussion labels Sep 28, 2022
@jeddy3 jeddy3 added this to the future-major milestone Sep 28, 2022
@jeddy3 jeddy3 mentioned this issue Oct 13, 2022
@jeddy3
Copy link
Member Author

jeddy3 commented Nov 28, 2022

Following on from #6483, let's only deprecate the rules handled by Prettier as suggested by @ybiquitous in #6311 (comment).

The 8 rules not handled by Prettier are unlikely to be added to it as they need configuration options to be safe or desired.

They are also not as problematic as some of our other stylistic rules as they:

  • don't have the possibility of introducing new lint problems
  • use the construct parsers rather than stylesearch
  • cleanly work with the AST, either mutating raws or single nodes

We can move these rules to 3 subgroups within our "Enforce non-stylistic conventions" group:

  • Case
  • Empty lines
  • Whitespace inside

We can then rename the:

  • "Enforce non-stylistic conventions" group to "Enforce conventions"
  • "Enforce stylistic conventions" group to "Deprecated" (before being removed entirely in v16)

I believe this approach will strike the best balance between our needs to:

  • ensure the smoothest migration to v15 for the majority of our users
  • move forward with plans like migrating to ESM (so that we can update a bunch of our dependencies)

@jeddy3 jeddy3 changed the title Deprecate stylistic rules Deprecate stylistic rules handled by Prettier Nov 28, 2022
@ybiquitous
Copy link
Member

@jeddy3 More balanced idea! 👍🏼

@Mouvedia
Copy link
Contributor

before being removed entirely in v16

Alright, so that means the plugin won't be needed for a while.

@jeddy3
Copy link
Member Author

jeddy3 commented Nov 28, 2022

It'll give people time to, if needed, write community plugins for the rules that we deprecate. The rules in #6483 won't be deprecated, so there won't be a need for us or anyone else to write a plugin for them.

@ybiquitous ybiquitous self-assigned this Dec 4, 2022
@ybiquitous ybiquitous added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Dec 4, 2022
@ybiquitous ybiquitous linked a pull request Dec 4, 2022 that will close this issue
@jeddy3
Copy link
Member Author

jeddy3 commented Dec 6, 2022

Closed by #6504

@Mouvedia
Copy link
Contributor

Mouvedia commented Dec 22, 2022

I wanted to check whether all the rules that were being deprecated were properly covered by prettier.

This one has options:

  • "always"
  • "always-single-line"
  • "never-single-line"
  • "always-multi-line"
  • "never-multi-line"

Are all of these properly covered by prettier? If not, we need to make a list of rules that are being deprecated but are only partially covered by the prettier replacement. e.g.

name support note
rule A full
rule B partial does not support option X and Y
rule C partial only support option Z

I think this should be documented before the version 16 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: enhancement a new feature that isn't related to rules
Development

Successfully merging a pull request may close this issue.

3 participants