updated prettier config

This commit is contained in:
2022-06-09 11:49:13 -05:00
parent ba1ca2fc83
commit 6b5bf9783c
6 changed files with 28 additions and 17 deletions

View File

@@ -10,9 +10,9 @@ const paths_1 = require("./paths");
const readmefile_1 = require("./readmefile");
const build_1 = __importDefault(require("./build"));
const CLIArgs = (0, command_line_args_1.default)([
{ name: 'watch', alias: 'w', type: Boolean },
{ name: 'minify', alias: 'm', type: Boolean },
{ name: 'prettier', alias: 'p', type: Boolean },
{ name: 'watch', alias: 'w', type: Boolean, defaultValue: false },
{ name: 'minify', alias: 'm', type: Boolean, defaultValue: false },
{ name: 'prettier', alias: 'p', type: Boolean, defaultValue: false },
]);
//if package.json doesn't exist then there is no point in continuing
if (!(0, fs_1.existsSync)('package.json') || !(0, fs_1.lstatSync)('package.json').isFile()) {
@@ -21,7 +21,14 @@ if (!(0, fs_1.existsSync)('package.json') || !(0, fs_1.lstatSync)('package.json'
}
//delete compiled scripts
(0, fs_1.readdirSync)(paths_1.DistBase).forEach(file => (0, fs_1.unlinkSync)(`${paths_1.DistBase}/${file}`));
const PrettierConfig = prettier_1.resolveConfig.sync(process.cwd());
//read prettierrc file and make sure `babel` is the configured parser
const PrettierConfig = (() => {
let config = prettier_1.resolveConfig.sync(process.cwd()) || {};
return {
...config,
parser: 'babel',
};
})();
//compile scripts
let scripts = (0, fs_1.readdirSync)(paths_1.ScriptBase);
let scriptMeta = [];