Unverified Commit f74bdef4 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add more known folders to is-folder-empty check in create-next-app (#88218)

## What?

Allows creating a new Next.js app when there's an existing `.claude`,
`.vscode`, or `.cursor` folder/file.
parent d13d1ba2
......@@ -4,7 +4,9 @@ import { join } from 'node:path'
import { green, blue } from 'picocolors'
export function isFolderEmpty(root: string, name: string): boolean {
const validFiles = [
const validFilesOrFolders = [
'.claude',
'.cursor',
'.DS_Store',
'.git',
'.gitattributes',
......@@ -16,6 +18,8 @@ export function isFolderEmpty(root: string, name: string): boolean {
'.idea',
'.npmignore',
'.travis.yml',
'.vscode',
'.zed',
'LICENSE',
'Thumbs.db',
'docs',
......@@ -28,10 +32,10 @@ export function isFolderEmpty(root: string, name: string): boolean {
]
const conflicts = readdirSync(root).filter(
(file) =>
!validFiles.includes(file) &&
(fileOrFolder) =>
!validFilesOrFolders.includes(fileOrFolder) &&
// Support IntelliJ IDEA-based editors
!/\.iml$/.test(file)
!/\.iml$/.test(fileOrFolder)
)
if (conflicts.length > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment