首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >引入ESLint有多难?

引入ESLint有多难?
EN

Stack Overflow用户
提问于 2021-03-16 16:55:34
回答 1查看 110关注 0票数 0

我正在学习本教程中的react。https://github.com/ayush221b/MarioPlan-react-redux-firebase-app

我尝试将es-lint添加到项目中。安装后,我通过yarn start重新启动了我的项目,发生了许多错误。编译失败

从'react-router-dom‘导入{ BrowserRouter,Switch,Route }

第1:9行:'{‘object-curly- space后不能有空格!?项目是否正常工作,直到所有缩进都正确?修改所有文件需要多长时间!?我不应该使用ES-lint吗!?

代码语言:javascript
复制
src/App.js
  Line 1:9:    There should be no space after '{'              object-curly-spacing
  Line 1:24:   There should be no space before ','             comma-spacing
  Line 1:24:   A space is required after ','                   comma-spacing
  Line 1:31:   A space is required after ','                   comma-spacing
  Line 1:37:   There should be no space before '}'             object-curly-spacing
  Line 1:63:   Missing semicolon                               semi
  Line 2:48:   Missing semicolon                               semi
  Line 3:57:   Missing semicolon                               semi
  Line 4:66:   Missing semicolon                               semi
  Line 5:46:   Missing semicolon                               semi
  Line 6:46:   Missing semicolon                               semi
  Line 7:64:   Missing semicolon                               semi
  Line 8:60:   Missing semicolon                               semi
  Line 9:58:   Missing semicolon                               semi
  Line 11:1:   Missing JSDoc comment                           require-jsdoc
  Line 13:5:   'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 14:7:   'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 15:9:   'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 16:9:   'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 17:1:   Expected indentation of 10 spaces but found 12  indent
  Line 17:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 18:1:   Expected indentation of 10 spaces but found 12  indent
  Line 18:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 19:1:   Expected indentation of 10 spaces but found 12  indent
  Line 19:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 20:1:   Expected indentation of 10 spaces but found 12  indent
  Line 20:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 21:1:   Expected indentation of 10 spaces but found 12  indent
  Line 21:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 21:63:  Trailing spaces not allowed                     no-trailing-spaces
  Line 22:1:   Expected indentation of 10 spaces but found 12  indent
  Line 22:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 22:64:  Trailing spaces not allowed                     no-trailing-spaces
  Line 23:1:   Expected indentation of 10 spaces but found 12  indent
  Line 23:13:  'React' must be in scope when using JSX         react/react-in-jsx-scope
  Line 23:60:  Trailing spaces not allowed                     no-trailing-spaces

EN

回答 1

Stack Overflow用户

发布于 2021-03-17 14:25:25

你已经让它工作了,这些是eslint警告,用-fix标志运行eslint,它们中的大多数都会自动得到解决。然后,您可以通过在eslint文档中查找它们来了解其他错误的含义,该文档将向您展示如何修复这些错误

这样做会让你成为一个更好的程序员。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66651894

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档