mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-07 10:41:26 +08:00
refactor: rename formatter utilities
This commit is contained in:
13
internal/node-utils/src/formatter.ts
Normal file
13
internal/node-utils/src/formatter.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import fs from 'node:fs/promises';
|
||||
|
||||
import { execa } from 'execa';
|
||||
|
||||
async function formatFile(filepath: string) {
|
||||
await execa('oxfmt', [filepath], {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
return await fs.readFile(filepath, 'utf8');
|
||||
}
|
||||
|
||||
export { formatFile };
|
||||
Reference in New Issue
Block a user