cuadraman cuadraman - 1 year ago 164
React JSX Question

How to disable ESLint react/prop-types rule in a fil?

I'm using React and ESLint with eslint-plugin-react.
I want to disable the prop-types rule in one file.

var React = require('react');
var Model = require('./ComponentModel');

var Component = React.createClass({
/* eslint-disable react/prop-types */
propTypes: Model.propTypes,
/* eslint-enable react/prop-types */
render: function () {
return (
<div className="component">

Answer Source

Just put this on top of your file:

/* eslint react/prop-types: 0 */
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download