mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-08 04:17:55 +02:00
chore: eslint & prettier nits
This commit is contained in:
parent
8f493605ad
commit
084063eabe
15 changed files with 152 additions and 142 deletions
|
@ -20,6 +20,9 @@ async function getPort(reqPort) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async function start(siteDir, cliOptions = {}) {
|
module.exports = async function start(siteDir, cliOptions = {}) {
|
||||||
|
console.log('Start command invoked ...');
|
||||||
|
console.log(cliOptions);
|
||||||
|
|
||||||
// Process all related files as a prop
|
// Process all related files as a prop
|
||||||
const props = await load(siteDir);
|
const props = await load(siteDir);
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ module.exports = function loadConfig(siteDir, deleteCache = true) {
|
||||||
];
|
];
|
||||||
const missingFields = requiredFields.filter(field => !config[field]);
|
const missingFields = requiredFields.filter(field => !config[field]);
|
||||||
if (missingFields && missingFields.length > 0) {
|
if (missingFields && missingFields.length > 0) {
|
||||||
throw new Error(missingFields.join(', ') + ' are missing in siteConfig.js');
|
throw new Error(`${missingFields.join(', ')} are missing in siteConfig.js`);
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default () => <div>Baz</div>;
|
export default () => <div>Baz</div>;
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default () => <div>Foo</div>;
|
export default () => <div>Foo</div>;
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default () => <div>Foo in subfolder</div>;
|
export default () => <div>Foo in subfolder</div>;
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
export default () => <div>Index</div>;
|
export default () => <div>Index</div>;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import loadConfig from '@lib/load/config.js';
|
import loadConfig from '@lib/load/config';
|
||||||
|
|
||||||
describe('loadConfig', () => {
|
describe('loadConfig', () => {
|
||||||
test('website with valid siteConfig', () => {
|
test('website with valid siteConfig', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import loadDocs from '@lib/load/docs.js';
|
import loadDocs from '@lib/load/docs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
describe('loadDocs', () => {
|
describe('loadDocs', () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import loadPages from '@lib/load/pages.js';
|
import loadPages from '@lib/load/pages';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
describe('loadPages', () => {
|
describe('loadPages', () => {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import path from 'path';
|
import {fileToPath, fileToComponentName} from '@lib/load/utils';
|
||||||
import {fileToPath, fileToComponentName} from '@lib/load/utils.js';
|
|
||||||
|
|
||||||
describe('load utils', () => {
|
describe('load utils', () => {
|
||||||
test('fileToComponentName', () => {
|
test('fileToComponentName', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue