diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..5075bc4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,12 @@ +extends: eslint:recommended + +env: + node: true + es6: true + browser: true + +rules: + comma-dangle: off + no-console: off + no-unused-vars: [error, { vars: all, args: none }] + diff --git a/.gitignore b/.gitignore index a56a7ef..dc4fe6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules +npm-shrinkwrap.json +npm-shrinkwrap.json diff --git a/index.js b/index.js index b463ca9..3980be3 100755 --- a/index.js +++ b/index.js @@ -7,10 +7,8 @@ var chalk = require("chalk"); var program = require("commander"); -var request = require("request"); var rp = require("request-promise"); var delay = require("timeout-as-promise"); -var merge = require("merge"); var sprintf=require("sprintf-js").sprintf; var util = require("util"); @@ -307,7 +305,7 @@ function formatAnswer(reportData, url, scan, options) { // rescore var newScore = 100; - for (var k in scores) { + for (k in scores) { newScore += scores[k].score_modifier; } @@ -362,7 +360,7 @@ class Observatory { logger.info("go client: ", f.link("https://github.com/mozilla/tls-observatory")) logger.info("comment: %s", f.link("https://github.com/mozilla/observatory-cli/issues/5")) return - }; + } // require site for everything else logger.error(f.error("no given")); @@ -372,8 +370,6 @@ class Observatory { let O = new Observatory(); -var program = require("commander"); - program .version(require("./package.json").version) .description(util.format("cli for interacting with Mozilla HTTP Observatory \n\n %s", f.link(SITE_URL))) diff --git a/package.json b/package.json index b5271d2..c7d5f91 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "observatory-cli", "description": "Command line client for Mozilla HTTP observatory service", - "version": "0.5.1", + "version": "0.5.2", "author": "Gregg Lind ", "bin": { "observatory": "./index.js" @@ -13,15 +13,15 @@ "chalk": "^1.1.3", "clim": "^1.1.1", "commander": "^2.9.0", - "merge": "^1.2.0", "request": "^2.74.0", "request-promise": "^4.1.1", "sprintf-js": "^1.0.3", "timeout-as-promise": "^1.0.0" }, "devDependencies": { - "chai": "^3.5.0", - "mocha": "^3.0.2" + "depcheck": "^0.6.4", + "eslint": "^3.5.0", + "fixpack": "^2.3.1" }, "homepage": "https://github.com/mozilla/observatory-cli#readme", "keywords": [ @@ -36,6 +36,7 @@ "url": "git+https://github.com/mozilla/observatory-cli.git" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "prepublish": "npm shrinkwrap", + "test": "eslint '**.js' && depcheck && fixpack && echo OK" } }