Skip to content

Commit b41f72c

Browse files
justin808claude
andcommitted
fix: Fix ESLint and prettier violations in build scripts
- Fixed prettier formatting in scripts/remove-use-strict.js - Changed single quotes to double quotes - Replaced for...of with forEach to comply with no-restricted-syntax - Added parentheses around arrow function parameters - Added eslint-disable comment for console.log - Build process automatically fixed newline issues in: - package/environments/base.js (newline after require) - package/environments/production.js (newline after require) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 9eec417 commit b41f72c

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

scripts/remove-use-strict.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
#!/usr/bin/env node
2-
const fs = require('fs')
3-
const path = require('path')
2+
const fs = require("fs")
3+
const path = require("path")
44

55
// Recursively find all .js files in a directory
66
function findJsFiles(dir) {
77
const files = []
88
const items = fs.readdirSync(dir, { withFileTypes: true })
99

10-
for (const item of items) {
10+
items.forEach((item) => {
1111
const fullPath = path.join(dir, item.name)
1212
if (item.isDirectory()) {
1313
files.push(...findJsFiles(fullPath))
14-
} else if (item.isFile() && item.name.endsWith('.js')) {
14+
} else if (item.isFile() && item.name.endsWith(".js")) {
1515
files.push(fullPath)
1616
}
17-
}
17+
})
1818

1919
return files
2020
}
2121

2222
// Find all .js files in package directory
23-
const files = findJsFiles('package')
23+
const files = findJsFiles("package")
2424

25-
files.forEach(file => {
26-
let content = fs.readFileSync(file, 'utf8')
25+
files.forEach((file) => {
26+
let content = fs.readFileSync(file, "utf8")
2727

2828
// Remove "use strict"; or "use strict" from the beginning of the file
29-
content = content.replace(/^["']use strict["'];?\s*\n?/, '')
29+
content = content.replace(/^["']use strict["'];?\s*\n?/, "")
3030

31-
fs.writeFileSync(file, content, 'utf8')
31+
fs.writeFileSync(file, content, "utf8")
3232
})
3333

34+
// eslint-disable-next-line no-console
3435
console.log(`Removed "use strict" from ${files.length} files`)

0 commit comments

Comments
 (0)