Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/groupVueFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type VueFilesByGroup = {
export default function groupVueFiles(
rootDir: string,
globalIgnores: string[],
includeDotFolders?: boolean,
): VueFilesByGroup {
debug(`Grouping .vue files in ${rootDir}`)

Expand All @@ -34,6 +35,7 @@ export default function groupVueFiles(
.sync(['**/*.vue'], {
cwd: rootDir,
ignore,
dot: includeDotFolders,
})
.reduce(
(acc, file) => {
Expand Down
16 changes: 15 additions & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
Expand All @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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(
Expand Down