ESLintify Part 1 (#837)

* ESLint-ify

* Allow empty try/catch

* Escape regexp
This commit is contained in:
Yangshun Tay 2018-07-08 09:13:18 -07:00 committed by GitHub
parent 128dbfca0a
commit e8e3f42685
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 466 additions and 555 deletions

View file

@ -7,11 +7,13 @@
* LICENSE file in the root directory of this source tree.
*/
const program = require('commander');
const chalk = require('chalk');
const glob = require('glob');
const fs = require('fs-extra');
const path = require('path');
const mkdirp = require('mkdirp');
const chalk = require('chalk');
const path = require('path');
const readMetadata = require('./server/readMetadata.js');
const utils = require('./server/utils.js');
const versionFallback = require('./server/versionFallback.js');
@ -28,7 +30,6 @@ if (fs.existsSync(CWD + '/versions.json')) {
let version;
const program = require('commander');
program
.arguments('<version>')
.action(ver => {
@ -130,16 +131,18 @@ if (versionFallback.diffLatestSidebar()) {
const versioned = {};
Object.keys(sidebar).forEach(sb => {
const version_sb = 'version-' + version + '-' + sb;
versioned[version_sb] = {};
const versionSidebar = 'version-' + version + '-' + sb;
versioned[versionSidebar] = {};
const categories = sidebar[sb];
Object.keys(categories).forEach(category => {
versioned[version_sb][category] = [];
versioned[versionSidebar][category] = [];
const ids = categories[category];
ids.forEach((id, index) => {
versioned[version_sb][category].push('version-' + version + '-' + id);
ids.forEach(id => {
versioned[versionSidebar][category].push(
'version-' + version + '-' + id
);
});
});
});