Permalink
Browse files

Tweak JSHint options.

  • Loading branch information...
1 parent 575031d commit 2701b88af0d47d46a7bf3fda8f38771acd864b69 @XhmikosR XhmikosR committed Mar 3, 2015
View
@@ -2,6 +2,7 @@
"camelcase": true,
"curly": true,
"eqeqeq": true,
+ "es3": true,
"forin": true,
"immed": true,
"indent": 4,
@@ -15,7 +16,6 @@
"undef": true,
"unused": true,
"globals": {
- "CSSLint": true,
- "YUITest": true
+ "CSSLint": true
}
-}
+}
View
@@ -166,6 +166,9 @@ module.exports = function(grunt) {
src: "demos/*.js"
},
tests: {
+ options: {
+ jshintrc: "tests/.jshintrc"
+ },
src: "tests/**/*.js"
}
},
View
@@ -3,6 +3,7 @@
* provides environment-specific functionality.
*/
+/* global JSON */
/* exported cli */
function cli(api){
@@ -1,7 +1,9 @@
/*
* Web worker for CSSLint
*/
-/*global self, JSON*/
+
+/* global self, JSON */
+
//message indicates to start linting
self.onmessage = function(event){
"use strict";
View
@@ -1,6 +1,7 @@
/* jshint node:true */
+"use strict";
+
module.exports = function( grunt ) {
- "use strict";
grunt.registerMultiTask("changelog", "Write the changelog file", function() {
var done = this.async();
var lastTag;
View
@@ -1,6 +1,7 @@
/* jshint node:true */
+"use strict";
+
module.exports = function( grunt ) {
- "use strict";
// Run test suite through rhino
grunt.registerMultiTask("test_rhino", "Run the test suite through rhino", function() {
var done = this.async();
View
@@ -1,6 +1,7 @@
/* jshint evil:true, node:true */
+"use strict";
+
module.exports = function( grunt ) {
- "use strict";
grunt.registerMultiTask("yuitest", "Run the YUITests for the project", function() {
var YUITest = require("yuitest");
View
@@ -0,0 +1,6 @@
+{
+ "extends" : "../.jshintrc",
+ "globals": {
+ "YUITest": true
+ }
+}
View
@@ -8,14 +8,14 @@
* to fail due to Java stack overflow. This must be run separate from other tests.
*/
-/*jshint loopfunc: true */
+/* jshint loopfunc:true */
(function(){
"use strict";
var Assert = YUITest.Assert,
- suite = new YUITest.TestSuite("General Tests for all Rules"),
- rules = CSSLint.getRules(),
- len = rules.length,
+ suite = new YUITest.TestSuite("General Tests for all Rules"),
+ rules = CSSLint.getRules(),
+ len = rules.length,
i;
for (i=0; i < len; i++){
@@ -65,3 +65,4 @@
YUITest.TestRunner.add(suite);
})();
+
@@ -1,58 +1,54 @@
-/*jshint node:true*/
+/* jshint node:true */
"use strict";
-var
- stub = {
- logbook: function (log) {
- this.logs.push(log);
- },
- readLogs: function () {
- return this.logs.slice();
- },
- getFullPath: function (path) {
- return path;
- },
- getFiles: function (dir) {
- var
- filesobj = this.fakedFs[dir],
- fileix,
- out = [];
- for (fileix in filesobj) {
- if ( filesobj.hasOwnProperty(fileix) && /\.css$/.test(fileix) ) {
- out.push(dir + "/" + fileix);
- }
- }
- return out;
- },
- readFile: function (path) {
- var
- spath = path.split("/"),
- spathLen = spath.length,
- i,
- out = this.fakedFs;
+var stub = {
+ logbook: function (log) {
+ this.logs.push(log);
+ },
+ readLogs: function () {
+ return this.logs.slice();
+ },
- for (i = 0; i < spathLen; i += 1) {
- out = out[spath[i]];
+ getFullPath: function (path) {
+ return path;
+ },
+ getFiles: function (dir) {
+ var filesobj = this.fakedFs[dir],
+ fileix,
+ out = [];
+ for (fileix in filesobj) {
+ if (filesobj.hasOwnProperty(fileix) && /\.css$/.test(fileix)) {
+ out.push(dir + "/" + fileix);
}
+ }
+ return out;
+ },
+ readFile: function (path) {
+ var spath = path.split("/"),
+ spathLen = spath.length,
+ i,
+ out = this.fakedFs;
- return out;
- },
- isDirectory: function (checkit) {
- var
- result = this.fakedFs[checkit];
- return typeof result === "object";
- },
- print: function (msg) {
- this.logbook(msg);
- },
- quit: function (signal) {
- this.logbook(signal);
+ for (i = 0; i < spathLen; i += 1) {
+ out = out[spath[i]];
}
- };
+
+ return out;
+ },
+ isDirectory: function (checkit) {
+ var result = this.fakedFs[checkit];
+ return typeof result === "object";
+ },
+ print: function (msg) {
+ this.logbook(msg);
+ },
+ quit: function (signal) {
+ this.logbook(signal);
+ }
+};
module.exports = function (setup) {
- var
- api,
+ var api,
setix;
api = Object.create(stub);
@@ -1,4 +1,5 @@
-/*jshint node:true*/
+/* jshint node:true */
+
module.exports = {
"suites": {
"config csslintrc override": {
@@ -53,6 +54,6 @@ module.exports = {
"dir": {
"a.css": ".a {color: red!important;}",
"b.css": "#a {color: red;}"
- },
+ }
}
};
@@ -1,8 +1,8 @@
-/*jshint loopfunc:true, node:true */
+/* jshint loopfunc:true, node:true */
+
"use strict";
function include(path, sandbox) {
- var
- vm = require("vm"),
+ var vm = require("vm"),
fs = require("fs"),
file;
@@ -11,14 +11,13 @@ function include(path, sandbox) {
}
+(function() {
-(function(){
-
- var Assert = YUITest.Assert,
+ var Assert = YUITest.Assert,
suite = new YUITest.TestSuite("General Tests for CLI"),
apiStub = require("../tests/cli/assets/apiStub.js"),
- data = require("../tests/cli/assets/data.js"),
- suites = data.suites,
+ data = require("../tests/cli/assets/data.js"),
+ suites = data.suites,
suiteix,
sandbox = {
CSSLint: CSSLint
@@ -35,8 +34,7 @@ function include(path, sandbox) {
name: "Test " + suiteix,
"Outcome logs should match expected": function (){
- var
- it = suites[suiteix],
+ var it = suites[suiteix],
expecting = it.expecting,
expectingLen = expecting.length,
outcome,

0 comments on commit 2701b88

Please sign in to comment.