import fs from 'node:fs' import fg from 'fast-glob' import path from 'node:path' type VueFilesByGroup = { typeCheckable: string[] nonTypeCheckable: string[] } export default function groupVueFiles(rootDir: string): VueFilesByGroup { const { vueFilesWithScriptTs, otherVueFiles } = fg .sync(['**/*.vue'], { cwd: rootDir, ignore: ['**/node_modules/**'], }) .reduce( (acc, file) => { const absolutePath = path.resolve(rootDir, file) const contents = fs.readFileSync(absolutePath, 'utf8') // contents matches the