From 9000ee6833e9ea7913e19c540dfb4d17289430a3 Mon Sep 17 00:00:00 2001 From: Isla Koenigsknecht Date: Thu, 16 May 2024 08:56:26 -0400 Subject: [PATCH] Chore: Fix random errors with lint-staged (#2533) * Skip stashing on lint-staged * Only run linter on files we normally lint on when running in lint-staged --- packages/backend/package.json | 4 ++-- packages/common/package.json | 2 +- packages/desktop/package.json | 4 ++-- packages/e2e-tests/package.json | 4 ++-- packages/identity/package.json | 4 ++-- packages/integration-tests/package.json | 4 ++-- packages/logger/package.json | 4 ++-- packages/mobile/package.json | 4 ++-- packages/state-manager/package.json | 4 ++-- packages/types/package.json | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 00bec63478..0b21fa4ccf 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -18,7 +18,7 @@ "lint:no-fix": "eslint --ext .jsx,.js,.ts,.tsx ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "test-nest": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* node_modules/jest/bin/jest.js --detectOpenHandles --forceExit ./src/nest/**/*.spec.ts", "test": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=ipfs:*,backend:* jest --runInBand --verbose --testPathIgnorePatterns=\".src/(!?nodeTest*)|(.node_modules*)\" --", "test-ci": "cross-env NODE_OPTIONS=--experimental-vm-modules jest ./src/**/* --runInBand --colors --ci --silent --verbose --testPathIgnorePatterns=\".src/nest/(!?nodeTest*)|(.node_modules*)|src/nest/.*\\.tor.spec\\.(t|j)s|src/nest/ipfs-file-manager/big-files.long.spec.ts$\"", @@ -152,6 +152,6 @@ } }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/common/package.json b/packages/common/package.json index c26d9268e1..7ba30b0ed4 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -14,7 +14,7 @@ "lint:no-fix": "eslint --ext .ts .", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "test": "jest --runInBand", "prettier": "prettier", "rmDist": "rimraf lib/" diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 3be68fd648..ff01393ba6 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -97,7 +97,7 @@ "lint:no-fix": "eslint --ext .jsx,.js,.ts,.tsx ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "type-check": "tsc -p tsconfig.build.json --noEmit", "test": "jest --runInBand", "test:watch": "jest --watchAll", @@ -305,6 +305,6 @@ "npm": "8.19.2" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 3628d6e810..21d055a966 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -10,7 +10,7 @@ "lint:no-fix": "eslint --ext .js,.ts ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "prettier:write": "prettier --write .", "prettier:check": "prettier --check .", "test": "cross-env TEST_MODE=true jest --runInBand --detectOpenHandles --forceExit", @@ -55,6 +55,6 @@ "author": "", "license": "GPL-3.0-or-later", "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/identity/package.json b/packages/identity/package.json index 20280cc74f..a65929b151 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -13,7 +13,7 @@ "lint:no-fix": "eslint --ext .jsx,.js,.ts,.tsx ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "check-style": "prettier --check src/**", "rmDist": "rimraf lib/" }, @@ -71,6 +71,6 @@ "access": "public" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 0768d64604..7a7132f155 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -15,7 +15,7 @@ "test-ci": "jest integrationTests/*", "lint:no-fix": "eslint --ext .ts ./src/", "lint": "npm run lint:no-fix -- --fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "prettier": "prettier" }, "files": [ @@ -76,6 +76,6 @@ ] }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/logger/package.json b/packages/logger/package.json index f2ab9cf853..e24d102b72 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -14,7 +14,7 @@ "lint:no-fix": "eslint --ext .ts ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "prettier": "prettier", "rmDist": "rimraf lib/" }, @@ -35,6 +35,6 @@ "author": "", "license": "GPL-3.0-or-later", "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/mobile/package.json b/packages/mobile/package.json index c350cd05e4..f04b00c137 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -12,7 +12,7 @@ "lint:no-fix": "eslint --ext .jsx,.js,.ts,.tsx ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "gen": "plop", "prepare-backend-assets": "mkdir -p ./nodejs-assets/nodejs-project && cp ../backend/lib/bundle.cjs ./nodejs-assets/nodejs-project/bundle.cjs", "patch-state-manager": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || patch -f -d ../state-manager -p0 < ./factory-girl.patch || true", @@ -159,6 +159,6 @@ "testRegex": "src/.*\\.test\\.(t|j)sx?$" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/state-manager/package.json b/packages/state-manager/package.json index 5a6764d072..8444211beb 100644 --- a/packages/state-manager/package.json +++ b/packages/state-manager/package.json @@ -11,7 +11,7 @@ "lint:no-fix": "eslint --ext .ts ./src/", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "prettier": "prettier", "rmDist": "rimraf lib/" }, @@ -83,6 +83,6 @@ ] }, "lint-staged": { - "*.{js,jsx,ts,tsx}": "npm run lint:no-fix" + "src/**/*.{js,jsx,ts,tsx}": "npm run lint:no-fix" } } diff --git a/packages/types/package.json b/packages/types/package.json index 94220856f8..2126bb2b40 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -14,7 +14,7 @@ "lint:no-fix": "eslint --ext .ts .", "lint": "npm run lint:no-fix -- --fix", "lint-ci": "npm run lint:no-fix", - "lint-staged": "lint-staged", + "lint-staged": "lint-staged --no-stash", "test": "exit 0", "prettier": "prettier", "rmDist": "rimraf lib/"