在我导入一个特定的模块后,在本例中,从http://jedwatson.github.io/react-select/导入react-select
My react lint会提示我一个lint警告。模块中的代码未通过lint验证。我犯了一个错误,在我的源文件中有模块代码。
Compiled with warnings.
Warning in ./src/~/react-select/lib/index.js
/home/tonyu2/ui/src/node_modules/react-select/lib/index.js
1:1 warning 'use strict' is unnecessary inside of modules strict
✖ 1 problem (0 errors, 1 warning)
Warning in ./src/~/react-select/lib/AsyncCreatable.js
/home/tonyu2/ui/src/node_modules/react-select/lib/AsyncCreatable.js
1:1 warning 'use strict' is unnecessary inside of modules strict
✖ 1 problem (0 errors, 1 warning)
Warning in ./src/~/react-select/lib/utils/defaultMenuRenderer.js
/home/tonyu2/ui/src/node_modules/react-select/lib/utils/defaultMenuRenderer.js
1:1 warning 'use strict' is unnecessary inside of modules strict
✖ 1 problem (0 errors, 1 warning)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
这很烦人,因为它会影响我捕捉代码中真实的重要的错误。我使用的是create-react-app库,这样我就不必处理webpack、bundle和httpserver了。
1条答案
按热度按时间oxalkeyp1#
你有没有试过先运行npm install并检查你的package.json文件?这通常是我的问题。