Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why? #1

Open
nelsonic opened this issue May 19, 2016 · 6 comments
Open

Why? #1

nelsonic opened this issue May 19, 2016 · 6 comments

Comments

@nelsonic
Copy link
Member

No Code Style or Linter I have looked at is "perfect".
If I were to pick one it would be JSLint but its just not "fun" to use. (we have tried ... you end up having to include way too much config/comment per file)

"Standard" makes many assumptions and is opinionated without _Empirical Evidence_
(though I take my hat off to Feross for calling his style guide "_Standard_", of course he did not _invent_ *calling something "standard" in order to achieve the perception of quality... Standard Oil, Standard Life, Standard Motor Company... the list is endless ... and its been good marketing both for him and his other projects.)

Another option could be AirBnB JavaScript Style Guide but again, it's packet with opinion and light on "why".

So, instead of going on the opinions of the crowd, I propose that we leverage the experience of the person who knows more about JavaScript and crucially has more large scale production experience than anyone else.

javascript-the-good-parts-amazon-raking

@ryanpcmcquen
Copy link

This project will always be running to catch up with jslint, it seems unnecessary to me ... if you want to follow Crockford style, why not just use his linter?

@nelsonic
Copy link
Member Author

nelsonic commented Sep 21, 2016

@ryanpcmcquen really good question! ❓
Last time we investigated using jslint we looked at: https://github.com/douglascrockford/JSLint
but I suspect you may be referring to: https://github.com/reid/node-jslint which looks way more user-friendly at least on the surface...

Review of the issues on GitHub https://github.com/reid/node-jslint/issues indicates that issues are not resolved particularly quickly. I guess we could help remedy that by submitting PRs to fix issues ... however its unclear those PRs would be merged/accepted as a quick glance at https://github.com/reid/node-jslint/pulls (old/stale PRs) suggests there isn't a clear process for contributing to the project ...

Reading through the issues we note that linter warnings are non-sequential; that would drive me nuts: reid/node-jslint#128 (looks like they are going to fix it in the "next re-write"... but when is that...?)

I'm approaching this mini-investigation from a "will this save us a ton of effort" perspective, and I think further investigation is still required, but on the surface I'm going to have to disagree that we would be "running to catch up with jslint" for the simple reason that we intend to make linter a lot more user-focussed/friendly than jslint is and it will serve our purposes of writing code that Works Everywhere all-the-time

A re-read of http://jslint.com/help.html >> ECMAScript Sixth Edition suggests that the ES6 features jslint "recognises" are universally available/supported in all JS environments; they aren't.
Without "transpiling" most of ES6 is only available in "Modern Web Browsers" (Chrome/Firefox/Edge) ... which sadly are not yet used by 100% of people ...
So we either have to use babel in our projects (or some other "transpiler") or we have to have linter that knows when the code is going to be run in a browser in which case most of ES6 needs to be disallowed...

If you don't mind me asking, what is your preferred method for linting your JS projects? 😊

@jrans
Copy link
Member

jrans commented Sep 21, 2016

Ok #190 opened with a proposed solution to cover this formed.

@ryanpcmcquen
Copy link

Well, I used standard JSLint for quite a while. There's a great Atom plugin that follows upstream closely:

https://atom.io/packages/linter-jslint

I would put this at the top of files:

/*global window*/
/*jslint browser:true, white:true*/

These days I only use Flow, since most linters do not support/endorse functional programming. Also, I kind of fell out of love with ESLint's creator when he advocated against the GPL here:
https://www.nczonline.net/blog/2015/12/why-im-not-using-your-open-source-project/

@nelsonic
Copy link
Member Author

@ryanpcmcquen thanks for sharing! its a shame that linters don't support FP. 😞
I hand't read NCZ's post on "not using your open source project" v. interesting read. 😕

@iteles
Copy link
Member

iteles commented Nov 3, 2016

A pretty good answer given in another repo that I wanted to make sure wasn't lost here: dwyl/learn-tdd#72

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

No branches or pull requests

4 participants