jamesallardice / jslint-error-explanations

:memo: Explanations of all the (sometimes cryptic) error messages thrown by JSLint and JSHint
http://linterrors.com
293 stars 35 forks source link

Have alias slugs for actual option #16

Closed goatslacker closed 10 years ago

goatslacker commented 11 years ago

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

jamesallardice commented 11 years ago

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

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.

jamesallardice commented 11 years ago

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.

goatslacker commented 11 years ago

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.

jamesallardice commented 11 years ago

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.

goatslacker commented 11 years ago

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?