ESLint/eslint-plugin-react:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第10行: 第10行:
const Test = React.forwardRef((props, ref) => { return <input {...props} />});
const Test = React.forwardRef((props, ref) => { return <input {...props} />});
Test.displayName = 'Test';</syntaxhighlight>
Test.displayName = 'Test';</syntaxhighlight>
* React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
: 在eslintrc.js或者.eslintrc文件中添加配置项:
: <syntaxhighlight lang="javascript">
"settings": {
  "react": {
    "version": "detect"
  }
}</syntaxhighlight>