-
Notifications
You must be signed in to change notification settings - Fork 22
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
JavaScript style guide draft #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love that we are getting a document home for this.
|
||
Since then, npm has improved a lot and nowadays there isn't really any reason to use yarn over npm. | ||
|
||
[Why Are You Still Using Yarn in 2018?](https://iamturns.com/yarn-vs-npm-2018/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One feature in yarn
that I use is resolutions
, and I don't know of a way to control that in npm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never used it myself!
I guess if we have a situation where we need to use that feature we could switch to yarn for that project. After all, this is just a guideline. But I feel like it's better to use npm which comes with most nodejs-installs instead of using a third-party package manager that does 99% of the same things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Olle Jonsson <olle.jonsson@auctionet.com>
Co-authored-by: Olle Jonsson <olle.jonsson@auctionet.com>
We should link to this file from styleguide/README.md under the JavaScript section (and remove its "Prefer CoffeeScript" stuff). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the starting-off point for a living document this seems fine to me – it's quite far from where we are today (with a lot of CoffeeScript and jQuery) but I like that it's aspirational, and we can always tweak it as we go.
It would be good if we could edit/remove those old CoffeeScripty parts of the styleguide though so we don't have two mutually exclusive recommendations living side by side :)
styleguide/javascript/README.md
Outdated
|
||
#### Dependencies | ||
|
||
In the npm repository, you can find packages for almost anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phrasing of this section reads a bit weird to me – I feel like a more prescriptive style makes sense in a styleguide – more like "Avoid adding npm dependencies for simple things [reasons and examples given here]".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point :)
|
||
## React | ||
|
||
The other guide is written for CoffeeScript so here's one for JavaScript. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove the other guide?
Co-authored-by: Henrik Nyh <henrik@nyh.se>
Co-authored-by: Henrik Nyh <henrik@nyh.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This reverts commit bf882c5. We are interested in the JS styleguide. Re-opening the PR.
No description provided.