aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawson Botsford <DawsonBotsford@gmail.com>2017-09-22 14:30:45 -0700
committerDawson Botsford <DawsonBotsford@gmail.com>2017-09-22 14:30:45 -0700
commit965dd8bc2f8608dd61f0772f75fa014ffc7c8abb (patch)
tree994baf2313f698fcc3bd8862b9b7fe1c3d745b4d
parentd44e65eace24a28f47706b8f203b8ce44d622f74 (diff)
downloadbest-practices-965dd8bc2f8608dd61f0772f75fa014ffc7c8abb.tar.gz
best-practices-965dd8bc2f8608dd61f0772f75fa014ffc7c8abb.tar.bz2
best-practices-965dd8bc2f8608dd61f0772f75fa014ffc7c8abb.zip
add editorconfig and linting commands
-rw-r--r--web-examples/.editorconfig14
-rw-r--r--web-examples/readme.md47
2 files changed, 61 insertions, 0 deletions
diff --git a/web-examples/.editorconfig b/web-examples/.editorconfig
new file mode 100644
index 0000000..6706680
--- /dev/null
+++ b/web-examples/.editorconfig
@@ -0,0 +1,14 @@
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+
+# Matches multiple files with brace expansion notation
+# Set default charset
+[*]
+charset = utf-8
+indent_style = spaces
+indent_size = 2
+trim_trailing_whitespace = true
diff --git a/web-examples/readme.md b/web-examples/readme.md
new file mode 100644
index 0000000..f0c3cdc
--- /dev/null
+++ b/web-examples/readme.md
@@ -0,0 +1,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