forked from external-repos/pa11y-dashboard
Lint JavaScript
This commit is contained in:
10
Makefile
10
Makefile
@@ -1,12 +1,20 @@
|
||||
|
||||
# Group targets
|
||||
all: deps
|
||||
all: deps lint
|
||||
|
||||
# Install dependencies
|
||||
deps:
|
||||
@echo "Installing dependencies..."
|
||||
@npm install
|
||||
|
||||
# Lint JavaScript
|
||||
lint:
|
||||
@echo "Linting JavaScript..."
|
||||
@./node_modules/.bin/jshint \
|
||||
--config ./test/config/jshint.json \
|
||||
--exclude ./node_modules \
|
||||
*.js **/*.js
|
||||
|
||||
# Start the application
|
||||
start:
|
||||
@echo "Starting application..."
|
||||
|
2
app.js
2
app.js
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
var createClient = require('pa11y-webservice-client-node');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var express = require('express');
|
||||
@@ -57,6 +56,7 @@ function initApp (config, callback) {
|
||||
|
||||
// Error handling
|
||||
app.express.use(function (err, req, res, next) {
|
||||
/* jshint unused: false */
|
||||
app.emit('route-error', err);
|
||||
res.send('Error');
|
||||
});
|
||||
|
2
index.js
2
index.js
@@ -12,7 +12,7 @@ require('./app')(config, function (err, app) {
|
||||
|
||||
app.on('route-error', function (err) {
|
||||
if (err.code === 'ECONNREFUSED') {
|
||||
console.log(chalk.red('Error: could not connect to pa11y-webservice'))
|
||||
console.log(chalk.red('Error: could not connect to pa11y-webservice'));
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
"pa11y-webservice-client-node": "git+ssh://git@github.com:nature/pa11y-webservice-client-node.git#1.0.0-beta.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jshint": "~2.1",
|
||||
"supervisor": "~0.5"
|
||||
},
|
||||
"scripts": {
|
||||
|
65
test/config/jshint.json
Normal file
65
test/config/jshint.json
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"bitwise": true,
|
||||
"camelcase": false,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"es3": false,
|
||||
"forin": true,
|
||||
"immed": true,
|
||||
"indent": 4,
|
||||
"latedef": false,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"noempty": true,
|
||||
"nonew": true,
|
||||
"plusplus": true,
|
||||
"quotmark": "single",
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"strict": true,
|
||||
"trailing": true,
|
||||
"maxparams": 4,
|
||||
"maxdepth": 2,
|
||||
"maxstatements": 0,
|
||||
"maxcomplexity": 4,
|
||||
"maxlen": 100,
|
||||
|
||||
"asi": false,
|
||||
"boss": false,
|
||||
"debug": false,
|
||||
"eqnull": false,
|
||||
"es5": false,
|
||||
"esnext": false,
|
||||
"evil": false,
|
||||
"expr": false,
|
||||
"funcscope": false,
|
||||
"globalstrict": false,
|
||||
"iterator": false,
|
||||
"lastsemic": false,
|
||||
"laxbreak": false,
|
||||
"laxcomma": false,
|
||||
"loopfunc": false,
|
||||
"moz": false,
|
||||
"multistr": false,
|
||||
"proto": false,
|
||||
"scripturl": false,
|
||||
"smarttabs": false,
|
||||
"shadow": false,
|
||||
"sub": false,
|
||||
"supernew": false,
|
||||
"validthis": false,
|
||||
|
||||
"browser": false,
|
||||
"couch": false,
|
||||
"devel": false,
|
||||
"dojo": false,
|
||||
"jquery": false,
|
||||
"mootools": false,
|
||||
"node": true,
|
||||
"nonstandard": false,
|
||||
"prototypejs": false,
|
||||
"rhino": false,
|
||||
"worker": false,
|
||||
"wsh": false,
|
||||
"yui": false
|
||||
}
|
@@ -17,4 +17,4 @@ function helper (register) {
|
||||
return moment(context).fromNow();
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user