Code Monkey home page Code Monkey logo

grunt-jsxhint's People

Contributors

iamkoch avatar munter avatar talater avatar terribledev avatar tillarnold avatar zdoc01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grunt-jsxhint's Issues

option for still supporting *.js ?

Hi,

I've saw the recent update which stops the support of JSX syntax inside ".js",
I still want to use ".js" because it works better with Browserify.

If we look at plugins like reactify: https://github.com/andreypopp/reactify they do the support like this:

reactify transform activates for files with either .jsx extension or /** @jsx React.DOM */ pragma as a first line for any .js file.

I'm going to continue to use 0.0.2 of this plugin waiting for a fix.

Best regards,
gre

Not parsing ES6

It is not parsing ES6 properly in my config:

es6

My relevant code. Inside initConfig:

jshint: {
  target: 'assets/*.jsx',
  options: {
    ignores: [],
    additionalSuffixes: ['.js']
  }
},

Then at the end, after initConfig({ ... }):

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-jsxhint');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-notify');
grunt.registerTask('default', ['jshint', 'shell', 'sass', 'notify:build']);

I've tried tweaking and changing few things but still the same error

Linting normal .js files is really slow

I'm guessing everything is run through the transformer as it is.
I have thousands of files that aren't jsx yet. Plugging in grunt-jsxhint as a drop in replacement considerably slows down my linting.

Any way to be able to tell the linter which files should be transformed and which should pass through untouched?

Use locally installed react-tools

Depending on a specific version of react-tools, while the user might be using a different one can lead to problems. I've run into similar issues for every precompiler out there.

The best solution is to do a try/catch for requiring react-tools and throw an error if it is not installed, hopefully with a helpful error message on how to fix the problem

Add linting

This is a project to lint code, so it's own source should be linted as well.

Babel option

Hi,

I want to use your plugin, but i faced a problem, that there are no ability to use babel transformation instead of react tools.

Are you plan to provide this ability?

node 6.1.0

This package doesn't seem to work with node 6.1.0 on Windows (did not test *nix) when we downgrade to a 4.x. release everything seems to work ok.

image

Unclear how to use

I'm not understanding how to use this grunt task. It doesn't seem to be processing my .jsx files.

I have both grunt-jsxhint and grunt-contrib-jshint installed.

My GruntFile.js

module.exports = function (grunt) {
    grunt.initConfig({
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: {
                src: [
                    'js/**/*.js',
                    'js/**/*.jsx'
                ]
            }
        }
    });

    require('load-grunt-tasks')(grunt, {
        pattern: ["grunt-*"]
    });
};

However, when I run "grunt jshint" only the .js files are validated, and there is no option to run "grunt jsxhint" and no option to specify that the 'jshint' task should use 'grunt-jsxhint'.

Ignore transformed JSX -> JS code

If you have a case where say you have your linter looking for single quotes and after your .jsx file is processed and through processing gets strings surrounded by single quotes the linter will fail. But really you don't care if the transformed code passes linting. Just the original code. Is there a way to just ignore the transformed code while linting?

jsxhint does not seem to be working

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

Support files with extension .react.js

React 0.12.0 was just released and no longer requires the /** @jsx React.DOM */ pragma at the top of the file. The React components in their example apps in the flux repo (https://github.com/facebook/flux/tree/master/examples/flux-chat/js/components) use .react.js file extensions instead of .jsx ones. However, if I remove the pragma, files with .react.js extension are no longer treated as JSX files since the code looks for one of .jsx or the pragma. Could you allow .react.js files by default to be treated as JSX files? Or, alternately, allow the user to configure the grunt task to specify the file suffix they're using?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.