Skip to content

Commit

Permalink
chore(eslint): require curly brackets on all blocks (#2239)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored and yangshun committed Jan 24, 2020
1 parent 42061c6 commit 894dbcf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = {
'jsx-a11y/no-noninteractive-element-interactions': WARNING,
'no-console': OFF,
'no-underscore-dangle': OFF,
curly: [WARNING, 'all'],
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
'react/jsx-filename-extension': OFF,
'react/jsx-one-expression-per-line': OFF,
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus-theme-classic/src/theme/DocItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function DocTOC({headings}) {

/* eslint-disable jsx-a11y/control-has-associated-label */
function Headings({headings, isChild}) {
if (!headings.length) return null;
if (!headings.length) {
return null;
}
return (
<ul className={isChild ? '' : 'contents contents__left-border'}>
{headings.map(heading => (
Expand Down
4 changes: 3 additions & 1 deletion packages/docusaurus/src/client/PendingNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class PendingNavigation extends React.Component {
} else {
const id = hash.substring(1);
const element = document.getElementById(id);
if (element) element.scrollIntoView();
if (element) {
element.scrollIntoView();
}
}
})
.catch(e => console.warn(e));
Expand Down

0 comments on commit 894dbcf

Please sign in to comment.