mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 06:27:02 +02:00
ESLintify Part 1 (#837)
* ESLint-ify * Allow empty try/catch * Escape regexp
This commit is contained in:
parent
128dbfca0a
commit
e8e3f42685
44 changed files with 466 additions and 555 deletions
|
@ -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
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue