Skip to content

Commit def5db7

Browse files
committed
🎨 Running formatter
1 parent 44760e1 commit def5db7

File tree

11 files changed

+31
-31
lines changed

11 files changed

+31
-31
lines changed

theme/plugins/check-links/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function getHeadingsMapKey(link, path) {
2727
return {
2828
key,
2929
hasHash,
30-
hashId
30+
hashId,
3131
}
3232
}
3333

@@ -57,7 +57,7 @@ module.exports = async (
5757
if (node.url.startsWith('#') || !/:[0-9]*\/\//.test(node.url)) {
5858
links.push({
5959
...node,
60-
frontmatter: markdownNode.frontmatter
60+
frontmatter: markdownNode.frontmatter,
6161
})
6262
}
6363
}
@@ -70,7 +70,7 @@ module.exports = async (
7070
path: withPathPrefix(slug),
7171
links,
7272
headings,
73-
setAt
73+
setAt,
7474
})
7575

7676
// wait to see if all of the Markdown and MDX has been visited
@@ -114,7 +114,7 @@ module.exports = async (
114114

115115
const linksForPath = linksMap[path]
116116
if (linksForPath.length) {
117-
const brokenLinks = linksForPath.filter(link => {
117+
const brokenLinks = linksForPath.filter((link) => {
118118
// return true for broken links, false = pass
119119
const { key, hasHash, hashId } = getHeadingsMapKey(link.url, path)
120120
if (prefixedExceptions.includes(key)) {
@@ -151,7 +151,7 @@ module.exports = async (
151151

152152
prefix = [
153153
String(line + offset).padStart(3, ' '),
154-
String(column).padEnd(4, ' ')
154+
String(column).padEnd(4, ' '),
155155
].join(':')
156156
}
157157
console.warn(`${prefix} ${link.url}`)

theme/plugins/fix-mermaid-post/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const visit = require('unist-util-visit')
22
module.exports = ({ markdownAST }, pluginOptions) => {
3-
visit(markdownAST, 'html', node => {
3+
visit(markdownAST, 'html', (node) => {
44
let { value, lang } = node
55
if (lang === 'mermaid') {
66
// Remove first style tag - then we can just use a single import

theme/plugins/fix-mermaid-pre/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const visit = require('unist-util-visit')
22
module.exports = ({ markdownAST }, pluginOptions) => {
3-
visit(markdownAST, 'code', node => {
3+
visit(markdownAST, 'code', (node) => {
44
let { value, lang } = node
55
if (lang === 'mermaid') {
66
value = value.replace(/<<(join|fork)>>/g, '[[$1]]', 'g')

theme/src/components/Tree.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const Tree = ({
1818
location,
1919
ignoreIndex = true,
2020
current = '',
21-
data
21+
data,
2222
}: TreeProps) => {
2323
const { navigate, collapsed, setCollapsed } = useContext(DocsContext)
2424
const isActive = (id: string) => current === id
@@ -29,18 +29,18 @@ export const Tree = ({
2929
location.pathname.startsWith(withPrefix(item.slug))) ||
3030
false
3131

32-
const toggle = id => {
32+
const toggle = (id) => {
3333
setCollapsed({
3434
...collapsed,
35-
[id]: !collapsed[id]
35+
[id]: !collapsed[id],
3636
})
3737
}
3838

3939
const navigateItem = (index: number) => {
4040
navigate(firstUrl(data.items[index]))
4141
}
4242

43-
const index = data.items.findIndex(item => isParent(item))
43+
const index = data.items.findIndex((item) => isParent(item))
4444

4545
const navigateDown = useCallback(() => {
4646
if (index === -1) {

theme/src/layout/docs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import '../style/mermaid.css'
55

66
export default ({ data }) => {
77
const {
8-
docs: { body, tableOfContents }
8+
docs: { body, tableOfContents },
99
} = data
1010
return <Markdown>{body}</Markdown>
1111
}

theme/src/layout/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Layout } from '../components/Layout'
33

4-
export default props => {
4+
export default (props) => {
55
const { children, pageContext, location } = props
66

77
// Pass through when in print mode

theme/src/print/Classification.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import React from 'react'
22
import { styled, Text } from '@committed/components'
33

44
const StyledText = styled(Text)({
5-
textTransform: 'uppercase'
5+
textTransform: 'uppercase',
66
})
77

8-
export const Classification = props => (
8+
export const Classification = (props) => (
99
<>{props.children && <StyledText {...props} />}</>
1010
)

theme/src/print/Footer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export const Footer = () => {
99
const {
1010
site: {
1111
siteMetadata: {
12-
print: { classification, reference }
13-
}
14-
}
12+
print: { classification, reference },
13+
},
14+
},
1515
} = useStaticQuery(
1616
graphql`
1717
query printFooterQuery {

theme/src/print/Header.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export const Header = () => {
77
const {
88
site: {
99
siteMetadata: {
10-
print: { classification }
11-
}
12-
}
10+
print: { classification },
11+
},
12+
},
1313
} = useStaticQuery(
1414
graphql`
1515
query printHeaderQuery {

theme/src/print/Reference.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import { styled, Text } from '@committed/components'
33

44
const StyledText = styled(Text)({})
55

6-
export const Reference = props => (
6+
export const Reference = (props) => (
77
<>{props.children && <StyledText {...props} />}</>
88
)

theme/src/util/node.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const startCase = require('lodash.startcase')
22

3-
exports.makeSlug = parent => {
3+
exports.makeSlug = (parent) => {
44
return `/${parent.relativePath}`
55
.replace(parent.ext, '') // remove file extension
66
.replace(/\/?index$/, '/') // change 'index' for trailing slash
77
.toLowerCase()
88
}
99

10-
const calculateTree = edges =>
10+
const calculateTree = (edges) =>
1111
edges.reduce(
1212
(accu, { node: { id, slug, title, order } }) => {
1313
const parts = slug.split('/')
@@ -37,23 +37,23 @@ const calculateTree = edges =>
3737
slug,
3838
label: startCase(parts[parts.length - 1]),
3939
items: [],
40-
info
40+
info,
4141
})
4242
}
4343
return accu
4444
},
4545
{ slug: '/', label: 'Index', items: new Array() }
4646
)
4747

48-
const itemOrder = item => (item.info ? item.info.order : item.label)
48+
const itemOrder = (item) => (item.info ? item.info.order : item.label)
4949

50-
const sortItems = items =>
50+
const sortItems = (items) =>
5151
items.sort((a, b) =>
5252
itemOrder(a).localeCompare(itemOrder(b), 'en', { numeric: true })
5353
)
5454

55-
const sortNode = node => {
56-
node.items.forEach(node => sortNode(node))
55+
const sortNode = (node) => {
56+
node.items.forEach((node) => sortNode(node))
5757
node.items = sortItems(node.items)
5858
return node
5959
}
@@ -66,10 +66,10 @@ const flattenNode = (flattened, node) => {
6666
if (node.info) {
6767
flattened.push(node.info)
6868
}
69-
node.items.forEach(item => flattenNode(flattened, item))
69+
node.items.forEach((item) => flattenNode(flattened, item))
7070
}
7171

72-
exports.flattenTree = root => {
72+
exports.flattenTree = (root) => {
7373
const flattened = new Array()
7474
flattenNode(flattened, root)
7575
return flattened

0 commit comments

Comments
 (0)