mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
- Add 'npm run checkFile <file>' to run prettier and lint on a single file - Add 'npm run prettier:file <file>' for formatting individual files - Add 'npm run lint:file <file>' for linting individual files - Add 'npm run test:file <file>' for running tests on individual spec files - Create wrapper scripts that show minimal output on success, full output on errors - Update CLAUDE.md to emphasize using checkFile command frequently - Add 25-second timeout for test execution to prevent hanging
36 lines
954 B
JavaScript
36 lines
954 B
JavaScript
#!/usr/bin/env node
|
|
const { execSync } = require('child_process');
|
|
const path = require('path');
|
|
|
|
const file = process.argv[2];
|
|
if (!file) {
|
|
console.error('❌ Please provide a file path');
|
|
process.exit(1);
|
|
}
|
|
|
|
// Get absolute path
|
|
const absolutePath = path.resolve(file);
|
|
|
|
try {
|
|
// Run prettier
|
|
console.log(`🎨 Formatting ${path.basename(file)}...`);
|
|
execSync(`npm run prettier:file ${absolutePath}`, {
|
|
stdio: 'pipe',
|
|
encoding: 'utf8',
|
|
});
|
|
|
|
// Run lint
|
|
console.log(`🔍 Linting ${path.basename(file)}...`);
|
|
const lintOutput = execSync(`npm run lint:file ${absolutePath}`, {
|
|
stdio: 'pipe',
|
|
encoding: 'utf8',
|
|
});
|
|
|
|
// If we get here, both commands succeeded
|
|
console.log(`✅ ${path.basename(file)} - All checks passed!`);
|
|
} catch (error) {
|
|
// If there's an error, show the full output
|
|
console.error('\n❌ Errors found:\n');
|
|
console.error(error.stdout || error.stderr || error.message);
|
|
process.exit(1);
|
|
}
|