style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -8,59 +8,63 @@
* node scripts/setup-chrome-mcp.mjs doctor # Run a single sub-command
*/
import { execFileSync } from "node:child_process";
import { mkdirSync } from "node:fs";
import { createRequire } from "node:module";
import { homedir } from "node:os";
import { join } from "node:path";
import { execFileSync } from 'node:child_process'
import { mkdirSync } from 'node:fs'
import { createRequire } from 'node:module'
import { homedir } from 'node:os'
import { join } from 'node:path'
if (process.env.CLAUDE_CODE_SKIP_CHROME_MCP_SETUP === "1") {
process.exit(0);
if (process.env.CLAUDE_CODE_SKIP_CHROME_MCP_SETUP === '1') {
process.exit(0)
}
const require = createRequire(import.meta.url);
const cliPath = require.resolve("@claude-code-best/mcp-chrome-bridge/dist/cli.js");
const require = createRequire(import.meta.url)
const cliPath = require.resolve(
'@claude-code-best/mcp-chrome-bridge/dist/cli.js',
)
const userArgs = process.argv.slice(2);
const userArgs = process.argv.slice(2)
function getChromeMcpLogDir() {
const home = homedir();
if (process.platform === "darwin") {
return join(home, "Library", "Logs", "mcp-chrome-bridge");
const home = homedir()
if (process.platform === 'darwin') {
return join(home, 'Library', 'Logs', 'mcp-chrome-bridge')
}
if (process.platform === "win32") {
if (process.platform === 'win32') {
return join(
process.env.LOCALAPPDATA || join(home, "AppData", "Local"),
"mcp-chrome-bridge",
"logs",
);
process.env.LOCALAPPDATA || join(home, 'AppData', 'Local'),
'mcp-chrome-bridge',
'logs',
)
}
return join(
process.env.XDG_STATE_HOME || join(home, ".local", "state"),
"mcp-chrome-bridge",
"logs",
);
process.env.XDG_STATE_HOME || join(home, '.local', 'state'),
'mcp-chrome-bridge',
'logs',
)
}
if (userArgs.length > 0) {
// Forward single sub-command
execFileSync("node", [cliPath, ...userArgs], { stdio: "inherit" });
execFileSync('node', [cliPath, ...userArgs], { stdio: 'inherit' })
} else {
// Full setup sequence
const steps = [
["fix-permissions"],
["register", "--browser", "chrome"],
["doctor"],
];
['fix-permissions'],
['register', '--browser', 'chrome'],
['doctor'],
]
mkdirSync(getChromeMcpLogDir(), { recursive: true });
mkdirSync(getChromeMcpLogDir(), { recursive: true })
for (let i = 0; i < steps.length; i++) {
const args = steps[i];
const isLast = i === steps.length - 1;
if (isLast) console.log(`\n[${i + 1}/${steps.length}] ${args.join(" ")}`);
execFileSync("node", [cliPath, ...args], { stdio: isLast ? "inherit" : "pipe" });
const args = steps[i]
const isLast = i === steps.length - 1
if (isLast) console.log(`\n[${i + 1}/${steps.length}] ${args.join(' ')}`)
execFileSync('node', [cliPath, ...args], {
stdio: isLast ? 'inherit' : 'pipe',
})
}
console.log("\nChrome MCP setup complete!");
console.log('\nChrome MCP setup complete!')
}