Skip to content
Merged
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
6 changes: 4 additions & 2 deletions apps/oxfmt/src-js/migration/migrate-prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ export async function runMigratePrettier() {

// Migrate `ignorePatterns` from `.prettierignore`
const ignores = await resolvePrettierIgnore(cwd);
if (0 < ignores.length) {
oxfmtrc.ignorePatterns = ignores;
if (ignores.length > 0) {
console.log("Migrated ignore patterns from `.prettierignore`");
}
// Keep ignorePatterns at the bottom
delete oxfmtrc.ignorePatterns;
oxfmtrc.ignorePatterns = ignores;

const jsonStr = JSON.stringify(oxfmtrc, null, 2);

Expand Down
2 changes: 1 addition & 1 deletion apps/oxfmt/src-js/migration/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function createBlankOxfmtrcFile(cwd: string) {
const config: Record<string, unknown> = {
// Add `$schema` field at the top if schema file exists in `node_modules`
$schema: schemaPath,
// `ignorePatterns` is included to make visible and preferred over `.prettierignore`
// `ignorePatterns` is included to make it visible and preferred over `.prettierignore`
ignorePatterns: [],
};

Expand Down
Loading