diff --git a/src/groupVueFiles.ts b/src/groupVueFiles.ts index 814bb6bb..103a94c3 100644 --- a/src/groupVueFiles.ts +++ b/src/groupVueFiles.ts @@ -13,6 +13,7 @@ type VueFilesByGroup = { export default function groupVueFiles( rootDir: string, globalIgnores: string[], + includeDotFolders?: boolean, ): VueFilesByGroup { debug(`Grouping .vue files in ${rootDir}`) @@ -34,6 +35,7 @@ export default function groupVueFiles( .sync(['**/*.vue'], { cwd: rootDir, ignore, + dot: includeDotFolders, }) .reduce( (acc, file) => { diff --git a/src/utilities.ts b/src/utilities.ts index 88a1ebf3..d202f9b0 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -62,6 +62,12 @@ export type ProjectOptions = { */ allowComponentTypeUnsafety?: boolean + /** + * Allow patterns to match entries that begin with a period (.). + * Default is `false`. + */ + includeDotFolders?: boolean + /** * The root directory of the project. * Defaults to `process.cwd()`. @@ -73,6 +79,7 @@ let projectOptions = { tsSyntaxInTemplates: true as boolean, scriptLangs: ['ts'] as ScriptLang[], allowComponentTypeUnsafety: true as boolean, + includeDotFolders: false as boolean, rootDir: process.cwd(), } satisfies ProjectOptions @@ -92,6 +99,9 @@ export function configureVueProject(userOptions: ProjectOptions): void { if (userOptions.rootDir) { projectOptions.rootDir = userOptions.rootDir } + if (userOptions.includeDotFolders) { + projectOptions.includeDotFolders = userOptions.includeDotFolders + } } // The *Raw* types are those with placeholders not yet resolved. @@ -232,7 +242,11 @@ function insertAndReorderConfigs(configs: RawConfigItem[]): RawConfigItem[] { return configs } - const vueFiles = groupVueFiles(projectOptions.rootDir, globalIgnores) + const vueFiles = groupVueFiles( + projectOptions.rootDir, + globalIgnores, + projectOptions.includeDotFolders, + ) const configsWithoutTypeAwareRules = configs.map(extractTypeAwareRules) const hasTypeAwareConfigs = configs.some(