1import { readdirSync } from 'fs'; 2 3// Any of these files are allowed to exist in the projectRoot 4const tolerableFiles = [ 5 // System 6 '.DS_Store', 7 'Thumbs.db', 8 // Git 9 '.git', 10 '.gitattributes', 11 '.gitignore', 12 // Project 13 '.npmignore', 14 'LICENSE', 15 'docs', 16 '.idea', 17 // Package manager 18 'npm-debug.log', 19 'yarn-debug.log', 20 'yarn-error.log', 21]; 22 23export function getConflictsForDirectory(projectRoot: string): string[] { 24 return readdirSync(projectRoot).filter( 25 (file: string) => !(/\.iml$/.test(file) || tolerableFiles.includes(file)) 26 ); 27} 28