blob: f0c3cdc01524b8deb79ec4966123d023dce7ad23 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# Web Examples
Think of these as **highly-recommended** recommendations for web projects at Driver
## Every Web Project
1. [Setup your IDE](http://editorconfig.org/) to respect a `.editorconfig` file.
2. Download the `.editorconfig` to your project root.
```sh
$ wget https://raw.githubusercontent.com/drivergroup/best-practices/master/web-examples/.editorconfig
```
### JS-Specific
1. Install eslint
```sh
$ npm install --save-dev eslint
```
2. Add a `.eslintrc` to the project root
3. Configure `"lint"` script in `package.json` to lint js files
```json
"scripts": {
"lint": "eslint ."
}
```
Ensure tests pass before every Pull Request
### TypeScript-Specific
1. Install tslint
```sh
$ npm install --save-dev tslint
```
2. Add a `tsconfig.json` to the project root
3. Configure `"lint"` script in `package.json`
```json
"scripts": {
"lint": "tslint --project . --type-check"
}
```
<!-- TODO: 4. Add the Driver [tsconfig.json](link here) -->
Ensure tests pass before every Pull Request
|