duhaime / eslint-plugin-frontmatter

Remove YAML frontmatter from `.js` files before calling ESLint
MIT License
0 stars 3 forks source link

Postprocessor will output incorrect line numbers #5

Closed platinumazure closed 6 years ago

platinumazure commented 6 years ago

Basically, depending on how many lines of front matter end up being removed, the line numbers for ESLint's messages will be off by that many lines.

Example:

---
frontMatter: true
---
// N.B. 3 lines of front matter
/* eslint no-undef: error */

foo;   // Actually line 7 in the file. Will report as line 4 (maybe 5 if newline after frontmatter preserved)

I'm happy to write a PR to fix this, but I would do so based on the branch in #3, so I'm going to wait for that to be merged first.

duhaime commented 6 years ago

@platinumazure If you'd want to follow up with another PR, that would be great! If not I may be able to tackle this Sunday...

platinumazure commented 6 years ago

Apologies for the delay- I've been really busy the last week or two. I do still intend to get to this, hopefully this week.