mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-16 10:37:20 +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
|
@ -11,10 +11,7 @@ const React = require('react');
|
|||
class Head extends React.Component {
|
||||
render() {
|
||||
const links = this.props.config.headerLinks;
|
||||
let hasBlog = false;
|
||||
links.map(link => {
|
||||
if (link.blog) hasBlog = true;
|
||||
});
|
||||
const hasBlog = links.some(link => link.blog);
|
||||
|
||||
let highlight = {
|
||||
version: '9.12.0',
|
||||
|
@ -137,21 +134,13 @@ class Head extends React.Component {
|
|||
|
||||
{/* External resources */}
|
||||
{this.props.config.stylesheets &&
|
||||
this.props.config.stylesheets.map(function(source, idx) {
|
||||
return (
|
||||
<link rel="stylesheet" key={'stylesheet' + idx} href={source} />
|
||||
);
|
||||
})}
|
||||
this.props.config.stylesheets.map(source => (
|
||||
<link rel="stylesheet" key={source} href={source} />
|
||||
))}
|
||||
{this.props.config.scripts &&
|
||||
this.props.config.scripts.map(function(source, idx) {
|
||||
return (
|
||||
<script
|
||||
type="text/javascript"
|
||||
key={'script' + idx}
|
||||
src={source}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
this.props.config.scripts.map(source => (
|
||||
<script type="text/javascript" key={source} src={source} />
|
||||
))}
|
||||
|
||||
{this.props.config.scrollToTop && (
|
||||
<script
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue