Skip to content

Commit 2254457

Browse files
author
Brylie Christopher Oxley
committed
Add Philosophy and Pragmatics sections
1 parent c7a2531 commit 2254457

File tree

1 file changed

+37
-7
lines changed
  • content/contributing-code/javascript-guidelines

1 file changed

+37
-7
lines changed

content/contributing-code/javascript-guidelines/contents.lr

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,51 @@ _template: page-with-toc.html
44
---
55
title: JavaScript Guidelines
66
---
7-
description: These JavaScript Guidelines (style guide) help the community to
7+
description:
8+
9+
These JavaScript Guidelines (style guide) help the community to
810
focus on the intent of the code and work together with a minimum of friction.
911
---
1012
body:
1113

12-
## Need of Guidelines
14+
## Purpose
1315

1416
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
1733

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.
1935

20-
### Overview
36+
## Pragmatics
2137

22-
All JavaScript code must be formatted using [Prettier][Prettier], *an opinionated code formatter*.
38+
### Code formatting
2339

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/
2443
[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.
52+
53+
[Vue]: https://vuejs.org/
54+

0 commit comments

Comments
 (0)