15 lines
No EOL
523 B
TypeScript
Executable file
15 lines
No EOL
523 B
TypeScript
Executable file
import { Project } from 'ts-morph';
|
|
|
|
const project = new Project({ tsConfigFilePath: './tsconfig.json' });
|
|
|
|
for (const sourceFile of project.getSourceFiles()) {
|
|
const filePath = sourceFile.getFilePath();
|
|
if (filePath.includes('__tests__') || filePath.includes('components') || filePath.includes('pages/Runboard')) {
|
|
sourceFile.fixMissingImports();
|
|
sourceFile.organizeImports();
|
|
sourceFile.fixUnusedIdentifiers();
|
|
}
|
|
}
|
|
|
|
project.saveSync();
|
|
console.log('Fixed imports and unused identifiers.'); |