mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge from master + added more jshint checks (undef and latedef). Very helpful to catch post merge issues.
This commit is contained in:
100
Gruntfile.js
100
Gruntfile.js
@@ -5,56 +5,74 @@
|
||||
* - run a grunt target defined in Gruntfiles.js, ex: 'grunt lint'
|
||||
*
|
||||
* Note: The 'ghost' grunt task have special deps on CasperJS and phantomjs.
|
||||
* For now, It's configured to run only on TravisCI where these deps are
|
||||
* For now, It's configured to run only on TravisCI where these deps are
|
||||
* correctly defined.
|
||||
* If you run this task locally, it may require some env set up first.
|
||||
* If you run this task locally, it may require some env set up first.
|
||||
*/
|
||||
|
||||
module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
/*options: {
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
/*options: {
|
||||
"evil": true,
|
||||
"asi": true,
|
||||
"smarttabs": true,
|
||||
"eqnull": true
|
||||
},*/
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
'js/**/*.js',
|
||||
'!js/lib/**/*.js' // Exclude lib folder (note the leading !)
|
||||
]
|
||||
},
|
||||
connect: {
|
||||
www: {
|
||||
options: {
|
||||
base: '.',
|
||||
port: 4545
|
||||
}
|
||||
}
|
||||
},
|
||||
ghost: {
|
||||
dist: {
|
||||
filesSrc: ['tests/integration/casperjs/*_test.js'],
|
||||
options: {
|
||||
args: {
|
||||
baseUrl: 'http://localhost:' +
|
||||
'<%= connect.www.options.port %>/'
|
||||
},
|
||||
direct: false,
|
||||
logLevel: 'error',
|
||||
printCommand: false,
|
||||
printFilePaths: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
options: {
|
||||
indent:2,
|
||||
undef : true,
|
||||
latedef : true,
|
||||
browser : true,
|
||||
jquery : true,
|
||||
globals : {'pskl':true, 'Events':true, 'Constants':true, 'console' : true, 'module':true}
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
'js/**/*.js',
|
||||
'!js/lib/**/*.js' // Exclude lib folder (note the leading !)
|
||||
]
|
||||
},
|
||||
connect: {
|
||||
www: {
|
||||
options: {
|
||||
base: '.',
|
||||
port: 4545
|
||||
}
|
||||
}
|
||||
},
|
||||
ghost: {
|
||||
dist: {
|
||||
filesSrc: ['tests/integration/casperjs/*_test.js'],
|
||||
options: {
|
||||
args: {
|
||||
baseUrl: 'http://localhost:' + '<%= connect.www.options.port %>/'
|
||||
},
|
||||
direct: false,
|
||||
logLevel: 'error',
|
||||
printCommand: false,
|
||||
printFilePaths: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-ghost');
|
||||
grunt.config.set('leadingIndent.indentation', 'spaces');
|
||||
grunt.config.set('leadingIndent.jsFiles', {
|
||||
src: ['js/**/*.js','!js/lib/**/*.js']
|
||||
});
|
||||
grunt.config.set('leadingIndent.cssFiles', {
|
||||
src: ['css/**/*.css']
|
||||
});
|
||||
|
||||
grunt.registerTask('lint', ['jshint']);
|
||||
grunt.registerTask('test', ['jshint', 'connect', 'ghost']);
|
||||
|
||||
grunt.loadNpmTasks('grunt-leading-indent');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-ghost');
|
||||
|
||||
grunt.registerTask('check-indent', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles']);
|
||||
grunt.registerTask('lint', ['jshint']);
|
||||
grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost']);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user