gillesruppert/webmake-middleware

Publish v0.1.1

Closed this issue · 6 comments

Hey @gillesruppert, I've done some updates:

  • Change error status code from 500 to 200. It actually has to be 200 to have script that exposes the error on client-side executed. Otherwise all the users sees is HTTP request error.
  • Improve logic that's responsible for error message on client-side. I took it to external module (so it' easier to mantain), and decided not to use document.write as it won't work if script is loaded after window onload.
  • I've added .dir-locals.el it's emacs configuration file which clarifies whitespace rules. I hope you don't mind (?)
  • I've added back .lint but fully preserved whitespace style as we agreed in last PR. Having this file, makes work with my editor much easier. I hope it's fine for you, when I release new version of XLint to npm, I'll explain how it can be used.

Let me know, if it's all ok, and if it's fine. I'll be grateful if we can have it published.

@medikoo I pushed this.

Regarding editor/tool specific config files: I'm not the biggest fan having those in the repo as when you have multiple people with different editors, it creates issues. However, since it's only us at the moment and you doing most of the work, I'm ok for now.
My main issue with XLint: it's not easy for somebody else to run. If you add the possibility to run it via make or as an npm script command would be great.

Anyway: all pushed to npm.

@gillesruppert great thanks!

I've added lint task to npm scripts, So after you'll do npm install you can run npm run lint to see lint status

Great. No issue at all anymore with it then (other than I use jshint 😄).
As with the whitespace file: we should possibly use EditorConfig as it's compatible with a bunch of editors: http://editorconfig.org/.

Have a look and let me know what you think.

After all I removed that file and added it to .gitignore :) I agree it's good not to keep those within repository.

Concerning JSHint, it's better in terms of configurability, but there are options which work better in JSLint, like unused var detection or whitepace rules which is totally broken in JSHint.

I personally look forward ESLint but it's a long way, as AST that esprima produces is not sufficient to mandate pure style rules. There's an idea of CST which aims to solve that, but it'll take a while until it can be used.

Re: emacs file: ok ;)
Re: jshint: I am not religious about it at all. I'm glad that you can easily execute it on the cli, which is the most important.
I think the unused var detection or whitespace rules are working again in JSHint as it shows them for me. 1 thing it does NOT show (which I hate) is mixed spaces and tabs in a file.

Anyway, you might have edge cases that it doesn't detect. As I said: I'm not religious about it as long as people use a linter :D