fix comments

This commit is contained in:
atomiks
2017-12-28 18:24:25 +11:00
parent c68cb5e748
commit f42d37e8ac

View File

@ -35,9 +35,8 @@ try {
let counter = 0; let counter = 0;
while (match) { while (match) {
snippet.code.push(match[1]); // capture group snippet.code.push(match[1]); // capture group
snippet.tempNames.push(snippet.name.replace('.md', counter)); snippet.tempNames.push(snippet.name.replace('.md', counter++));
match = codeRE.exec(snippet.data); match = codeRE.exec(snippet.data);
counter++;
} }
snippet.code.forEach((str, i) => { snippet.code.forEach((str, i) => {
@ -46,11 +45,10 @@ try {
} }
const cmd = `semistandard "${TEMP_PATH}" --fix & ` + const cmd = `semistandard "${TEMP_PATH}" --fix & ` +
`prettier "${TEMP_PATH}/*.js" --single-quote --print-width=100 --write` `prettier "${TEMP_PATH}/*.js" --single-quote --print-width=100 --write`;
cp.exec(cmd, {}, (err, stdout, stderr) => { cp.exec(cmd, {}, (err, stdout, stderr) => {
// Loop through each snippet now that semistandard has done its job, // Loop through each snippet now that semistandard and prettier did their job,
// run prettier and write to the files
for (const snippet of snippets) { for (const snippet of snippets) {
// an array to store each linted code block (definition + example) // an array to store each linted code block (definition + example)
const lintedCode = []; const lintedCode = [];