配置eslint 在react项目中配置eslint,并启用保存自动格式化功能 第一步 npm i eslint typescript -D 第二步 在项目根目录,运行npx eslint --init 按交互提示完成相关配置项 第三步 设置vscode的自动保存格式化