mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Point Grunt to use external jshintrc
This commit is contained in:
parent
8f744794e4
commit
9d809aa2ba
53
Gruntfile.js
53
Gruntfile.js
@ -15,9 +15,9 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
paths: {
|
paths: {
|
||||||
@ -37,16 +37,17 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
jshint: {
|
jshint: {
|
||||||
options: {
|
options: {
|
||||||
|
jshintrc:true
|
||||||
// http://www.jshint.com/docs/options/
|
// http://www.jshint.com/docs/options/
|
||||||
"asi": true, // allow missing semicolons
|
//"asi": true, // allow missing semicolons
|
||||||
"curly": true, // require braces
|
//"curly": true, // require braces
|
||||||
"eqnull": true, // ignore ==null
|
//"eqnull": true, // ignore ==null
|
||||||
"forin": true, // require property filtering in "for in" loops
|
//"forin": true, // require property filtering in "for in" loops
|
||||||
"immed": true, // require immediate functions to be wrapped in ( )
|
//"immed": true, // require immediate functions to be wrapped in ( )
|
||||||
"nonbsp": true, // warn on unexpected whitespace breaking chars
|
//"nonbsp": true, // warn on unexpected whitespace breaking chars
|
||||||
//"strict": true, // commented out for now as it causes 100s of warnings, but want to get there eventually
|
////"strict": true, // commented out for now as it causes 100s of warnings, but want to get there eventually
|
||||||
"loopfunc": true, // allow functions to be defined in loops
|
//"loopfunc": true, // allow functions to be defined in loops
|
||||||
"sub": true // don't warn that foo['bar'] should be written as foo.bar
|
//"sub": true // don't warn that foo['bar'] should be written as foo.bar
|
||||||
},
|
},
|
||||||
all: [
|
all: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
@ -55,7 +56,7 @@ module.exports = function(grunt) {
|
|||||||
'nodes/**/*.js',
|
'nodes/**/*.js',
|
||||||
'editor/js/**/*.js'
|
'editor/js/**/*.js'
|
||||||
],
|
],
|
||||||
|
|
||||||
core: {
|
core: {
|
||||||
files: {
|
files: {
|
||||||
src: [
|
src: [
|
||||||
@ -198,7 +199,7 @@ module.exports = function(grunt) {
|
|||||||
tasks: ['sass','attachCopyright:css']
|
tasks: ['sass','attachCopyright:css']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
nodemon: {
|
nodemon: {
|
||||||
/* uses .nodemonignore */
|
/* uses .nodemonignore */
|
||||||
dev: {
|
dev: {
|
||||||
@ -212,7 +213,7 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
concurrent: {
|
concurrent: {
|
||||||
dev: {
|
dev: {
|
||||||
tasks: ['nodemon', 'watch'],
|
tasks: ['nodemon', 'watch'],
|
||||||
@ -221,7 +222,7 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
copy: {
|
copy: {
|
||||||
build: {
|
build: {
|
||||||
files:[{
|
files:[{
|
||||||
@ -275,7 +276,7 @@ module.exports = function(grunt) {
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
compress: {
|
compress: {
|
||||||
release: {
|
release: {
|
||||||
options: {
|
options: {
|
||||||
@ -287,7 +288,7 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-simple-mocha');
|
grunt.loadNpmTasks('grunt-simple-mocha');
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||||
@ -317,7 +318,7 @@ module.exports = function(grunt) {
|
|||||||
" * See the License for the specific language governing permissions and\n"+
|
" * See the License for the specific language governing permissions and\n"+
|
||||||
" * limitations under the License.\n"+
|
" * limitations under the License.\n"+
|
||||||
" **/\n";
|
" **/\n";
|
||||||
|
|
||||||
if (files) {
|
if (files) {
|
||||||
for (var i=0;i<files.length;i++) {
|
for (var i=0;i<files.length;i++) {
|
||||||
var file = files[i];
|
var file = files[i];
|
||||||
@ -339,34 +340,34 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.registerTask('default',
|
grunt.registerTask('default',
|
||||||
'Builds editor content then runs code style checks and unit tests on all components',
|
'Builds editor content then runs code style checks and unit tests on all components',
|
||||||
['build','test-core','test-editor','test-nodes']);
|
['build','test-core','test-editor','test-nodes']);
|
||||||
|
|
||||||
grunt.registerTask('test-core',
|
grunt.registerTask('test-core',
|
||||||
'Runs code style check and unit tests on core runtime code',
|
'Runs code style check and unit tests on core runtime code',
|
||||||
['jshint:core','simplemocha:core']);
|
['jshint:core','simplemocha:core']);
|
||||||
|
|
||||||
grunt.registerTask('test-editor',
|
grunt.registerTask('test-editor',
|
||||||
'Runs code style check on editor code',
|
'Runs code style check on editor code',
|
||||||
['jshint:editor']);
|
['jshint:editor']);
|
||||||
|
|
||||||
grunt.registerTask('test-nodes',
|
grunt.registerTask('test-nodes',
|
||||||
'Runs unit tests on core nodes',
|
'Runs unit tests on core nodes',
|
||||||
['simplemocha:nodes']);
|
['simplemocha:nodes']);
|
||||||
|
|
||||||
grunt.registerTask('build',
|
grunt.registerTask('build',
|
||||||
'Builds editor content',
|
'Builds editor content',
|
||||||
['clean:build','concat:build','concat:vendor','uglify:build','sass:build','copy:build','attachCopyright']);
|
['clean:build','concat:build','concat:vendor','uglify:build','sass:build','copy:build','attachCopyright']);
|
||||||
|
|
||||||
grunt.registerTask('dev',
|
grunt.registerTask('dev',
|
||||||
'Developer mode: run node-red, watch for source changes and build/restart',
|
'Developer mode: run node-red, watch for source changes and build/restart',
|
||||||
['build','concurrent:dev']);
|
['build','concurrent:dev']);
|
||||||
|
|
||||||
grunt.registerTask('release',
|
grunt.registerTask('release',
|
||||||
'Create distribution zip file',
|
'Create distribution zip file',
|
||||||
['build','clean:release','copy:release','compress:release']);
|
['build','clean:release','copy:release','compress:release']);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user