gitignore-synthesizer
Version:
Generate smart .gitignore files based on your project's actual contents
30 lines (27 loc) • 546 B
JavaScript
import { globby } from 'globby';
const commonIgnores = [
'.env',
'.DS_Store',
'node_modules/',
'dist/',
'build/',
'coverage/',
'.cache/',
'*.log',
'npm-debug.log*',
'yarn-debug.log*',
'yarn-error.log*',
'.vscode/',
'.idea/',
'Thumbs.db',
];
export async function scanFiles() {
const foundIgnores = [];
for (const pattern of commonIgnores) {
const matches = await globby(pattern);
if (matches.length > 0) {
foundIgnores.push(pattern);
}
}
return foundIgnores;
}