fix(format): Improve concurrency control in cache and rollback management with mutex locking and refine formatting details
This commit is contained in:
@@ -16,7 +16,12 @@ const prettierDefaultMarkdownConfig: prettier.Options = {
|
||||
parser: 'markdown',
|
||||
};
|
||||
|
||||
const filesToFormat = [`ts/**/*.ts`, `test/**/*.ts`, `readme.md`, `docs/**/*.md`];
|
||||
const filesToFormat = [
|
||||
`ts/**/*.ts`,
|
||||
`test/**/*.ts`,
|
||||
`readme.md`,
|
||||
`docs/**/*.md`,
|
||||
];
|
||||
|
||||
const choosePrettierConfig = (fileArg: plugins.smartfile.SmartFile) => {
|
||||
switch (fileArg.parsedPath.ext) {
|
||||
@@ -39,7 +44,10 @@ const prettierTypeScriptPipestop = plugins.through2.obj(
|
||||
cb(null);
|
||||
} else {
|
||||
logger.log('info', `${fileArg.path} is being reformated!`);
|
||||
const formatedFileString = await prettier.format(fileString, chosenConfig);
|
||||
const formatedFileString = await prettier.format(
|
||||
fileString,
|
||||
chosenConfig,
|
||||
);
|
||||
fileArg.setContentsFromString(formatedFileString);
|
||||
cb(null, fileArg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user