Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Use same quote style within verify-readme.js
Browse files Browse the repository at this point in the history
Switch to single quotes which is used more widely in obt.
  • Loading branch information
notlee committed Aug 11, 2020
1 parent 53cdb76 commit cd40b23
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/tasks/verify-readme.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
"use strict";
'use strict';

const process = require("process");
const process = require('process');
const {
promises: {readFile},
} = require("fs");
const path = require("path");
const isCI = require("is-ci");
const vfile = require("vfile");
} = require('fs');
const path = require('path');
const isCI = require('is-ci');
const vfile = require('vfile');
const fs = require('fs-extra');
const remark = require("remark");
const remarkLint = require("remark-lint");
const origamiPreset = require("remark-preset-lint-origami-component");
const report = require("vfile-reporter");
const remark = require('remark');
const remarkLint = require('remark-lint');
const origamiPreset = require('remark-preset-lint-origami-component');
const report = require('vfile-reporter');
const log = require('../helpers/log');

async function origamiJson(config) {
// Error if there is no readme to verify.
const readmePath = path.join(config.cwd, "/README.md");
const readmePath = path.join(config.cwd, '/README.md');
const hasReadme = await fs.exists(readmePath);
if (!hasReadme) {
throw new Error('Components require a README.md with documentation.');
}

const contents = await readFile(readmePath, {
encoding: "utf-8",
encoding: 'utf-8',
});

const readme = vfile({
Expand All @@ -50,22 +50,22 @@ async function origamiJson(config) {
if (result.messages.length) {
if (isCI) {
result.messages.forEach(issue => {
const newLine = "%0A";
const newLine = '%0A';
const message = issue.message.replace(/\n/g, newLine);
const line = issue.line;
const column = issue.column;
const code = issue.ruleId;
const severity = issue.severity === 2 ? "error" : "warning";
const severity = issue.severity === 2 ? 'error' : 'warning';
console.log(
`::${severity} file=README.md,line=${line},col=${column},code=${code},severity=${severity}::${message}`
);
});
} else {
log.secondary(
"README.md errors: \n\n" +
'README.md errors: \n\n' +
report(result, {
color: false,
}).replace(new RegExp(config.cwd, "gi"), ".")
}).replace(new RegExp(config.cwd, 'gi'), '.')
);
}
}
Expand All @@ -76,7 +76,7 @@ module.exports = cfg => {
config.cwd = config.cwd || process.cwd();

return {
title: "Verifying your component's README.md",
title: 'Verifying your component\'s README.md',
task: () => origamiJson(config),
};
};

0 comments on commit cd40b23

Please sign in to comment.