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

Add support for showing deprecation warnings #396

Open
U-4-E-A opened this issue Feb 9, 2024 · 3 comments
Open

Add support for showing deprecation warnings #396

U-4-E-A opened this issue Feb 9, 2024 · 3 comments
Labels
status: ready to implement is ready to be worked on by someone

Comments

@U-4-E-A
Copy link

U-4-E-A commented Feb 9, 2024

What is the problem you're trying to solve?

I recently updated from v14 to v16 and encountered a number of deprecated rules. stylelint's documentation is excellent but the "migrating to v15" simply leaves me having to check and remove individual rules. Whereas this is not the end of the world, I think it would be beneficial for stylelint to provide a view on their website which would automate cleaning up of config.

What solution would you like to see?

A view where a user can paste their config into a text field, select their stylelint version (and perhaps also add in the same selection functionality for the various plugins) and be alerted to rules (and other parts of the config) that are deprecated or removed. Perhaps also allow the user to download a new version of the config with the removed rules deleted and maybe also download with comments added stating where a rule is deprecated and is expected to be removed.

@ybiquitous
Copy link
Member

@U-4-E-A Thanks for the proposal. Implementing all the features at once might be challenging, but at least showing deprecation warnings sounds helpful to me.

This topic is related to stylelint/stylelint-demo, so I'll transfer this.

@ybiquitous ybiquitous transferred this issue from stylelint/stylelint Feb 13, 2024
@ybiquitous ybiquitous added the status: needs discussion triage needs further discussion label Feb 13, 2024
@ybiquitous
Copy link
Member

This demo is an example of the unit-case rule that was removed in 16.0.0. No warnings are shown:

image

On the other hand, the deprecation warning is output with CLI:

$ npx stylelint -v
15.11.0

$ echo 'a { width: 1PX; }' | npx stylelint

Deprecation warnings:
 - The "unit-case" rule is deprecated.

<input css RjcOe8>
 1:13  ✖  Expected "PX" to be "px"  unit-case

1 problem (1 error, 0 warnings)

@jeddy3 jeddy3 changed the title Provide functionality on your website to test a config and alert to deprecation Add support for showing deprecation warnings Sep 6, 2024
@jeddy3 jeddy3 added type: enhancement status: ready to implement is ready to be worked on by someone and removed status: needs discussion triage needs further discussion labels Sep 6, 2024
@Mouvedia
Copy link
Member

Mouvedia commented Nov 22, 2024

select their stylelint version […] and be alerted to rules […] that are deprecated¹ or removed²

If you have "stylelint": "latest", in the dependencies tabs, removed rules will get the same treatment as typos or third party rules lacking their plugins.
i.e. Unknown rule foo-bar.

So there's 2 part to this:

  1. showing the deprecation warnings (for the currently deprecated rules)
  2. adding deprecated rules of the previous major version to stylelintrc.json so that they can be detected as such (instead of being treated as unknown)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone
Development

No branches or pull requests

4 participants