Skip to content

A platform for community discussion. Free, open, simple.

DEV: Run prettier on staged files before commit using lefthook (#9064)

Mark VanLandinghamc11e5eb04230
diff --git a/lefthook.yml b/lefthook.yml
index f3305fb786e..8dae834398b 100644
--- a/lefthook.yml
+++ b/lefthook.yml
@@ -4,6 +4,10 @@ pre-commit:
rubocop:
glob: "*.rb"
run: bundle exec rubocop {staged_files}
+ prettier:
+ glob: "*.{js,es6}"
+ exclude: "vendor/*|fixtures|public/javascripts|shims.js|ember-addons|template-lintrc|locale/*|test_helper|run-qunit"
+ run: yarn prettier --list-different {staged_files}
eslint:
glob: "*.{js,es6}"
exclude: "vendor/*|fixtures|public/javascripts|shims.js|ember-addons|template-lintrc|locale/*|test_helper|run-qunit"