Skip to content

Commit 00af595

Browse files
authored
fix: exclude gen files from formatting (#2672)
1 parent fa3ba45 commit 00af595

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

biome.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@
5353
},
5454
"overrides": [
5555
{
56-
"includes": ["packages_generated/**", "**/dist/**", "coverage/**", "**/examples/**", "**/*.gen.ts", "scripts/templates/**"],
56+
"includes": ["packages_generated/**", "**/dist/**", "coverage/**", "**/examples/**", "**/*.gen.ts", "scripts/templates/**", "packages/sdk/src/index.gen.ts"],
57+
"formatter": {
58+
"enabled": false
59+
},
5760
"linter": {
5861
"enabled": false
5962
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"generatePackages": "pnpm dlx tsx ./scripts/generatePackages.ts",
1616
"generateGlobalSdkPackage": "pnpm dlx tsx ./scripts/updateGlobalSdkPackage.ts",
1717
"setupNewProducts": "pnpm dlx tsx ./scripts/setupNewProducts.ts",
18-
"prebuild": "pnpm run generatePackages && pnpm run generateAlias && pnpm dlx tsx ./scripts/formatGeneratedConfigFiles.ts && pnpm biome format --write packages packages/sdk scripts",
18+
"prebuild": "pnpm run generatePackages && pnpm run generateAlias && pnpm dlx tsx ./scripts/formatGeneratedConfigFiles.ts && pnpm biome format --write packages packages/sdk/vite.config.ts scripts",
1919
"build:packages": "pnpm turbo run build",
2020
"fix-import-extensions": "pnpm dlx tsx ./scripts/fix-import-extensions.ts",
2121
"build": "pnpm run build:packages && pnpm run fix-import-extensions",

scripts/formatGeneratedConfigFiles.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const CONFIG_FILES = [
2121
function findConfigFiles(dir: string, fileList: string[] = []): string[] {
2222
const files = readdirSync(dir)
2323
for (const file of files) {
24+
// Skip node_modules directories
25+
if (file === 'node_modules') {
26+
continue
27+
}
2428
const filePath = join(dir, file)
2529
const stat = statSync(filePath)
2630
if (stat.isDirectory()) {

0 commit comments

Comments
 (0)