From 9f3d80fde123efae731db4deb75113eb9e0ac2e0 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Wed, 3 Sep 2014 12:22:47 -0700 Subject: [PATCH] resolving conflicts --- .eslintignore | 1 + .travis.yml | 2 +- Gruntfile.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ Makefile | 5 +++-- loop/fxa.js | 2 -- package.json | 42 +++++++++++++++++++++++++----------------- 6 files changed, 75 insertions(+), 22 deletions(-) create mode 100644 .eslintignore create mode 100644 Gruntfile.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..a860310 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules/** diff --git a/.travis.yml b/.travis.yml index 92378e5..7a655c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ services: redis-server before_install: - "sudo apt-get install python-virtualenv" + - npm i grunt-cli -g script: make travis after_script: - - npm install nsp -g - npm run outdated - npm run audit-shrinkwrap diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..71a3be0 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,45 @@ +module.exports = function (grunt) { + "use strict"; + + require("load-grunt-tasks")(grunt); + + grunt.initConfig({ + "APP": { + "CODE_DIRS": "{,config/**/,loop/**/,test/**/}", + "COPYRIGHT": "This Source Code Form is subject to the terms of the Mozilla Public" + }, + "pkg": require("./package.json"), + + "copyright": { + "options": { + "pattern": "<%= APP.COPYRIGHT %>" + }, + "src": "<%= eslint.src %>" + }, + + "eslint": { + "src": "<%= APP.CODE_DIRS %>*.js" + }, + + "jsonlint": { + "src": "<%= APP.CODE_DIRS %>*.json" + }, + + "shell": { + "shrinkwrap": { + "command": "npm shrinkwrap --dev" + } + }, + + "todo": { + "src": "<%= eslint.src %>" + }, + + "validate-shrinkwrap": { + } + }); + + grunt.registerTask("lint", ["eslint", "jsonlint"]); + grunt.registerTask("audit-shrinkwrap", ["shell:shrinkwrap", "validate-shrinkwrap"]); + grunt.registerTask("default", ["lint", "copyright"]); +}; diff --git a/Makefile b/Makefile index 9275bf1..b0f15a8 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ install: @npm install .PHONY: lint -lint: eslint +lint: + @grunt lint clean: rm -rf .venv node_modules coverage lib-cov html-report @@ -32,7 +33,7 @@ cover-mocha: .PHONY: eslint eslint: - @$(NODE_LOCAL_BIN)/eslint test/*.js loop/*.js loop/*/*.js + @grunt eslint .PHONY: mocha mocha: diff --git a/loop/fxa.js b/loop/fxa.js index 39e6603..17e35d5 100644 --- a/loop/fxa.js +++ b/loop/fxa.js @@ -7,9 +7,7 @@ var https = require('https'); var request = require('request'); var conf = require('./config').conf; -/*eslint-disable */ var atob = require('atob'); -/* eslint-enable */ var sendError = require("./utils").sendError; var errors = require("./errno.json"); diff --git a/package.json b/package.json index e3437da..4f2cdaf 100644 --- a/package.json +++ b/package.json @@ -14,44 +14,52 @@ "npm": "1.3.x" }, "dependencies": { + "async": "0.9.0", + "atob": "1.1.2", "body-parser": "1.6.5", "connect-validation": "0.2.0", "convict": "0.4.2", "cors": "2.4.1", + "eslint": "0.7.x", "express": "4.x", - "strftime": "0.8.1", + "express-hawkauth": "0.3.0", + "hiredis": "0.1.17", "opentok": "2.2.4", + "phone": "git://github.com/Natim/node-phone.git#83a4f48", "raven": "0.7.0", - "request": "2.40.0", - "urlsafe-base64": "0.0.2", - "hiredis": "0.1.17", "redis": "0.11.0", - "statsd-node": "0.2.3", - "async": "0.9.0", - "ws": "0.4.31", + "request": "2.40.0", "sodium": "1.0.11", - "atob": "1.1.2", - "express-hawkauth": "0.3.0", - "eslint": "0.7.x", + "statsd-node": "0.2.3", + "strftime": "0.8.1", + "urlsafe-base64": "0.0.2", "winston": "0.7.3", - "yargs": "1.3.1", - "phone": "git://github.com/Natim/node-phone.git#83a4f48" + "ws": "0.4.31", + "yargs": "1.3.1" }, "devDependencies": { "chai": "1.9.x", + "grunt": "0.4.5", + "grunt-copyright": "0.1.0", + "grunt-eslint": "1.0.0", + "grunt-jsonlint": "1.0.4", + "grunt-nsp-shrinkwrap": "0.0.3", + "grunt-shell": "1.0.1", + "grunt-todo": "0.4.0", "istanbul": "*", - "jshint": "2.x", + "load-grunt-tasks": "0.6.0", "mocha": "1.20.x", "sinon": "1.10.3", - "supertest": "0.13.0", - "superagent-hawk": "0.0.4" + "superagent-hawk": "0.0.4", + "supertest": "0.13.0" }, "scripts": { "test": "make test", "start": "make runserver", - "eslint": "make lint", + "lint": "make lint", "outdated": "npm outdated --depth 0", - "audit-shrinkwrap": "npm shrinkwrap --dev && nsp audit-shrinkwrap || true" + "audit-shrinkwrap": "grunt audit-shrinkwrap --force", + "jsdoc-lint": "eslint loop --rule 'valid-jsdoc: [1, {requireReturn: false, requireParamDescription: false}]'" }, "license": "MPL-2.0", "keywords": []