Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fiennyangeln committed Oct 15, 2018
1 parent 5b2f9ab commit 9fedb24
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
47 changes: 23 additions & 24 deletions v1/lib/core/DocsLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ class DocsLayout extends React.Component {
if (this.props.Doc) {
DocComponent = this.props.Doc;
}

let updateTime, updateAuthor;
const filepath = docs.getFilePath(metadata);
if (this.props.config.enableUpdateTime) {
updateTime = getGitLastUpdated(filepath);
}
if (this.props.config.enableUpdateBy) {
updateAuthor = getGitLastUpdatedBy(filepath);
}

const updateTime = this.props.config.enableUpdateTime
? getGitLastUpdated(filepath)
: null;
const updateAuthor = this.props.config.enableUpdateBy
? getGitLastUpdatedBy(filepath)
: null;

const title =
idx(i18n, ['localized-strings', 'docs', id, 'title']) || defaultTitle;
Expand Down Expand Up @@ -95,22 +94,22 @@ class DocsLayout extends React.Component {
language={metadata.language}
/>
{(updateTime || updateAuthor) && (
<div className="docLastUpdate">
{updateTime && (
<em>
<strong>Last updated: </strong>
{updateTime}
</em>
)}
<br />
{updateAuthor && (
<em>
<strong>Last updated by: </strong>
{updateAuthor}
</em>
)}
</div>
)}
<div className="docLastUpdate">
{updateTime && (
<em>
<strong>Last updated: </strong>
{updateTime}
</em>
)}
<br />
{updateAuthor && (
<em>
<strong>Last updated by: </strong>
{updateAuthor}
</em>
)}
</div>
)}

<div className="docs-prevnext">
{metadata.previous_id && (
Expand Down
2 changes: 1 addition & 1 deletion v1/lib/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function getAuthorInformation(filepath) {
let authorData;
results.forEach(result => {
if ((authorData = authorRegex.exec(result)) !== null) {
const lineCount = parseInt(authorData[1]);
const lineCount = parseInt(authorData[1], 10);
const name = authorData[2];
authors.push({
lineCount,
Expand Down

0 comments on commit 9fedb24

Please sign in to comment.