1

Say, I have a React component like this:

var Wizard = React.createClass({

  planAllowsConfigType: function(configType) {
    return true;  
  },

  render: function()
  {
    // Note type in planAlowsConfigType
    var output = this.planAlowsConfigType() ? "Yup, you're good." : "No, sorry!";

    return <div>
            {output}
           </div>;
  }
});

Is there a JavaScript static analysis tool that can catch that kind of typo (this.planAlowsConfigType) that I can run as part of my build?

Update: WebStorm is able to catch some of these but I'm not sure if it's using something proprietary.

Gezim
  • 7,112
  • 10
  • 62
  • 98
  • Somebody asked a very similar question to this (essentially the same question) a few days ago, and I don't think it got any answers. – Pointy Nov 23 '15 at 22:53
  • Atom has eslint plugins which highlight unused and undefined values - https://atom.io/packages/eslint – Jonah Williams Nov 23 '15 at 22:53
  • Unless I'm missing something, eslint cannot do that for properties, it can for variables, though. – Gezim Nov 23 '15 at 22:56
  • Your best bet might be TypeScript then, It does in fact catch these errors with the initial ts -> js. – Jonah Williams Nov 23 '15 at 23:06

0 Answers0