mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
chore(eslint): require curly brackets on all blocks (#2239)
This commit is contained in:
parent
42061c6d83
commit
894dbcff49
3 changed files with 7 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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 => (
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue