app子文件夹项目不掉毛

app子文件夹项目不掉毛

本文介绍了create-react-app子文件夹项目不掉毛的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 用子文件夹中的create-react-app引导的项目不会掉毛。但是,如果我在VSCode中以root身份打开项目子文件夹(如下图所示),或者在root位置设置了一个新的create-react-app项目,则linting可以正常工作。Projects bootstrapped with create-react-app within subfolders do not lint. However, if I open the project subfolder as root in VSCode (pictured below), or setup a new create-react-app project at root, linting works fine.标准和弹出的create-react-app项目都会出现这种情况。This occurs with both standard and ejected create-react-app projects.理想情况下没有弹出,如何使用子文件夹项目使create-react-app的整理工作完成?Ideally without ejecting, how can I make create-react-app's linting work with subfolder projects?我正在使用create-react-app v3.1.1 ,VSCode 2019年8月和Windows 10。I'm using create-react-app v3.1.1, VSCode August 2019 and Windows 10.推荐答案 VSCode ESLint扩展 包括用于指定工作目录的设置:The VSCode ESLint Extension includes settings for specifying working directories: 要使用的工作目录的数组。 ESLint解析相对于工作目录的配置文件(例如eslintrc)。 此新设置允许用户控制将用于哪个文件的工作目录。 an array for working directories to be used. ESLint resolves configuration files (e.g. eslintrc) relative to a working directory. This new settings allows users to control which working directory is used for which files.因此,在在这种情况下,将以下内容添加到Workspace settings.json 文件即可解决此问题:Therefore, in this case, adding the following to the Workspace settings.json file solves the issue:{ "eslint.workingDirectories": [ "./client" ]} 这篇关于create-react-app子文件夹项目不掉毛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-18 10:55