Skip to content
This repository was archived by the owner on Dec 7, 2017. It is now read-only.

Indicate severity of the error #3

Open
chrisjlebron opened this issue Jun 14, 2013 · 1 comment
Open

Indicate severity of the error #3

chrisjlebron opened this issue Jun 14, 2013 · 1 comment

Comments

@chrisjlebron
Copy link

Haven't dug too deep into this yet, but I noticed everything is logged via console.warn. Would be nice if it were slightly more opinionated, either through the inclusion of .info & .error as well, or style everything with %c & .log.

Gonna take a crack at this, so expect a pull request coming your way. 😏

Amazing tool, by the way. Thanks!

@philipwalton
Copy link
Owner

I originally toyed with the idea of having reporter.warn and reporter.error methods in the rule files but ultimately concluded that what I considered an error, you might only consider a warning (and vise-versa), so I opted not to set error priority in the rule files themselves.

The way HTML Inspector is today, you can basically achieve what you want by overriding the default onComplete function and warn via whatever method you see fit, though perhaps a more declarative way would be nicer.

CSSLint addresses this problem by passing either a 1 or a 2 to the initialization function, which in HTML Inspector's case would look something like this:

HTMLInspector.inspect(
  ["some-rule", 1],
  ["some-other-rule", 2]
)

But I'm not sure I like this as much as just overriding the onComplete function yourself (though I don't have strong feelings either way).

Anyway, if you have some other ideas, I'd love to hear them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants