AppView = {
};
module.exports = AppView;
npm install eslint --save-dev
./node_modules/.bin/eslint --init
# 选择Use a popular style guide
# 再选择Google
# 再选择JavaScript
# 现在有一个新的文件.eslintrc.js已经创建完毕了
var React = require('react');
var AppView = React.createClass({
render: function() {
return (<div>test div</div>)
},
getInitialState: function() {
return {};
}
});
module.exports = AppView;
npm install eslint-plugin-react --save-dev
module.exports = {
extends: 'google',
plugins: [
'react'
],
ecmaFeatures: {
jsx: true
},
rules: {
'react/display-name': 1,
'react/sort-comp': 1
}
};