我正在学习本教程中的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吗!?
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

发布于 2021-03-17 14:25:25
你已经让它工作了,这些是eslint警告,用-fix标志运行eslint,它们中的大多数都会自动得到解决。然后,您可以通过在eslint文档中查找它们来了解其他错误的含义,该文档将向您展示如何修复这些错误
这样做会让你成为一个更好的程序员。
https://stackoverflow.com/questions/66651894
复制相似问题