Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsxhint does not seem to be working #23

Closed
arianf opened this issue Apr 8, 2015 · 1 comment
Closed

jsxhint does not seem to be working #23

arianf opened this issue Apr 8, 2015 · 1 comment

Comments

@arianf
Copy link

arianf commented Apr 8, 2015

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.

screen shot 2015-04-08 at 3 14 29 pm

But when I installed npm install -g jsxhint I can do a test and see the proper result

screen shot 2015-04-08 at 3 12 40 pm

@arianf
Copy link
Author

arianf commented Apr 8, 2015

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']);
};

@arianf arianf closed this as completed Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant