mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 00:39:45 +02:00
Integrate eslint & precommit to codebase (#815)
* add eslint, precommit & refactor * fix exit code 127 * modify contributing.md & add package-lock * use .eslintrc.js
This commit is contained in:
parent
97eaaad744
commit
21dcea2a31
20 changed files with 4836 additions and 2139 deletions
|
@ -5,11 +5,9 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const Metadata = require('./metadata.js');
|
||||
const React = require('react');
|
||||
const Container = require('./Container.js');
|
||||
const SideNav = require('./nav/SideNav.js');
|
||||
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
||||
const readCategories = require('../server/readCategories.js');
|
||||
|
||||
class DocsSidebar extends React.Component {
|
||||
|
|
|
@ -6,12 +6,9 @@
|
|||
*/
|
||||
|
||||
const React = require('react');
|
||||
const fs = require('fs');
|
||||
const Head = require('./Head.js');
|
||||
const translation = require('../server/translation.js');
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
// Component used to provide same head, header, footer, other scripts to all pages
|
||||
class Redirect extends React.Component {
|
||||
render() {
|
||||
|
@ -28,13 +25,9 @@ class Redirect extends React.Component {
|
|||
this.props.config.url +
|
||||
this.props.config.baseUrl +
|
||||
(this.props.url || 'index.html');
|
||||
let latestVersion;
|
||||
|
||||
const redirect = this.props.redirect || false;
|
||||
|
||||
if (fs.existsSync(CWD + '/versions.json')) {
|
||||
latestVersion = require(CWD + '/versions.json')[0];
|
||||
}
|
||||
return (
|
||||
<html>
|
||||
<Head
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
const React = require('react');
|
||||
const renderMarkdown = require('./renderMarkdown.js');
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
class Remarkable extends React.Component {
|
||||
content() {
|
||||
if (this.props.source) {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
const React = require('react');
|
||||
const fs = require('fs');
|
||||
const classNames = require('classnames');
|
||||
|
||||
const HeaderNav = require('./nav/HeaderNav.js');
|
||||
const Head = require('./Head.js');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue