Skip to content

Commit 10cb8d8

Browse files
chore: ignore git worktrees in lint, format and tests (#53)
Running lint, format:check or the tests from a checkout with worktrees under .worktrees/ also checked every other branch's copy of the code. Ignore .worktrees/ in eslint, prettier (via .gitignore and .prettierignore) and vitest.
1 parent c13e963 commit 10cb8d8

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ examples/basic/dist/
55
coverage/
66
.DS_Store
77
EVAL-CHECKLIST.md
8+
.worktrees/

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
dist/
22
node_modules/
3+
# Git worktrees for other branches; each one is checked in its own checkout.
4+
.worktrees/
35
examples/glean/dist/
46
examples/glean/plugins/
57
examples/basic/dist/

‎eslint.config.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export default tseslint.config(
66
ignores: [
77
"dist/**",
88
"node_modules/**",
9+
// Git worktrees for other branches; each one is linted in its own checkout.
10+
".worktrees/**",
911
"examples/basic/dist/**",
1012
"examples/glean/dist/**",
1113
"examples/glean/plugins/**",

‎vitest.config.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { defineConfig } from "vitest/config";
1+
import { configDefaults, defineConfig } from "vitest/config";
22

33
export default defineConfig({
44
test: {
5+
// Git worktrees for other branches hold their own copies of the tests.
6+
exclude: [...configDefaults.exclude, ".worktrees/**"],
57
// Many tests run real builds, validations and packed CLIs against temp
68
// projects. They take 1-4s locally, and the shared CI runners run the
79
// suite in parallel at a fraction of that speed, so vitest's 5s default

0 commit comments

Comments
 (0)