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 code action for fixing / disabling issues #39

Closed
BPScott opened this issue Jan 6, 2020 · 6 comments · Fixed by #322
Closed

Add code action for fixing / disabling issues #39

BPScott opened this issue Jan 6, 2020 · 6 comments · Fixed by #322
Labels
effort: moderate Requires experience with the codebase, but feasible. Harder than "effort: casual". type: enhancement a new feature that isn't related to rules
Milestone

Comments

@BPScott
Copy link
Contributor

BPScott commented Jan 6, 2020

VSCode supports "code actions" on particular lines, which appear as little light bulbs on hover.

The ESLint extension uses them to expose quick fixes for lines that contain a rule violations allowing the user to autofix the issue (if available), or to disable linting for that line by adding an eslint-disable-next-line [ruleName] comment above the rule.

For example in the following screenshot there is a violation of the prettier/prettier rule - the extra space after the }:

Screen Shot 2020-01-06 at 9 43 27 AM

It'd be neat if this extension could do the same for offering the option to add ignore comments to lines with violations

@fanich37
Copy link
Member

fanich37 commented Feb 4, 2020

If no one is working on it I would like to get it :)

@jeddy3 jeddy3 changed the title Add code action "lightbulb" items for fixing / disabling issues Add code action for fixing / disabling issues Mar 12, 2020
@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 labels Mar 12, 2020
@gaurav5430
Copy link

is this being worked on?

@fanich37
Copy link
Member

@gaurav5430 You can take it. I failed with free time :(

@adalinesimonian adalinesimonian added the effort: moderate Requires experience with the codebase, but feasible. Harder than "effort: casual". label Oct 28, 2021
@adalinesimonian adalinesimonian added this to To do in v1.2 Nov 6, 2021
@adalinesimonian
Copy link
Member

We can't implement code actions for individual problems just yet because we don't get fix information per warning from Stylelint (see #315 (comment) for more details). However, we can add code actions for fixing all problems. Adding this to the v1.2.0 milestone.

@adalinesimonian adalinesimonian added this to the v1.2.0 milestone Nov 6, 2021
@adalinesimonian adalinesimonian moved this from To do to In progress in v1.2 Nov 8, 2021
@adalinesimonian adalinesimonian moved this from To do to In progress in Rolling Work Tracking Nov 8, 2021
adalinesimonian added a commit that referenced this issue Nov 13, 2021
Resolves #39, Resolves #185

Also fixes a bug where configuration would not update when edited
@adalinesimonian adalinesimonian linked a pull request Nov 13, 2021 that will close this issue
adalinesimonian added a commit that referenced this issue Nov 14, 2021
* feat: Add problem code actions

Resolves #39, Resolves #185

Also fixes a bug where configuration would not update when edited

* test: patch non-code-action unit tests

* test: resolve cspell lint error

* test: get unit tests to pass

* test: add e2e test for code actions

* test: wait for code action handler registration

* test: use better checks

* ci: skip code action edit e2e tests for now

* docs: add changelog entries
Rolling Work Tracking automation moved this from In progress to Done Nov 14, 2021
v1.2 automation moved this from In progress to Done Nov 14, 2021
@adalinesimonian
Copy link
Member

Done in #322.

@adalinesimonian adalinesimonian added Fixed effort: moderate Requires experience with the codebase, but feasible. Harder than "effort: casual". and removed status: ready to implement is ready to be worked on by someone effort: moderate Requires experience with the codebase, but feasible. Harder than "effort: casual". labels Nov 15, 2021
@borjapazr
Copy link

This development did not include single fixes at a time, did it? Are there any plans to develop this functionality?

Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: moderate Requires experience with the codebase, but feasible. Harder than "effort: casual". type: enhancement a new feature that isn't related to rules
Projects
v1.2
  
Done
Development

Successfully merging a pull request may close this issue.

6 participants