从 .editorconfig 启用 eslint 自动修复到 Intelij?

问题描述 投票:0回答:1

是否可以从

.editorconfig
在Intellij中启用eslint自动修复而不是手动配置?

手动配置Intellij:

manual config Intellij

我正在寻找这样的东西:

[*.{js,jsx,ts,tsx,json}]
ij_eslint_enable = true
ij_eslint_auto_fix_on_save = true

还有其他方法可以配置保存操作时运行吗?

intellij-idea eslint intellij-plugin
1个回答
0
投票

通过Git分享找到了方法 .idea/jsLinters/eslint.xml 配置 eslint 模块行为的文件。

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EslintConfiguration">
    <files-pattern value="**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,html,json}" />
    <option name="fix-on-save" value="true" />
  </component>
</project>
© www.soinside.com 2019 - 2024. All rights reserved.