Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8ffeb33

Browse files
committed
Add support for .oxlintrc.mjs and oxlint.config.ts
1 parent e04cb34 commit 8ffeb33

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.changeset/clean-humans-throw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ultracite": patch
3+
---
4+
5+
Add support for .oxlintrc.mjs and oxlint.config.ts

packages/cli/src/utils.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ const eslintConfigNames = [
121121
"eslint.config.cts",
122122
] as const;
123123

124-
const oxlintConfigName = ".oxlintrc.json";
124+
const oxlintConfigNames = [
125+
".oxlintrc.json",
126+
".oxlintrc.mjs",
127+
"oxlint.config.ts",
128+
];
125129

126130
export const detectLinter = async (): Promise<Linter | null> => {
127131
let dir = process.cwd();
@@ -142,8 +146,10 @@ export const detectLinter = async (): Promise<Linter | null> => {
142146
}
143147

144148
// Check for oxlint config
145-
if (await exists(join(dir, oxlintConfigName))) {
146-
return "oxlint";
149+
for (const name of oxlintConfigNames) {
150+
if (await exists(join(dir, name))) {
151+
return "oxlint";
152+
}
147153
}
148154

149155
const parent = dirname(dir);

0 commit comments

Comments
 (0)