Skip to content

Commit 1ed27d1

Browse files
committed
fix: use bundled utils
1 parent f66bec8 commit 1ed27d1

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

actions/unjs/oxfmt.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineAction } from "codeup";
2-
import { runScript } from "../../src/utils/pkg";
32

43
// https://prettier.io/docs/configuration
54
const PRETTIER_CONFIG_FILES = [
@@ -57,6 +56,6 @@ export default defineAction({
5756
await utils.addDevDependency("oxfmt");
5857

5958
// Run oxfmt to format the codebase
60-
await runScript("oxfmt --write .");
59+
await utils.runScript("oxfmt --write .");
6160
},
6261
});

actions/unjs/oxlint.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineAction } from "codeup";
2-
import { runScript } from "../../src/utils/pkg";
32

43
// https://eslint.org/docs/latest/use/configure/configuration-files
54
const ESLINT_CONFIG_FILES = [
@@ -27,7 +26,8 @@ export default defineAction({
2726
async filter({ utils }) {
2827
// Only apply if an eslint config exists
2928
return (
30-
(await utils.existsWithAnyExt("eslint.config")) || (await utils.existsWithAnyExt(".eslintrc"))
29+
(await utils.existsWithAnyExt("eslint.config")) ||
30+
(await utils.existsWithAnyExt(".eslintrc"))
3131
);
3232
},
3333
async apply({ utils }) {
@@ -67,14 +67,20 @@ export default defineAction({
6767
for (const name of ["lint", "lint:fix", "format"]) {
6868
if (pkg.scripts[name]) {
6969
// Replace eslint --fix with oxlint --fix
70-
pkg.scripts[name] = pkg.scripts[name].replace(/eslint\s+--fix\b/g, "oxlint --fix");
70+
pkg.scripts[name] = pkg.scripts[name].replace(
71+
/eslint\s+--fix\b/g,
72+
"oxlint --fix",
73+
);
7174
// Replace eslint with oxlint (for non --fix cases)
72-
pkg.scripts[name] = pkg.scripts[name].replace(/eslint(?!\s+--fix)\b/g, "oxlint");
75+
pkg.scripts[name] = pkg.scripts[name].replace(
76+
/eslint(?!\s+--fix)\b/g,
77+
"oxlint",
78+
);
7379
}
7480
}
7581
});
7682

7783
// Run oxlint --fix to apply fixes
78-
await runScript("oxlint --fix");
84+
await utils.runScript("oxlint --fix");
7985
},
8086
});

0 commit comments

Comments
 (0)