jamesallardice/jslint-error-explanations

Have alias slugs for actual option

Closed this issue · 5 comments

would be nice to link to jslinterrors.com/asi rather than jaslinterrors.com/missing-semicolon-error

This would be nice but I have a couple of concerns...

  • What happens for options that relate to multiple messages (a good example is the es5 JSLint option)?
  • GitHub pages doesn't run Jekyll plugins, so there's no nice way to create redirects for aliased URLs

Having said that, this is definitely something I'm happy to add, but some community input to find the best solution would be useful. Ideas appreciated.

The best I can think of at the moment is to manually create any alias pages and have them redirect with a meta refresh:

<meta http-equiv="refresh" content="0; url=http://jslinterrors.com/missing-semicolon-error">

This is not ideal, but I'm not sure if there's another way. There are Jekyll plugins that allow you to simply add aliases to the front matter of any post, and it will generate redirection pages for you. But as I mentioned, GitHub pages doesn't run the plugins.

Yeah I was going to submit a pull request but since I'm not too familiar with Jekyll I wasn't sure if there was a better way than a meta refresh which would add a lot of noise to posts

Is moving off of Jekyll an option? Seems like the effort may not be worth it.

For the umbrella options they can direct to a page which has links to the related messages.

And also, not only would options be nice but jshint error codes as well.

See #17, which I created soon after responding to this issue... I think moving away from GitHub pages is starting to become necessary.

There's been some work by various people to integrate explanations from the site into IDE JS[LH]int plugins. I'd really like to expose an API that makes this easier, and that's not going to be at all possible on GitHub pages.

It's going to be a lot of work though. I may set up a Bountysource fundraiser to see if there is much interest from the IDE people.

Good point about the JSHint error codes too, that would be another nice addition.

Providing a JS API which you call getExplanationFor(error) and it returns either HTML, markdown, or plaintext, would be excellent.

Then the site can dogfood this API as well and all parties are satisfied. Building this out should be pretty easy, and for the site perhaps using AngularJS?