From c11e5eb042303c4933ac1faefdd46064b4d2ff25 Mon Sep 17 00:00:00 2001 From: Mark VanLandingham Date: Mon, 2 Mar 2020 13:30:23 -0600 Subject: [PATCH] DEV: Run prettier on staged files before commit using lefthook (#9064) * DEV: Run prettier on staged files before commit using lefthook * excluded some js files --- lefthook.yml | 4 ++++ 1 file changed, 4 insertions(+) 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"