Replacing gjslint with jshint; fixing jshint for windows
This commit is contained in:
parent
4b4c70f5d1
commit
cb68adb80f
@ -1,5 +1,6 @@
|
||||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
/* globals FirefoxCom */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -42,7 +43,8 @@
|
||||
return;
|
||||
|
||||
// get the related l10n object
|
||||
var data = getL10nData(element.dataset.l10nId);
|
||||
var key = element.dataset.l10nId;
|
||||
var data = getL10nData(key);
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
52
make.js
52
make.js
@ -23,6 +23,7 @@
|
||||
require('./external/shelljs/make');
|
||||
var builder = require('./external/builder/builder.js');
|
||||
var crlfchecker = require('./external/crlfchecker/crlfchecker.js');
|
||||
var path = require('path');
|
||||
|
||||
var ROOT_DIR = __dirname + '/', // absolute path to project's root
|
||||
BUILD_DIR = 'build/',
|
||||
@ -971,49 +972,30 @@ target.server = function() {
|
||||
target.lint = function() {
|
||||
cd(ROOT_DIR);
|
||||
echo();
|
||||
echo('### Linting JS files (this can take a while!)');
|
||||
|
||||
var LINT_FILES = ['make.js',
|
||||
'external/builder/*.js',
|
||||
'external/crlfchecker/*.js',
|
||||
'src/*.js',
|
||||
'web/*.js',
|
||||
'test/*.js',
|
||||
'test/unit/*.js',
|
||||
'extensions/firefox/*.js',
|
||||
'extensions/firefox/components/*.js',
|
||||
'extensions/chrome/*.js'];
|
||||
|
||||
exec('gjslint --nojsdoc ' + LINT_FILES.join(' '));
|
||||
|
||||
echo('Discarding the results by printing \"files checked, no errors found\"');
|
||||
echo('Use \"node make jshint\"');
|
||||
|
||||
crlfchecker.checkIfCrlfIsPresent(LINT_FILES);
|
||||
};
|
||||
|
||||
//
|
||||
// make jshint
|
||||
//
|
||||
target.jshint = function() {
|
||||
cd(ROOT_DIR);
|
||||
echo();
|
||||
echo('### Linting JS files (this can take a while!)');
|
||||
echo('### Linting JS files');
|
||||
|
||||
var LINT_FILES = ['make.js',
|
||||
'external/builder/',
|
||||
'external/crlfchecker/',
|
||||
'src/',
|
||||
'web/*.js',
|
||||
'test/*.js',
|
||||
'test/unit/*.js',
|
||||
'extensions/firefox/*.js',
|
||||
'extensions/firefox/components/*.js',
|
||||
'extensions/chrome/*.js'
|
||||
'web/',
|
||||
'test/driver.js',
|
||||
'test/reporter.js',
|
||||
'test/unit/',
|
||||
'extensions/firefox/',
|
||||
'extensions/chrome/'
|
||||
];
|
||||
|
||||
exit(exec('./node_modules/.bin/jshint --reporter test/reporter.js ' +
|
||||
var jshintPath = path.normalize('./node_modules/.bin/jshint');
|
||||
if (!test('-f', jshintPath)) {
|
||||
echo('jshint is not installed -- installing...');
|
||||
exec('npm install jshint');
|
||||
}
|
||||
|
||||
exit(exec('"' + jshintPath + '" --reporter test/reporter.js ' +
|
||||
LINT_FILES.join(' ')).code);
|
||||
|
||||
crlfchecker.checkIfCrlfIsPresent(LINT_FILES);
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -5,7 +5,7 @@
|
||||
"jshint": "git://github.com/jshint/jshint.git#42ace75a"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node make jshint"
|
||||
"test": "node make lint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -43,6 +43,7 @@ module.exports = {
|
||||
((len === 1) ? '' : 's') + '\n');
|
||||
process.exit(2);
|
||||
} else {
|
||||
process.stdout.write('files checked, no errors found\n');
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user