pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Reporter compatibility with ESLint's formatters #92

Open TimothyGu opened 8 years ago

TimothyGu commented 8 years ago

It would be cool to provide the same API as ESLint's formatters, so that we can reuse eslint's many formatters.

TimothyGu commented 8 years ago

Proof of concept in https://github.com/pugjs/pug-lint/tree/eslint-formatter. Not all tests pass yet, but changing those is trivial.

Of course, that branch is not for merging, since it completely breaks the compatibility; but the core commit is 7b3443e6567c67f2ae125da66c6f62b1e4f1b125.

$ node bin/pug-lint -r eslint-formatter-pretty --config t.json a.pug

  a.pug:1:1
  ×  1:1  ID literals must not be used  disallowIdLiterals

  1 error

$ node bin/pug-lint -r node_modules/eslint/lib/formatters/tap.js --config t.json a.pug
TAP version 13
1..1
not ok 1 - a.pug
  ---
  message: ID literals must not be used
  severity: error
  data:
    line: 1
    column: 1
    ruleId: disallowIdLiterals
  ...

image

umamialex commented 8 years ago

What's the timeline for that commit being merged in? (And I guess therefore v3?)

TimothyGu commented 8 years ago

This would have to go with v3, since it is an incompatible change.

umamialex commented 8 years ago

Right, is there an estimated timeline for v3?