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

More documentation on conflicting fixes #13721

Closed
Tracked by #16365
RunDevelopment opened this issue Sep 29, 2020 · 9 comments · Fixed by #16366
Closed
Tracked by #16365

More documentation on conflicting fixes #13721

RunDevelopment opened this issue Sep 29, 2020 · 9 comments · Fixed by #16366
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features documentation Relates to ESLint's documentation
Projects

Comments

@RunDevelopment
Copy link

The developer documentation about rules (docs/developer-guide/working-with-rules.md) doesn't contain enough information about rules. This is a followup to eslint/archive-website#791.

The following questions should be answered:

  1. Q: When do fixes conflict?
    A: "Conflicting fixes are fixes that would be applied to the same part of a string. So if two fixes want to modify characters 0 through 5, only one will be applied."
  2. Q: If fixes conflict which one will be applied?
    A: Fixes are not guaranteed to be applied. ESLint may choose to apply or not to apply any fix.
  3. Q: Can the (rule) developer affect which one of the conflicting fixes is applied?
    A: No.

Are you willing to submit a pull request to implement this change?
No. I'm not good at writing technical documentation.

@RunDevelopment RunDevelopment added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Sep 29, 2020
@mdjermanovic mdjermanovic added documentation Relates to ESLint's documentation evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Sep 29, 2020
@mdjermanovic
Copy link
Member

Thanks for the issue!

I think 1. and 3. would be very useful, but not sure if we should document 2.

I agree that we should specify this. It's an important detail for cases like #13706 and the i flag example you described in eslint/archive-website#791 (comment).

Would appreciate more opinions on this. Specifying these details might disallow further optimizations, like the one we made in #8035. On the other hand, rule developers should be aware of how this works when writing tests with overlapping ranges.

  • Q: Can the (rule) developer affect which one of the conflicting fixes is applied?
    A: No.

Make sense to document this.

@mdjermanovic
Copy link
Member

Maybe I misunderstood the proposal for 2.. Does it include details on which of the conflicting fixes will be chosen?

@RunDevelopment
Copy link
Author

Does it include details on which of the conflicting fixes will be chosen?

Yes. If two of my rules produce fixes that conflict, then I'd like to know which one is applied.

I know that right now it's going to be the left-most fix after being sorted by this function but that very specific implementation detail probably shouldn't make it into the public doc. Explicitly stating that it's undefined behaviour in that context should suffice.

@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Oct 30, 2020
@eslint-deprecated
Copy link

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@mdjermanovic mdjermanovic removed the auto closed The bot closed this issue label Nov 2, 2020
@mdjermanovic mdjermanovic self-assigned this Nov 2, 2020
@mdjermanovic
Copy link
Member

Reopening, as it seems useful to clarify this in the docs.

@mdjermanovic mdjermanovic reopened this Nov 2, 2020
@arminyahya
Copy link
Contributor

About 2. can we add a few details about how it works?

@mdebruijne

@Gautam-Arora24
Copy link
Contributor

Hi! Are we still interested to solve this issue?

@mdjermanovic mdjermanovic added this to Needs Triage in Triage via automation Dec 1, 2021
@mdjermanovic mdjermanovic moved this from Needs Triage to Feedback Needed in Triage Dec 1, 2021
@btmills
Copy link
Member

btmills commented Dec 29, 2021

The additional changes as currently described sound reasonable to me. Like others, I'd prefer to leave 2 as undefined behavior to avoid committing ourselves to a particular implementation.

bpmutter added a commit to bpmutter/eslint that referenced this issue Sep 30, 2022
Provide additional documentation on conflicting fixes.

Fixes eslint#13721
@snitin315 snitin315 added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 30, 2022
@snitin315 snitin315 moved this from Feedback Needed to Pull Request Opened in Triage Sep 30, 2022
@snitin315
Copy link
Contributor

Marked as accepted since we have 3 👍🏻

Triage automation moved this from Pull Request Opened to Complete Oct 4, 2022
nzakas added a commit that referenced this issue Oct 4, 2022
* docs: Conflicting fixes

Provide additional documentation on conflicting fixes.

Fixes #13721

* Update docs/src/developer-guide/working-with-rules.md

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Apr 3, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features documentation Relates to ESLint's documentation
Projects
Archived in project
Triage
Complete
Development

Successfully merging a pull request may close this issue.

6 participants