jsxhint does not seem to be working
arianf opened this issue · 1 comments
arianf commented
My grunt file is super simple:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-jsxhint');
/* Project configuration */
grunt.initConfig({
options: {
jshintrc: '.jshintrc',
ignores: [],
additionalSuffixes: ['.js', '.ios.js']
},
jshint: {
all: ['./app/index.ios.js']
}
});
/* Test Tasks */
grunt.registerTask('test', ['jshint']);
};
When I do a grunt test
, I get the following errors.
But when I installed npm install -g jsxhint
I can do a test and see the proper result
arianf commented
I figured out what was wrong with my Gruntfile.
You need to load the task in: grunt.loadNpmTasks('grunt-jsxhint');
After grunt.initConfig({})
has been set, or else it won't be able to pull any grunt config properties
This would look like this:
module.exports = function(grunt) {
/* Project configuration */
grunt.initConfig({
options: {
jshintrc: '.jshintrc',
ignores: [],
additionalSuffixes: ['.js', '.ios.js']
},
jshint: {
all: ['./app/index.ios.js']
}
});
grunt.loadNpmTasks('grunt-jsxhint');
/* Test Tasks */
grunt.registerTask('test', ['jshint']);
};