chore(eslint): require curly brackets on all blocks (#2239)

This commit is contained in:
Alexey Pyltsyn 2020-01-24 08:28:56 +03:00 committed by Yangshun Tay
parent 42061c6d83
commit 894dbcff49
3 changed files with 7 additions and 2 deletions

View file

@ -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,

View file

@ -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 => (

View file

@ -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));