相关疑难解决方法(0)

让Facebook的react.js库JSX语法与jslint很好地配合?

I am playing around with the Facebook's react.js library. I am trying to use their JSX syntax which describes creating a view in the following way.

/** @jsx React.DOM */
var HelloMessage = React.createClass({
  render: function() {
    return <div>{'Hello ' + this.props.name}</div>;
  }
});

React.renderComponent(<HelloMessage name="John" />, mountNode);
Run Code Online (Sandbox Code Playgroud)

JSLint obviously does not like this ("expected an identifier and instead saw ' <';" - JavaScript syntax error), so how do I get around this in my .jshintrc file?

javascript facebook jslint jshint reactjs

37
推荐指数
4
解决办法
2万
查看次数

标签 统计

facebook ×1

javascript ×1

jshint ×1

jslint ×1

reactjs ×1