停止VS代码格式化格式.env文件

发布于 2025-02-11 17:42:50 字数 90 浏览 0 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

知足的幸福 2025-02-18 17:42:50

您必须单独配置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.

虚拟世界 2025-02-18 17:42:50

添加到.prettierignore .env*
那对我有用。

Add to a .prettierignore .env*.
That did the trick for me.

娇纵 2025-02-18 17:42:50

在项目文件夹下,创建一个子文件夹.vscode,然后触摸settings.json.json subfolder下的文件,将以下配置粘贴到street.json 。它将停止在ENV文件上自动形成。

{
  "editor.formatOnSave": true,
  "editor.formatOnPaste": true,
  "[dotenv]": {
    "editor.formatOnSave": false
  }
}

Under the project folder, create a subfolder .vscode, then touch a settings.json file under the subfolder, paste the following config into the setting.json. It would stop auto-formatting on env file.

{
  "editor.formatOnSave": true,
  "editor.formatOnPaste": true,
  "[dotenv]": {
    "editor.formatOnSave": false
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文