From f443fef09104df8c31b9007c7355d00594f37177 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Sat, 9 Apr 2016 18:56:26 -0400 Subject: [PATCH 1/3] Contribution: Part III --- .github/CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..c9e817d5 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,33 @@ +Contribution Policy for MagicMirror² +==================================== + +Thanks for contributing to MagicMirror²! + +We hold our code to standard, and these standards are documented below. + +First, before you run the linters, you will need to install them all **and** install the development dependencies: + +```bash +(sudo) npm install -g jscs stylelint html-validator-cli +npm install +``` + +### JavaScript: Run JSCS and ESLint + +We use [JSCS](http://jscs.info) and [ESLint](http://eslint.org) on our JavaScript files. + +Our JSCS configuration is in our .jscsrc file, and we use [eslint-config-google](https://www.npmjs.com/package/eslint-config-google) in ESLint. + +To run ESLint, use `npm run eslint`. To run JSCS, use `npm run jscs`. + +### CSS: Run StyleLint + +We use [StyleLint](http://stylelint.io) to lint our CSS. Our configuration is in our .stylelintrc file. + +To run StyleLint, use `npm run stylelint`. + +### HTML: Run HTML Validator + +We use [NU Validator](https://validator.w3.org/nu) to validate our HTML. The configuration is in the command in the package.json file. + +To run HTML Validator, use `npm run htmlvalidator`. From 18a670ae298ec2b2c79bbdc5fa125df7840be4ff Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Sat, 9 Apr 2016 19:03:10 -0400 Subject: [PATCH 2/3] Contribution Policy Changes: Part I Add ESLint. --- package.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fb3f6325..5692eb37 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "A modular interface for smart mirrors.", "main": "js/electron.js", "scripts": { - "start": "electron js/electron.js" + "start": "electron js/electron.js", + "eslint": "eslint .", + "jscs": "jscs **/**/**/**/*.js" }, "repository": { "type": "git", @@ -26,7 +28,9 @@ "devDependencies": { "electron-prebuilt": "latest", "stylelint": "latest", - "stylelint-config-standard": "latest" + "stylelint-config-standard": "latest", + "eslint": "latest", + "eslint-config-google": "latest" }, "dependencies": { "express": "latest", @@ -38,5 +42,8 @@ "socket.io": "latest", "valid-url": "latest", "walk": "latest" + }, + "eslintConfig": { + "extends": "google" } } From 3fcc1632617f3644154e86cbf4a67445f60f0686 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Sat, 9 Apr 2016 19:08:07 -0400 Subject: [PATCH 3/3] Contribution Policy Changes: Part II --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5692eb37..46d89052 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "start": "electron js/electron.js", "eslint": "eslint .", - "jscs": "jscs **/**/**/**/*.js" + "jscs": "jscs **/**/**/**/*.js", + "stylelint": "stylelint css/main.css fonts/roboto.css", + "htmlvalidator": "html-validator --file=index.html" }, "repository": { "type": "git",