Skip to content

Commit 4a765b5

Browse files
renovate[bot]renovate-botwardpeetLekoArtsgatsbybot
authored
chore(deps): update formatting & linting (#32626)
Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: LekoArts <[email protected]> Co-authored-by: gatsbybot <[email protected]>
1 parent 2502250 commit 4a765b5

File tree

176 files changed

+1954
-2130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+1954
-2130
lines changed

deprecated-packages/gatsby-image/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ While you could achieve a similar effect with plain CSS media queries, `gatsby-i
400400
| `fluid` | `object` / `array` | Data returned from the `fluid` query. When prop is an array it has to be combined with `media` keys, allows for art directing `fluid` images. |
401401
| `fadeIn` | `bool` | Defaults to fading in the image on load |
402402
| `durationFadeIn` | `number` | fading duration is set up to 500ms by default |
403-
| `title` | `string` | Passed to the `img` element | |
403+
| `title` | `string` | Passed to the `img` element |
404404
| `alt` | `string` | Passed to the `img` element. Defaults to an empty string `alt=""` |
405405
| `crossOrigin` | `string` | Passed to the `img` element |
406406
| `className` | `string` / `object` | Passed to the wrapper element. Object is needed to support Glamor's css prop |

docs/docs/conceptual/gatsby-for-ecommerce.md

-2
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ E-commerce tends to have a number of specific requirements. When building a Gats
4444

4545
<Announcement style={{ marginBottom: "1.5rem" }}>
4646

47-
4847
Check out our [e-commerce demo](https://shopify-demo.gatsbyjs.com/) built with our Shopify Starter, a proof of concept showcasing 10,000 products and 30,000 SKUs (variants).
4948
Clone our Shopify Starter, host it on Gatsby and connect it to your own Shopify data to develop your own proof of concept in as little as an hour.
5049

5150
</Announcement>
5251

53-
5452
- [What is Headless Commerce?](https://www.bigcommerce.com/articles/headless-commerce/#unlocking-flexibility-examples-of-headless-commerce-in-action), an overview from BigCommerce.
5553
- [Gatsby Shopify Starter](https://shopify-demo.gatsbyjs.com/)
5654
- Sell Things Fast With Gatsby and Shopify by Trevor Harmon [blog post](https://thetrevorharmon.com/blog/sell-things-fast-with-gatsby-and-shopify), [video](https://www.youtube.com/watch?v=tUtuGAFOjYI&t=16m59s) and [GitHub repo](https://github.com/thetrevorharmon/sell-things-fast/)

docs/docs/conceptual/graphql-concepts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export const markdownFrontmatterFragment = graphql`
257257
They can then be used in any GraphQL query after that!
258258
259259
```graphql
260-
query($path: String!) {
260+
query ($path: String!) {
261261
markdownRemark(frontmatter: { path: { eq: $path } }) {
262262
...MarkdownFrontmatter
263263
}

docs/docs/how-to/adding-common-features/adding-search.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are three required components for adding search to your Gatsby website: th
1010
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1111
| **Search index** | The search index is a copy of your data stored in a search-friendly format. An index is for optimizing speed and performance when executing a search query. Without an index, every search would need to scan every page in your site—which quickly becomes inefficient. |
1212
| **Search engine** | The search engine indexes your content, takes a search query, runs it through the index, and returns any matching documents. Search engines can be hosted services (like Algolia) or open-source that you can self-host (like Elastic) |
13-
| **Search UI** | A UI component on your site that allows users to write search queries and view the results of each query. Some search providers provide out of the box React components that you can drop into Gatsby sites. | |
13+
| **Search UI** | A UI component on your site that allows users to write search queries and view the results of each query. Some search providers provide out of the box React components that you can drop into Gatsby sites. |
1414

1515
## Adding search to your site
1616

docs/docs/how-to/images-and-media/importing-assets-into-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Hi, this is a great article.
129129
In an article template component file, you can then query for the attachments:
130130

131131
```graphql
132-
query($slug: String!) {
132+
query ($slug: String!) {
133133
markdownRemark(fields: { slug: { eq: $slug } }) {
134134
html
135135
frontmatter {

docs/docs/reference/config-files/gatsby-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ You may need to install the appropriate file transformer (in this case [YAML](/p
214214
Gatsby then uses this mapping when creating the GraphQL schema to enable you to query data from both sources:
215215

216216
```graphql
217-
query($slug: String!) {
217+
query ($slug: String!) {
218218
markdownRemark(fields: { slug: { eq: $slug } }) {
219219
html
220220
fields {

docs/docs/sourcing-from-builder-io.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ For example to get the entries from your models `myHeader`, `myFooter`:
4848
Or you can query by urlPath for your page models:
4949

5050
```graphql
51-
query($path: String!) {
51+
query ($path: String!) {
5252
allBuilderModels {
5353
myPageModel(
5454
target: { urlPath: $path }

examples/using-remark/src/pages/2018-01-27---custom-components/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ In order to display this component within a Markdown file, you'll need to add a
108108
})
109109
110110
export const renderAst = (ast: any): JSX.Element => {
111-
return (processor.stringify(ast) as unknown) as JSX.Element
111+
return processor.stringify(ast) as unknown as JSX.Element
112112
}
113113
```
114114

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"danger": "^10.6.4",
3737
"date-fns": "^1.30.1",
3838
"dictionary-en": "^3.1.0",
39-
"eslint": "^7.28.0",
39+
"eslint": "^7.32.0",
4040
"eslint-config-google": "^0.14.0",
4141
"eslint-config-prettier": "^8.3.0",
4242
"eslint-plugin-filenames": "^1.3.2",
43-
"eslint-plugin-flowtype": "^5.7.2",
43+
"eslint-plugin-flowtype": "^5.9.0",
4444
"eslint-plugin-import": "^2.23.4",
4545
"eslint-plugin-jsx-a11y": "^6.4.1",
4646
"eslint-plugin-prettier": "^3.4.0",
@@ -64,7 +64,7 @@
6464
"npm-packlist": "^2.1.5",
6565
"npm-run-all": "4.1.5",
6666
"plop": "^1.9.1",
67-
"prettier": "2.1.2",
67+
"prettier": "2.3.2",
6868
"remark": "^13.0.0",
6969
"remark-cli": "^9.0.0",
7070
"remark-frontmatter": "^3.0.0",

packages/babel-plugin-remove-graphql-queries/src/index.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ function getTagImport(tag: NodePath<Identifier>): NodePath | null {
138138
path.isVariableDeclarator() &&
139139
(path.get(`init`) as NodePath).isCallExpression() &&
140140
(path.get(`init.callee`) as NodePath).isIdentifier({ name: `require` }) &&
141-
((path.get(`init`) as NodePath<CallExpression>).node
142-
.arguments[0] as StringLiteral).value === `gatsby`
141+
(
142+
(path.get(`init`) as NodePath<CallExpression>).node
143+
.arguments[0] as StringLiteral
144+
).value === `gatsby`
143145
) {
144146
const id = path.get(`id`) as NodePath
145147
if (id.isObjectPattern()) {
@@ -294,9 +296,8 @@ export default function ({ types: t }): PluginObj {
294296
)
295297
)
296298
// Add import
297-
const importDefaultSpecifier = t.importDefaultSpecifier(
298-
identifier
299-
)
299+
const importDefaultSpecifier =
300+
t.importDefaultSpecifier(identifier)
300301
const importDeclaration = t.importDeclaration(
301302
[importDefaultSpecifier],
302303
t.stringLiteral(
@@ -337,9 +338,9 @@ export default function ({ types: t }): PluginObj {
337338
// cannot remove all 'gatsby' imports.
338339
if (path2.node.callee.type !== `MemberExpression`) {
339340
// Remove imports to useStaticQuery
340-
const importPath = (path2.scope.getBinding(
341-
`useStaticQuery`
342-
) as Binding).path
341+
const importPath = (
342+
path2.scope.getBinding(`useStaticQuery`) as Binding
343+
).path
343344
const parent = importPath.parentPath
344345
if (importPath.isImportSpecifier())
345346
if (
@@ -356,9 +357,8 @@ export default function ({ types: t }): PluginObj {
356357
)
357358

358359
// Add import
359-
const importDefaultSpecifier = t.importDefaultSpecifier(
360-
identifier
361-
)
360+
const importDefaultSpecifier =
361+
t.importDefaultSpecifier(identifier)
362362
const importDeclaration = t.importDeclaration(
363363
[importDefaultSpecifier],
364364
t.stringLiteral(

packages/babel-preset-gatsby/src/optimize-hook-destructuring.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Program } from "@babel/types"
66
const isHook = /^use[A-Z]/
77

88
// matches only built-in hooks provided by React et al
9-
const isBuiltInHook = /^use(Callback|Context|DebugValue|Effect|ImperativeHandle|LayoutEffect|Memo|Reducer|Ref|State)$/
9+
const isBuiltInHook =
10+
/^use(Callback|Context|DebugValue|Effect|ImperativeHandle|LayoutEffect|Memo|Reducer|Ref|State)$/
1011

1112
interface IState {
1213
opts?: {

packages/gatsby-admin/src/pages/plugins.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ export default function PluginView(
107107
},
108108
})
109109

110-
const { fetching: fetchingNpmData, data: npmData } = useNpmPackageData(
111-
pluginName
112-
)
110+
const { fetching: fetchingNpmData, data: npmData } =
111+
useNpmPackageData(pluginName)
113112

114113
const [{ fetching: updatingGatsbyPlugin }, updateGatsbyPlugin] = useMutation(`
115114
mutation updateGatsbyPlugin(
@@ -147,10 +146,8 @@ export default function PluginView(
147146
}
148147
`)
149148

150-
const [
151-
{ fetching: installingGatsbyPlugin },
152-
installGatsbyPlugin,
153-
] = useMutation(`
149+
const [{ fetching: installingGatsbyPlugin }, installGatsbyPlugin] =
150+
useMutation(`
154151
mutation installGatsbyPlugin($name: String!) {
155152
createNpmPackage(npmPackage: {
156153
name: $name,

packages/gatsby-cli/src/create-cli.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import { whoami } from "./whoami"
2121
import { getPackageManager, setPackageManager } from "./util/package-manager"
2222
import reporter from "./reporter"
2323

24-
const handlerP = (fn: (args: yargs.Arguments) => void) => (
25-
args: yargs.Arguments
26-
): void => {
27-
Promise.resolve(fn(args)).then(
28-
() => process.exit(0),
29-
err => report.panic(err)
30-
)
31-
}
24+
const handlerP =
25+
(fn: (args: yargs.Arguments) => void) =>
26+
(args: yargs.Arguments): void => {
27+
Promise.resolve(fn(args)).then(
28+
() => process.exit(0),
29+
err => report.panic(err)
30+
)
31+
}
3232

3333
function buildLocalCommands(cli: yargs.Argv, isLocalSite: boolean): void {
3434
const defaultHost = `localhost`

packages/gatsby-cli/src/reporter/__tests__/patch-console.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe(`patchConsole`, () => {
88
info: jest.fn(),
99
}
1010

11-
patchConsole((reporter as unknown) as typeof gatsbyReporter)
11+
patchConsole(reporter as unknown as typeof gatsbyReporter)
1212
;[`info`, `log`, `warn`].forEach(method => {
1313
describe(method, () => {
1414
beforeEach(reporter[method].mockReset)
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { FunctionComponent } from "react"
22
import { Text, TextProps } from "ink"
33

4-
export const createLabel = (
5-
text: string,
6-
color: string
7-
): FunctionComponent<TextProps> => (...props): JSX.Element => (
8-
<Text color={color} {...props}>
9-
{text}
10-
</Text>
11-
)
4+
export const createLabel =
5+
(text: string, color: string): FunctionComponent<TextProps> =>
6+
(...props): JSX.Element =>
7+
(
8+
<Text color={color} {...props}>
9+
{text}
10+
</Text>
11+
)

packages/gatsby-cli/src/reporter/loggers/ink/context.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import { IGatsbyState } from "gatsby/src/redux/types"
77
// to not use it's own store temporarily.
88
// By the time this is actually running, it will become an `IGatsbyState`
99
const StoreStateContext = createContext<IGatsbyState>(
10-
(getStore().getState() as any) as IGatsbyState
10+
getStore().getState() as any as IGatsbyState
1111
)
1212

1313
export const StoreStateProvider: React.FC = ({
1414
children,
1515
}): React.ReactElement => {
1616
const [state, setState] = useState(
17-
(getStore().getState() as any) as IGatsbyState
17+
getStore().getState() as any as IGatsbyState
1818
)
1919

2020
useLayoutEffect(
2121
() =>
2222
onLogAction(() => {
23-
setState((getStore().getState() as any) as IGatsbyState)
23+
setState(getStore().getState() as any as IGatsbyState)
2424
}),
2525
[]
2626
)

packages/gatsby-cli/src/reporter/redux/__tests__/integration.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ describe(`integration`, () => {
2020
})
2121

2222
test(`Doesn't dispatch pre-emptive SUCCESS `, async () => {
23-
const {
24-
createPendingActivity,
25-
endActivity,
26-
startActivity,
27-
} = internalActions
23+
const { createPendingActivity, endActivity, startActivity } =
24+
internalActions
2825

2926
startActivity({
3027
id: `activity-1`,

packages/gatsby-cli/src/reporter/redux/actions.ts

+17-9
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ import * as actions from "./internal-actions"
66

77
const boundActions = bindActionCreators<typeof actions, any>(
88
actions,
9-
(dispatch as any) as Dispatch
9+
dispatch as any as Dispatch
1010
)
1111

1212
export const createLog = boundActions.createLog as typeof actions.createLog
13-
export const createPendingActivity = boundActions.createPendingActivity as typeof actions.createPendingActivity
13+
export const createPendingActivity =
14+
boundActions.createPendingActivity as typeof actions.createPendingActivity
1415
export const setStatus = boundActions.setStatus as typeof actions.setStatus
15-
export const startActivity = boundActions.startActivity as typeof actions.startActivity
16-
export const endActivity = boundActions.endActivity as typeof actions.endActivity
17-
export const updateActivity = boundActions.updateActivity as typeof actions.updateActivity
18-
export const setActivityErrored = boundActions.setActivityErrored as typeof actions.setActivityErrored
19-
export const setActivityStatusText = boundActions.setActivityStatusText as typeof actions.setActivityStatusText
20-
export const setActivityTotal = boundActions.setActivityTotal as typeof actions.setActivityTotal
21-
export const activityTick = boundActions.activityTick as typeof actions.activityTick
16+
export const startActivity =
17+
boundActions.startActivity as typeof actions.startActivity
18+
export const endActivity =
19+
boundActions.endActivity as typeof actions.endActivity
20+
export const updateActivity =
21+
boundActions.updateActivity as typeof actions.updateActivity
22+
export const setActivityErrored =
23+
boundActions.setActivityErrored as typeof actions.setActivityErrored
24+
export const setActivityStatusText =
25+
boundActions.setActivityStatusText as typeof actions.setActivityStatusText
26+
export const setActivityTotal =
27+
boundActions.setActivityTotal as typeof actions.setActivityTotal
28+
export const activityTick =
29+
boundActions.activityTick as typeof actions.activityTick

packages/gatsby-cli/src/reporter/redux/diagnostics.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export function createStructuredLoggingDiagnosticsMiddleware(
114114
// using nextTick here to prevent infinite recursion (report.warn would
115115
// result in another call of this function and so on)
116116
process.nextTick(() => {
117-
const activitiesDiagnosticsMessage = generateStuckStatusDiagnosticMessage()
117+
const activitiesDiagnosticsMessage =
118+
generateStuckStatusDiagnosticMessage()
118119
reporter.warn(
119120
`This is just diagnostic information (enabled by GATSBY_DIAGNOSTIC_STUCK_STATUS_TIMEOUT):\n\nThere was activity since last diagnostic message. Log action:\n\n${JSON.stringify(
120121
action,
@@ -175,7 +176,8 @@ export function createStructuredLoggingDiagnosticsMiddleware(
175176
context: {
176177
activities: inProgressActivities(),
177178
status: store.getState().logs.status,
178-
stuckStatusDiagnosticMessage: generateStuckStatusDiagnosticMessage(),
179+
stuckStatusDiagnosticMessage:
180+
generateStuckStatusDiagnosticMessage(),
179181
stuckStatusWatchdogTimeoutDelay,
180182
},
181183
})

packages/gatsby-cli/src/reporter/redux/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ let store: Store<{ logs: IGatsbyCLIState }> = createStore(
1212
{}
1313
)
1414

15-
const diagnosticsMiddleware = createStructuredLoggingDiagnosticsMiddleware(
16-
store
17-
)
15+
const diagnosticsMiddleware =
16+
createStructuredLoggingDiagnosticsMiddleware(store)
1817

1918
export type GatsbyCLIStore = typeof store
2019
type StoreListener = (store: GatsbyCLIStore) => void

0 commit comments

Comments
 (0)