Awesome tool!!! I am so glad that you spent the time to put this together. Thank you so much!
I'm new to js/ts/node etc, so I might just be doing something wrong, but setting the indentSpaceCount doesn't seem to change anything (it always just uses four spaces). Here is the code I put together (any feedback is welcome).
var {BrightScriptFormatter} = require('brightscript-formatter');
var fs = require('fs');
// print process.argv
inputFile = process.argv[2];
function readWrite() {
fs.readFile(inputFile, 'utf8', function(err, data) {
if (err) throw err;
var bsf = new BrightScriptFormatter();
var options = {
indentStyle: 'spaces',
indentSpaceCount: 2,
keywordCase: 'lower',
compositeKeywords: 'split'
};
newValue = bsf.format(data, options);
fs.writeFile(inputFile, newValue, 'utf8', function (err) {
if (err) throw err;
});
});
}
readWrite();
Awesome tool!!! I am so glad that you spent the time to put this together. Thank you so much! I'm new to js/ts/node etc, so I might just be doing something wrong, but setting the indentSpaceCount doesn't seem to change anything (it always just uses four spaces). Here is the code I put together (any feedback is welcome).