quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.55k stars 192 forks source link

feature idea: parse git merge conflicts #1156

Closed vegerot closed 11 months ago

vegerot commented 11 months ago

Consider code like

<<<<<<< head
      const a =7;
=======
      setTimeout();
>>>>>>> 6e82b52a555 (fix(platform): asdf)

With this code, quick-lint gets confused and is unable to lint the rest of the file. Instead, quick-lint could add diagnostics for

<<<<<<< head 
^ // error: merge conflict marker detected

. I could use my key bind for "jump to next diagnostic" to jump to merge conflicts and fix them. More importantly, quick-lint could continue linting the rest of the file. Of course, there would still be "issues" like

<<<<<<< head
      const a =7;
=======
      const a = 8
                ^ you couldn't get enough of a, so you had to make two, huh?
>>>>>>> 6e82b52a555 (fix(platform): asdf)

but arguably if you're trying to resolve a conflict these sorts of diagnostics would be helpful 🙂

vegerot commented 11 months ago

implementation idea: simply treat lines starting with <<<<<<<, =======, or >>>>>>> as comments. This wouldn't call out the locations of them as diagnostics but at least it'd let quick-lint understand the whole file.

strager commented 11 months ago

Duplicate of #404

vegerot commented 11 months ago

Duplicate of #404

I can't find that Issue