简体   繁体   English

来自“Ember Serve”,如何在每个新构建上运行 lint

[英]from `Ember Serve`, how to run lint on each new build

I encountered this problem while upgrading from Ember 3.12 to Ember 3.20.我在从 Ember 3.12 升级到 Ember 3.20 时遇到了这个问题。 Originally, whenever ember serve was running, any changes to the code would also trigger the linting scripts to re-run.最初,每当ember serve运行时,对代码的任何更改也会触发 linting 脚本重新运行。 I've looked at some Ember pull requests and it seems some of the linting libraries were swapped which may have had an adverse side-effect of not causing the linting tool to run on either ember serve , or ember test .我查看了一些 Ember 拉取请求,似乎交换了一些 linting 库,这可能会产生不利的副作用,即不会导致 linting 工具在ember serveember test上运行。 Instead, linting must be called manually through the command line.相反,必须通过命令行手动调用 linting。 This is the PR that I think maybe related to this side-effect.这是我认为可能与此副作用有关的 PR。

https://github.com/ember-cli/ember-cli/pull/9009 https://github.com/ember-cli/ember-cli/pull/9009

Is there a way to work around this?有没有办法解决这个问题? To be clear, I want the linters to ideally run with ember serve rather than as a separate command.需要明确的是,我希望 linters 最好与ember serve一起运行,而不是作为一个单独的命令运行。 It's not a huge deal to me, but it is a little inconvenient to have to manually run linting now.这对我来说不是什么大问题,但现在必须手动运行 linting 有点不方便。

If you want to you can restore this functionality by re-adding ember-cli-eslint .如果您愿意,可以通过重新添加ember-cli-eslint来恢复此功能。

ember install ember-cli-eslint

However you may be happier adding eslint to your editor so you get more immediate feedback and don't need to watch the build.但是,您可能更愿意将 eslint 添加到您的编辑器中,这样您就可以获得更即时的反馈,而无需观看构建。 That is the reason this was removed as most people tend to prefer it.这就是它被删除的原因,因为大多数人倾向于喜欢它。

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

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