停止VS代码格式化格式.env文件
我正在使用Prettier& vs代码上的eslint,我想阻止它在保存上格式化我的.env文件。
它在每个变量的末尾添加了半彩色,这显然不好。
I'm using prettier & eslint on vs code and i would like to stop it from formatting my .env file on save.
It adds semi-colons to the end of every variable, which is obviously not good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须单独配置ESLINT和更漂亮。
检查 this 回答有关如何配置ESLINT的说明,以及 this 用于有关如何强制迫使漂亮忽略文件的说明。
You'll have to configure ESlint and Prettier separately.
Check this answers for instructions on how to configure ESLint, and this one for instructions on how to force Prettier to ignore files.
添加到
.prettierignore
.env*
。那对我有用。
Add to a
.prettierignore
.env*
.That did the trick for me.
在项目文件夹下,创建一个子文件夹
.vscode
,然后触摸settings.json.json
subfolder下的文件,将以下配置粘贴到street.json 。它将停止在ENV文件上自动形成。
Under the project folder, create a subfolder
.vscode
, then touch asettings.json
file under the subfolder, paste the following config into thesetting.json
. It would stop auto-formatting on env file.