ESLintify Part 2 (#841)

* ESLintify Part 2

* Fix

* Fix tests

* Fix tests

* Fix tests
This commit is contained in:
Yangshun Tay 2018-07-10 21:53:08 -07:00 committed by GitHub
parent 4267337fb0
commit 5ac2cee658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 188 additions and 190 deletions

View file

@ -80,7 +80,7 @@ const versionFolder = CWD + '/versioned_docs/version-' + version;
mkdirp.sync(versionFolder);
// copy necessary files to new version, changing some of its metadata to reflect the versioning
let files = glob.sync(CWD + '/../' + readMetadata.getDocsPath() + '/**');
const files = glob.sync(CWD + '/../' + readMetadata.getDocsPath() + '/**');
files.forEach(file => {
const ext = path.extname(file);
if (ext !== '.md' && ext !== '.markdown') {
@ -88,12 +88,12 @@ files.forEach(file => {
}
const res = metadataUtils.extractMetadata(fs.readFileSync(file, 'utf8'));
let metadata = res.metadata;
const metadata = res.metadata;
// Don't version any docs without any metadata whatsoever.
if (Object.keys(metadata).length === 0) {
return;
}
let rawContent = res.rawContent;
const rawContent = res.rawContent;
if (!metadata.id) {
metadata.id = path.basename(file, path.extname(file));
}