lloeki / matterfront

Mattermost frontend app for OS X, Windows and Linux
MIT License
152 stars 27 forks source link

Add config for JSHint. #26

Closed teetrinkers closed 8 years ago

teetrinkers commented 8 years ago

The config settings are up for discussion of course. For example, I noticed that in webview.js, $ is used. Is jquery included in Electron? If so, we should enable the jquery environment in .jshintrc to silence those warnings.

lloeki commented 8 years ago

I'm used to eslint. Any argument in favor of JSHint?

teetrinkers commented 8 years ago

Not really. JSHint is just what I use on my other projects. I haven't used eslint yet.

Would it be ok to add configs for both? I think in Atom there is no way to select the linter per project, so jshint runs on matterfront even if there is no .jshintrc.

LongLiveCHIEF commented 8 years ago

I'm used to eslint. Any argument in favor of JSHint? -@lloeki

I'm going to argue against it. I am currently integrating eslint, and prefer it to JShint. It's far better than JSHint in many ways, especially in a project that has multiple run/execution environments (such as an electron based application).

For example, I noticed that in webview.js, $ is used. Is jquery included in Electron?

I'm currently reviewing any deps in webview and moving them into the work being done for the CLI/build stuff. They'll be listed as dependencies in the package.json for the next minor update of the matterfront npm module.

I think that this should have been an issue and not a PR. There are no changes to package.json either that would reflect the inclusion and execution of either linter, which means the developer would have to depend on an editor to have a plugin to do that.

I prefer it to be set up explicitly, so that linting can be part of the build & test pipeline, (which is also an item in scope of my current branch)

LongLiveCHIEF commented 8 years ago

I think in Atom there is no way to select the linter per project, so jshint runs on matterfront even if there is no .jshintrc.

That's why I prefer things so critical to the build & test pipeline to not be dependent upon an editor. An authoring environment should be a personal choice of preference, and I'd prefer to avoid any assumptions or project dependencies that lock our contributors in to an environment they may not be comfortable with.