You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/contributing-code/javascript-guidelines/contents.lr
+37-7Lines changed: 37 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,21 +4,51 @@ _template: page-with-toc.html
4
4
---
5
5
title: JavaScript Guidelines
6
6
---
7
-
description: These JavaScript Guidelines (style guide) help the community to
7
+
description:
8
+
9
+
These JavaScript Guidelines (style guide) help the community to
8
10
focus on the intent of the code and work together with a minimum of friction.
9
11
---
10
12
body:
11
13
12
-
## Need of Guidelines
14
+
## Purpose
13
15
14
16
These JavaScript Guidelines help developers who are new to the
15
-
codebase and want to make any real-world contribution with
16
-
`org:creativecommons`.
17
+
community and want to make a contribution to
18
+
the Creative Commons open-source ecosystem.
19
+
20
+
## Philosophy
21
+
A few philosophical guidelines can stand in place of a thousand narrow rules.
22
+
23
+
### Stewardship - build for longevity and maturity
24
+
Choose an existing framework and set of tools and use them to make what matters to you. Avoiding creating a bespoke framework when a current framework would get you further down the road.
25
+
26
+
When choosing tools and technologies, keep an eye towards mature projects and standards built to last many years. Find projects that extend existing standards and ways of working.
27
+
28
+
### Focus - choose the right level of abstraction
29
+
30
+
When developing, it is easy to find ourselves in layers of technology that are not directly contributing to our goals. For example, spending inordinate time with build tool configurations or type definitions instead of building features and getting user feedback. Choose tools that get out of the way and transparently support your work, creating what matters.
31
+
32
+
### Maintainability - write clean and conventional code
17
33
18
-
## Code Formatting
34
+
Code is read more often than it is written. Code is written for humans, not machines. As such, we can do ourselves a favor by making our code as reader-friendly as possible. Follow [clean code guidelines](https://github.com/ryanmcdermott/clean-code-javascript) as well as established development patterns.
19
35
20
-
### Overview
36
+
##Pragmatics
21
37
22
-
All JavaScript code must be formatted using [Prettier][Prettier], *an opinionated code formatter*.
38
+
### Code formatting
23
39
40
+
We adopt existing code formatting standards. To this end, all JavaScript code must be formatted using [Prettier][Prettier], *an opinionated code formatter*. We also use [eslint][eslint] to handle cases that Prettier may overlook.
41
+
42
+
[eslint]: https://eslint.org/
24
43
[Prettier]: https://prettier.io/
44
+
45
+
### Development environment
46
+
47
+
We use `npm` to manage development dependencies. Each project should have a `package.json` with dependencies and scripts for running, linting, testing, and deploying the project (where possible).
48
+
49
+
### Development framework
50
+
51
+
We use [Vue.js][Vue] as our primary JavaScript development framework. Vue provides a ready-made toolkit that covers many development needs and extends on long-standing web development conventions.
0 commit comments