From 58afbe618bc2d7a5eef80b02e3b04c2f9b0518d6 Mon Sep 17 00:00:00 2001 From: MrDwina Date: Mon, 18 Sep 2017 19:51:03 +0100 Subject: [PATCH 1/2] I added eslint to show syntax error I update the setting to use double qutez and simy colne and tabe instate of space also you can use es6 syntax --- .eslintrc.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..f406394 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,29 @@ +module.exports = { + "env": { + "browser": true, + "commonjs": true, + "es6": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "indent": [ + "error", + "tab" + ], + "linebreak-style": [ + "error", + "windows" + ], + "quotes": [ + "error", + "double" + ], + "semi": [ + "error", + "always" + ] + } +}; \ No newline at end of file From adb523fced7926e96a362711c8b00944ed3b14fa Mon Sep 17 00:00:00 2001 From: MrDwina Date: Sat, 23 Sep 2017 11:15:02 +0100 Subject: [PATCH 2/2] I add eslint to npm script to run all our app and check if there is any error to use that just write npm rnu eslint on terminal --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7db8d46..f3b8786 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "private": true, "scripts": { "start": "node ./bin/www", - "dev": "nodemon --inspect ./bin/www" + "dev": "nodemon --inspect ./bin/www", + "eslint": "eslint ./bin/www" }, "dependencies": { "body-parser": "~1.17.1",