From 5d3d2fd3072367a6035873491d71bfdf66464c89 Mon Sep 17 00:00:00 2001 From: Nelson Omuto Date: Fri, 3 Oct 2014 16:13:48 -0400 Subject: [PATCH] fixing jshint issues, modifying to allow for some not too strict jshint rules, adding grunt newer dependency. --- .jshintrc | 2 -- Gruntfile.js | 23 +++++++-------- _SpecRunner.html | 43 ---------------------------- package.json | 1 + scripts/ripples.js | 6 ++-- template/material/scripts/ripples.js | 6 ++-- test/.jshintrc | 5 +++- 7 files changed, 24 insertions(+), 62 deletions(-) delete mode 100644 _SpecRunner.html diff --git a/.jshintrc b/.jshintrc index ed5c1950..38690ee1 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,5 @@ { "bitwise": true, - "camelcase": true, "curly": true, "eqeqeq": false, "es3": false, @@ -15,7 +14,6 @@ "nonbsp": true, "nonew": true, "plusplus": false, - "quotmark": "double", "undef": true, "unused": true, "strict": false, diff --git a/Gruntfile.js b/Gruntfile.js index 1db1750f..ce4edc29 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -80,21 +80,21 @@ module.exports = function(grunt) { test: { options: { port: 8041, - open: 'http://localhost:8041/_SpecRunner.html', + open: "http://localhost:8041/_SpecRunner.html", base: "." } } }, jasmine: { - scripts: 'scripts/**/*.js', + scripts: "scripts/**/*.js", options: { build: true, - specs: 'test/*Spec.js', - helpers: 'test/*Helper.js', + specs: "test/*Spec.js", + helpers: "test/*Helper.js", vendor: [ - 'https://code.jquery.com/jquery-1.10.2.min.js', - 'https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js' + "https://code.jquery.com/jquery-1.10.2.min.js", + "https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" ] } }, @@ -107,8 +107,7 @@ module.exports = function(grunt) { all: [ "Gruntfile.js", "scripts/**/*.js", - "template/**/*.js", - "test/**/*.js" + "template/**/*.js" ], test: { options: { @@ -132,9 +131,9 @@ module.exports = function(grunt) { livereload: "<%= connect.options.livereload %>" }, files: [ - 'index.html', - 'css-compiled/**/*.css', - '**/*.{png,jpg,jpeg,gif,webp,svg}' + "index.html", + "css-compiled/**/*.css", + "**/*.{png,jpg,jpeg,gif,webp,svg}" ] } } @@ -168,6 +167,6 @@ module.exports = function(grunt) { "build:"+ buildTarget, "connect:livereload", "watch" - ]) + ]); }); }; diff --git a/_SpecRunner.html b/_SpecRunner.html deleted file mode 100644 index fd7e0764..00000000 --- a/_SpecRunner.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Jasmine Spec Runner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/package.json b/package.json index f5f6cd74..8dbccb3c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "grunt-contrib-less": "^0.11.4", "grunt-contrib-sass": "^0.8.1", "grunt-contrib-watch": "^0.6.1", + "grunt-newer": "^0.7.0", "jshint-stylish": "^1.0.0", "load-grunt-tasks": "^0.6.0" } diff --git a/scripts/ripples.js b/scripts/ripples.js index 052c8295..15c901ba 100644 --- a/scripts/ripples.js +++ b/scripts/ripples.js @@ -1,13 +1,15 @@ /* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */ /* globals CustomEvent */ -var ripples = { +window.ripples = { init : function(withRipple) { "use strict"; // Cross browser matches function function matchesSelector(dom_element, selector) { - var matches = dom_element.matches || dom_element.matchesSelector || dom_element.webkitMatchesSelector || dom_element.mozMatchesSelector || dom_element.msMatchesSelector || dom_element.oMatchesSelector; + var matches = dom_element.matches || dom_element.matchesSelector || dom_element.webkitMatchesSelector || + dom_element.mozMatchesSelector || + dom_element.msMatchesSelector || dom_element.oMatchesSelector; return matches.call(dom_element, selector); } diff --git a/template/material/scripts/ripples.js b/template/material/scripts/ripples.js index 052c8295..15c901ba 100644 --- a/template/material/scripts/ripples.js +++ b/template/material/scripts/ripples.js @@ -1,13 +1,15 @@ /* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */ /* globals CustomEvent */ -var ripples = { +window.ripples = { init : function(withRipple) { "use strict"; // Cross browser matches function function matchesSelector(dom_element, selector) { - var matches = dom_element.matches || dom_element.matchesSelector || dom_element.webkitMatchesSelector || dom_element.mozMatchesSelector || dom_element.msMatchesSelector || dom_element.oMatchesSelector; + var matches = dom_element.matches || dom_element.matchesSelector || dom_element.webkitMatchesSelector || + dom_element.mozMatchesSelector || + dom_element.msMatchesSelector || dom_element.oMatchesSelector; return matches.call(dom_element, selector); } diff --git a/test/.jshintrc b/test/.jshintrc index ed5c1950..1453208f 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -39,6 +39,9 @@ "brackets": true, "define": true, "Mustache": true, - "window": true + "window": true, + "expect": true, + "describe": true, + "it": true } }