Skip to content

Commit 1577731

Browse files
authored
Generate file in correct format (#73)
Running `yarn generate` would change `deprecated_attributes.tsx` and `yarn lint` would complain about it. This makes the file be generated in the expected format. This also prevents biome from trying to format files in `rust/target/*`.
1 parent 228487f commit 1577731

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

biome.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
33
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4-
"files": { "ignoreUnknown": false, "ignore": ["dist/*", "javascript/sentry-conventions/package.json"] },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"ignore": ["dist/*", "javascript/sentry-conventions/package.json", "rust/target/*"]
7+
},
58
"formatter": {
69
"enabled": true,
710
"useEditorconfig": true,

scripts/generate_deprecated_attributes_json.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { execSync } from 'node:child_process';
12
import * as fs from 'node:fs';
23
import * as path from 'node:path';
34

@@ -83,5 +84,13 @@ export async function generateDeprecatedAttributesJSON() {
8384
fs.writeFileSync(deprecatedAttributesFile, JSON.stringify(allDeprecatedAttributes, null, 2));
8485
console.log(`Generated deprecated attributes json: ${deprecatedAttributesFile}`);
8586

87+
// Format the generated file with biome
88+
try {
89+
execSync(`npx biome check --write ${deprecatedAttributesFile}`, { stdio: 'inherit' });
90+
console.log(`Formatted ${deprecatedAttributesFile} with biome`);
91+
} catch (error) {
92+
console.warn(`Warning: Could not format ${deprecatedAttributesFile} with biome:`, error);
93+
}
94+
8695
console.log('Deprecated attributes generation complete!');
8796
}

0 commit comments

Comments
 (0)