From cdcccbfb4a2d24384d006c36fc380c1031fa15ef Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Thu, 10 Sep 2020 22:13:16 -0500 Subject: [PATCH] chore: switch eslint to lint changed files intead of whole project --- .pre-commit-config.yaml | 3 +-- scripts/lint.sh | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100755 scripts/lint.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6562667..54e432c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,11 +3,10 @@ repos: hooks: - id: eslint name: eslint - entry: go run cmd/mage/main.go frontend:lint + entry: scripts/lint.sh language: system files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx types: [file] - pass_filenames: false - hooks: - id: check-yaml - id: end-of-file-fixer diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..e22d3f1 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,2 @@ +#!/bin/bash +yarn --cwd frontend eslint $(echo $1 | sed 's/frontend\///g')