Skip to content

Conversation

ryo-manba
Copy link
Member

@ryo-manba ryo-manba commented Mar 15, 2025

Which issue, if any, is this issue related to?

Closes #8344

Is there anything in the PR that needs further explanation?

Add --compute-edit-info CLI flag to get fix information without applying changes.
Feel free to suggest any improvements to the message format.

The format will be handled separately.
See details: #8473 (comment)

Copy link

changeset-bot bot commented Mar 15, 2025

🦋 Changeset detected

Latest commit: b9bafc5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Mar 15, 2025

Try the Instant Preview in Online Demo

Stylelint Online Demo

Install the Instant Preview to Your Local

npm i -D https://pkg.pr.new/stylelint@8473

View Commit

@Mouvedia
Copy link
Member

@ryo-manba I did a first pass. You will have to refactor your test.
Overall it LGTM to me.

@ybiquitous
Copy link
Member

Let me confirm the current status of the computeEditInfo feature (sorry, I'm a bit unfamiliar about this area).

Is my understanding above correct?

Also, before this addition of the CLI flag, should we clarify the status and publish the feature in the documentation as an experimental feature?

cc @jeddy3 @romainmenke

@jeddy3
Copy link
Member

jeddy3 commented Mar 17, 2025

@romainmenke is more clued up on this feature, but I think we'll be ready to release this feature (as unexperimental) when we merge PRs alongside this one for:

(There are only three rules left to do in the final issue, thanks to @pamelalozano16 and @ryo-manba hard work.)

We'll want to merge this PR and the two documentation ones together so they are included in the same release.

@ryo-manba Thank you for getting the ball rolling with this PR, by the way!

@ybiquitous
Copy link
Member

I think we'll be ready to release this feature (as unexperimental) when we merge PRs alongside this one

Agree 👍🏼

ryo-manba and others added 2 commits March 18, 2025 00:16
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes, including testing against the JSON formatter.

I've added one minor suggestion, otherwise LGTM.

lib/cli.mjs Outdated
@@ -319,6 +323,11 @@ const flags = {
shortFlag: 'v',
type: 'boolean',
},
computeEditInfo: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put this after the color property to maintain the alphabetical order.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the details. 🙇

@ryo-manba ryo-manba requested review from jeddy3 and ybiquitous March 17, 2025 16:40
@Mouvedia Mouvedia dismissed their stale review March 17, 2025 20:20

resolved

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM 👍🏼

@Mouvedia
Copy link
Member

as unexperimental

/** @experimental */

/** @experimental */

* @experimental

@jeddy3 do we remove these in the last PR?
If so which one is the last?

Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@jeddy3 jeddy3 merged commit 96ccbef into main Mar 25, 2025
19 checks passed
@jeddy3 jeddy3 deleted the issue-8344 branch March 25, 2025 14:05
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 28, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.16.0 | 16.17.0 |


## [v16.17.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16170---2025-03-26)

It adds 1 new rule, support for `languageOptions` to 2 rules, 1 option to a rule, the `--compute-edit-info` CLI flag (along with support for `EditInfo` in 3 rules), and fixes 1 bug. `EditInfo` is useful for automated fixing tools and editor integrations.

-   Added: `layer-name-pattern` rule ([#8474](stylelint/stylelint#8474)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `--compute-edit-info` CLI flag ([#8473](stylelint/stylelint#8473)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `ignorePreludeOfAtRules: []` to `length-zero-no-unit` ([#8472](stylelint/stylelint#8472)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-no-unknown` support for `languageOptions` ([#8475](stylelint/stylelint#8475)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `property-no-unknown` support for `languageOptions` ([#8476](stylelint/stylelint#8476)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-block-no-redundant-longhand-properties` support for computing `EditInfo` ([#8482](stylelint/stylelint#8482)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `function-url-quotes` support for computing `EditInfo` ([#8483](stylelint/stylelint#8483)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `selector-attribute-quotes` support for computing `EditInfo` ([#8484](stylelint/stylelint#8484)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Fixed: `custom-property-pattern` false negatives for `@property` preludes ([#8468](stylelint/stylelint#8468)) ([@rohitgs28](https://github.com/rohitgs28)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 28, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.16.0 | 16.17.0 |


## [v16.17.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16170---2025-03-26)

It adds 1 new rule, support for `languageOptions` to 2 rules, 1 option to a rule, the `--compute-edit-info` CLI flag (along with support for `EditInfo` in 3 rules), and fixes 1 bug. `EditInfo` is useful for automated fixing tools and editor integrations.

-   Added: `layer-name-pattern` rule ([#8474](stylelint/stylelint#8474)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `--compute-edit-info` CLI flag ([#8473](stylelint/stylelint#8473)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `ignorePreludeOfAtRules: []` to `length-zero-no-unit` ([#8472](stylelint/stylelint#8472)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-no-unknown` support for `languageOptions` ([#8475](stylelint/stylelint#8475)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `property-no-unknown` support for `languageOptions` ([#8476](stylelint/stylelint#8476)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-block-no-redundant-longhand-properties` support for computing `EditInfo` ([#8482](stylelint/stylelint#8482)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `function-url-quotes` support for computing `EditInfo` ([#8483](stylelint/stylelint#8483)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `selector-attribute-quotes` support for computing `EditInfo` ([#8484](stylelint/stylelint#8484)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Fixed: `custom-property-pattern` false negatives for `@property` preludes ([#8468](stylelint/stylelint#8468)) ([@rohitgs28](https://github.com/rohitgs28)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add --compute-edit-info flag
4 participants