在项目根目录下创建.prettierrc文件,并在文件中写入一下内容 { "tabWidth": 2, "useTabs": false, "singleQuote": true, "semi": false }