Skip to content

Commit 12faff3

Browse files
committed
fix warnings, remove unused code
1 parent 1ee63a4 commit 12faff3

File tree

15 files changed

+29
-216
lines changed

15 files changed

+29
-216
lines changed

packages/gatsby-theme/gatsby-node.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,15 @@ exports.onCreateBabelConfig = ({ actions }) => {
9999
exports.createPages = require('./createPages')
100100

101101
exports.onCreateNode = require('./onCreateNode')
102+
103+
// Ignore warnings about CSS inclusion order, because we use CSS modules.
104+
// https://spectrum.chat/gatsby-js/general/having-issue-related-to-chunk-commons-mini-css-extract-plugin~0ee9c456-a37e-472a-a1a0-cc36f8ae6033?m=MTU3MjYyNDQ5OTAyNQ==
105+
exports.onCreateWebpackConfig = ({ getConfig }) => {
106+
const config = getConfig()
107+
const miniCssExtractPlugin = config.plugins.find(
108+
plugin => plugin.constructor.name === 'MiniCssExtractPlugin'
109+
)
110+
if (miniCssExtractPlugin) {
111+
miniCssExtractPlugin.options.ignoreOrder = true
112+
}
113+
}

packages/gatsby-theme/src/components/Documentation/RightPanel/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const RightPanel: React.FC<IRightPanelProps> = ({
126126
<>
127127
<div>
128128
<h5 className={styles.header}>Content</h5>
129-
<hr className={styles.separator} />
129+
<hr />
130130
</div>
131131
<div className={styles.contentBlock} ref={contentBlockRef}>
132132
{headings.map(({ slug, text }) => (

packages/gatsby-theme/src/components/HamburgerMenu/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,9 @@ export const HamburgerButton: React.FC<{
217217
opened: boolean
218218
collapsed: boolean
219219
handleClick: (e: MouseEvent) => void
220-
}> = ({ opened, collapsed, handleClick }) => (
220+
}> = ({ opened, handleClick }) => (
221221
<button
222-
className={cn(
223-
styles.toggleButton,
224-
collapsed || styles.expanded,
225-
opened && styles.opened
226-
)}
222+
className={cn(styles.toggleButton, opened && styles.opened)}
227223
onClick={handleClick}
228224
aria-label="Toggle Mobile Menu"
229225
>

packages/gatsby-theme/src/components/LayoutHeader/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ const LayoutHeader: React.FC<ILayoutModifiable> = ({ modifiers }) => {
4242
'ease-in-out',
4343
'delay-150',
4444
'py-2',
45-
'px-3',
46-
collapsed && styles.collapsed
45+
'px-3'
4746
)}
4847
wide
4948
>

packages/gatsby-theme/src/data/headerNav.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/config/index.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/gatsby/models/prune-cache/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
const fs = require('fs')
22

3-
const crawlPageData = require('../../../utils/shared/crawlPageData')
3+
const path = require('upath')
4+
5+
async function crawlPageData(dataPath, onPageData) {
6+
const stat = fs.statSync(dataPath)
7+
if (stat.isDirectory()) {
8+
const paths = fs.readdirSync(dataPath)
9+
return Promise.all(
10+
paths.map(name => crawlPageData(path.join(dataPath, name), onPageData))
11+
)
12+
} else if (path.basename(dataPath) === 'page-data.json') {
13+
return await onPageData(dataPath)
14+
}
15+
}
416

517
async function removeFile(filePath) {
618
return new Promise((resolve, reject) =>

src/html.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* eslint jsx-a11y/html-has-lang:0 */
22

3-
import config from './config'
4-
53
interface IHTMLProps {
64
htmlAttributes: Record<string, unknown>
75
headComponents: Array<React.ReactNode>
@@ -11,8 +9,6 @@ interface IHTMLProps {
119
postBodyComponents: Array<React.ReactNode>
1210
}
1311

14-
const DISABLE_INDEXING = process.env.DISABLE_INDEXING === 'true'
15-
1612
const HTML: React.FC<IHTMLProps> = props => {
1713
return (
1814
<html {...props.htmlAttributes}>
@@ -23,8 +19,6 @@ const HTML: React.FC<IHTMLProps> = props => {
2319
name="viewport"
2420
content="width=device-width, initial-scale=1, shrink-to-fit=no"
2521
/>
26-
{DISABLE_INDEXING && <meta name="robots" content="noindex, nofollow" />}
27-
<meta name="algolia-site-verification" content={config.algolia.appId} />
2822
{props.headComponents}
2923
</head>
3024
<body {...props.bodyAttributes}>

src/utils/algolia-queries.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/utils/format.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)