简体   繁体   中英

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. Originally, whenever ember serve was running, any changes to the code would also trigger the linting scripts to re-run. 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 . Instead, linting must be called manually through the command line. This is the PR that I think maybe related to this side-effect.

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. It's not a huge deal to me, but it is a little inconvenient to have to manually run linting now.

If you want to you can restore this functionality by re-adding 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. That is the reason this was removed as most people tend to prefer it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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