Browse Source

linter: fix prettier/eslint hook when only modifying non-js files

Matt Robenolt 8 years ago
parent
commit
159e75efd4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      config/hooks/pre-commit
  2. 1 1
      src/sentry/lint/engine.py

+ 1 - 1
config/hooks/pre-commit

@@ -35,7 +35,7 @@ def js_format(file_list=None):
     js_file_list = get_js_files(file_list)
 
     has_errors = False
-    if file_list:
+    if js_file_list:
         status = Popen([prettier_path, '--write', '--single-quote', '--bracket-spacing=false', '--print-width=90']
                        + js_file_list).wait()
         has_errors = status != 0

+ 1 - 1
src/sentry/lint/engine.py

@@ -94,7 +94,7 @@ def js_lint(file_list=None):
     js_file_list = get_js_files(file_list)
 
     has_errors = False
-    if file_list:
+    if js_file_list:
         status = Popen([eslint_path, '--config', eslint_config, '--ext', '.jsx', '--fix']
                        + js_file_list).wait()
         has_errors = status != 0