Skip to content

Commit 345cb4b

Browse files
ericapisaniclaude
andcommitted
fix(lint): Replace delete operator with undefined assignment
Biome's noDelete lint rule flags the delete operator for performance. Since changelog is an optional field and JSON.stringify omits undefined values, the behavior is identical. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5d8deca commit 345cb4b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/clear_attribute_changelog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function clearAll(): Promise<void> {
1515
const json: AttributeJson = JSON.parse(content);
1616

1717
if ('changelog' in json) {
18-
delete json.changelog;
18+
json.changelog = undefined;
1919
await fs.promises.writeFile(filePath, `${JSON.stringify(json, null, 2)}\n`, 'utf-8');
2020
count++;
2121
}
@@ -34,7 +34,7 @@ async function clearByKey(key: string): Promise<void> {
3434

3535
if (json.key === key) {
3636
if ('changelog' in json) {
37-
delete json.changelog;
37+
json.changelog = undefined;
3838
await fs.promises.writeFile(filePath, `${JSON.stringify(json, null, 2)}\n`, 'utf-8');
3939
console.log(`Cleared changelog from ${relativeFile}`);
4040
} else {

0 commit comments

Comments
 (0)