cleanup(core): use built in function to strip control chars (#28778)
This commit is contained in:
parent
b925f8ccfa
commit
5d21f215a4
@ -11,8 +11,8 @@ import {
|
|||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { format, resolveConfig } from 'prettier';
|
import { format, resolveConfig } from 'prettier';
|
||||||
import { CommandModule } from 'yargs';
|
import { CommandModule } from 'yargs';
|
||||||
|
import { stripVTControlCharacters } from 'node:util';
|
||||||
|
|
||||||
const stripAnsi = require('strip-ansi');
|
|
||||||
const importFresh = require('import-fresh');
|
const importFresh = require('import-fresh');
|
||||||
|
|
||||||
export function sortAlphabeticallyFunction(a: string, b: string): number {
|
export function sortAlphabeticallyFunction(a: string, b: string): number {
|
||||||
@ -45,7 +45,10 @@ export async function generateMarkdownFile(
|
|||||||
const filePath = join(outputDirectory, `${templateObject.name}.md`);
|
const filePath = join(outputDirectory, `${templateObject.name}.md`);
|
||||||
outputFileSync(
|
outputFileSync(
|
||||||
filePath,
|
filePath,
|
||||||
await formatWithPrettier(filePath, stripAnsi(templateObject.template))
|
await formatWithPrettier(
|
||||||
|
filePath,
|
||||||
|
stripVTControlCharacters(templateObject.template)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user