简体   繁体   English

ESlint autofix 有可能破坏我的代码吗?

[英]Is it possible for ESlint autofix break my code?

I ran ESlint (with prettier plugin) on my repo and it showed about 700 problems, 600 of them it said it can autofix with the --fix flag.我在我的 repo 上运行了 ESlint(带有prettier的插件),它显示了大约 700 个问题,其中 600 个说它可以使用--fix标志自动修复。

How should I approach this?我应该如何处理这个? Is it safe to autofix or it could break my code and I should do it manually one file at a time?自动修复是否安全,或者它可能会破坏我的代码,我应该一次手动执行一个文件?

Functional breaks are possible but highly unlikely.功能性中断是可能的,但极不可能。 Breaking something related to the Typescript compiler is more likely but instantly spottable and easy to fix/rollback.破坏与 Typescript 编译器相关的内容的可能性更大,但可以立即发现并且易于修复/回滚。

Also, it depends on what rules you use;此外,这取决于您使用的规则; just eslint:recommended should be very safe.只是eslint:recommended应该是非常安全的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM