From 67c6ca0fd106f8c2f869ebfd2c08204b9472654d Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 3 May 2023 08:39:58 -0700 Subject: [PATCH 1/4] Create a convenience script to quickly lint changed files locally --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index cfd39cfe59f..abe4ec6df51 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "android-build-e2e": "bundle exec fastlane android build_e2e", "test": "TZ=utc jest", "lint": "eslint . --max-warnings=0", + "lint-changed": "eslint --fix \"$(git diff --name-only main -- \"**/*.js\")\"", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", "print-version": "echo $npm_package_version", From 08229afe1d5b74b7e53139250a2ee891223c9868 Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 3 May 2023 08:46:03 -0700 Subject: [PATCH 2/4] Remove directory wildcard --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index abe4ec6df51..1098193699e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "android-build-e2e": "bundle exec fastlane android build_e2e", "test": "TZ=utc jest", "lint": "eslint . --max-warnings=0", - "lint-changed": "eslint --fix \"$(git diff --name-only main -- \"**/*.js\")\"", + "lint-changed": "eslint --fix \"$(git diff --name-only main -- \"*.js\")\"", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", "print-version": "echo $npm_package_version", From 11640e8b63133860e845d94f8c9090f5c2575a66 Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 3 May 2023 08:48:38 -0700 Subject: [PATCH 3/4] Remove double-quoting around git diff --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1098193699e..4e037e0bc85 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "android-build-e2e": "bundle exec fastlane android build_e2e", "test": "TZ=utc jest", "lint": "eslint . --max-warnings=0", - "lint-changed": "eslint --fix \"$(git diff --name-only main -- \"*.js\")\"", + "lint-changed": "eslint --fix $(git diff --name-only main -- \"*.js\")", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", "print-version": "echo $npm_package_version", From 4268a25d937dd6e3abd903eb50c055c3c2c17e1f Mon Sep 17 00:00:00 2001 From: rory Date: Wed, 3 May 2023 10:41:16 -0700 Subject: [PATCH 4/4] Add diff-filter to exclude files that no longer exist in this branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e037e0bc85..2cccbcbda5f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "android-build-e2e": "bundle exec fastlane android build_e2e", "test": "TZ=utc jest", "lint": "eslint . --max-warnings=0", - "lint-changed": "eslint --fix $(git diff --name-only main -- \"*.js\")", + "lint-changed": "eslint --fix $(git diff --diff-filter=AM --name-only main -- \"*.js\")", "lint-watch": "npx eslint-watch --watch --changed", "shellcheck": "./scripts/shellCheck.sh", "print-version": "echo $npm_package_version",