Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update formatting & linting #37159

Merged
merged 4 commits into from Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -17,6 +17,7 @@ e2e-tests
examples
integration-tests
**/*.d.ts
deprecated-packages

packages/*/*.js
packages/gatsby-source-shopify/**/*.js
Expand Down
7 changes: 2 additions & 5 deletions .eslintrc.js
Expand Up @@ -186,14 +186,11 @@ module.exports = {
},
{
selector: `property`,
format: [`PascalCase`, `UPPER_CASE`, `camelCase`, `snake_case`],
leadingUnderscore: `allowSingleOrDouble`,
format: null,
},
{
selector: `objectLiteralProperty`,
format: [`PascalCase`, `UPPER_CASE`, `camelCase`, `snake_case`],
leadingUnderscore: `allowSingleOrDouble`,
trailingUnderscore: `allowSingleOrDouble`,
format: null,
},
{
selector: `enum`,
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
@@ -1,6 +1,7 @@
*.min.js
**/node_modules/**
flow-typed
deprecated-packages

# webfont demo styles
**/specimen_files
Expand Down
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -2,8 +2,8 @@
"packageManager": "yarn@1.22.19",
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/eslint-parser": "^7.15.4",
"@babel/eslint-plugin": "^7.14.0",
"@babel/eslint-parser": "^7.19.1",
"@babel/eslint-plugin": "^7.19.1",
"@babel/node": "^7.15.4",
"@babel/plugin-transform-typescript": "^7.15.4",
"@babel/runtime": "^7.15.4",
Expand All @@ -26,24 +26,24 @@
"@types/signal-exit": "^3.0.0",
"@types/stack-trace": "^0.0.29",
"@types/webpack-merge": "^4.1.5",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"babel-jest": "^27.2.1",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"cross-env": "^7.0.3",
"danger": "^10.6.4",
"date-fns": "^1.30.1",
"dictionary-en": "^3.1.0",
"eslint": "^7.32.0",
"eslint": "^8.29.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-flowtype": "^6.1.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react": "^7.31.11",
"fs-extra": "^10.1.0",
"glob": "^7.2.3",
"husky": "3.1.0",
Expand All @@ -61,7 +61,7 @@
"node-notifier": "^10.0.0",
"npm-packlist": "^2.1.5",
"npm-run-all": "4.1.5",
"prettier": "^2.7.1",
"prettier": "^2.8.0",
"rimraf": "^3.0.2",
"typescript": "^4.7.4",
"unified": "^9.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-google-analytics/src/index.js
@@ -1,15 +1,15 @@
import React from "react"
import PropTypes from "prop-types"

const createFunctionWithTimeout = (callback, opt_timeout = 1000) => {
const createFunctionWithTimeout = (callback, optTimeout = 1000) => {
let called = false
const raceCallback = () => {
if (!called) {
called = true
callback()
}
}
setTimeout(raceCallback, opt_timeout)
setTimeout(raceCallback, optTimeout)
return raceCallback
}

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-mdx/package.json
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@mdx-js/mdx": "^2.1.5",
"acorn": "^7.4.1",
"acorn": "^8.8.1",
"acorn-jsx": "^5.3.2",
"astring": "^1.8.3",
"deepmerge": "^4.2.2",
Expand Down
@@ -1,4 +1,5 @@
/* global __prefresh_errors__ */
/* eslint-disable camelcase */
import formatWebpackErrors from "./formatWebpackErrors"

const singletonKey = `__webpack_hot_middleware_reporter__`
Expand Down
Expand Up @@ -233,6 +233,7 @@ export const createLocalFileNode = async ({
mediaItemUrl = ensureSrcHasHostname({ wpUrl, src: mediaItemUrl })

const { excludeByMimeTypes, maxFileSizeBytes } =
// eslint-disable-next-line no-unsafe-optional-chaining
pluginOptions.type?.MediaItem?.localFile

// if this file is larger than maxFileSizeBytes, don't fetch the remote file
Expand Down
Expand Up @@ -813,7 +813,7 @@ const replaceFileLinks = async ({
return null
}

const [, hostname, path] = mediaItemMatchGroup?.subMatches
const [, hostname, path] = mediaItemMatchGroup.subMatches

cacheCreatedFileNodeBySrc({
node: mediaItemNode,
Expand Down
Expand Up @@ -21,7 +21,7 @@ export const removeExportQueryParam = (
if (!path?.includes(`?`)) {
return path
}
const [filePath, queryParams] = path?.split(`?`)
const [filePath, queryParams] = path.split(`?`)
const params = new URLSearchParams(queryParams)
params.delete(`export`)

Expand Down
14 changes: 10 additions & 4 deletions packages/gatsby/src/utils/worker/__tests__/schema.ts
Expand Up @@ -142,8 +142,9 @@ describe(`worker (schema)`, () => {
})

it(`should have resolverField from createResolvers`, async () => {
// @ts-ignore - it exists
const { data } = await worker?.single.getRunQueryResult(`
if (!worker) fail(`worker not defined`)

const { data } = await worker.single.getRunQueryResult(`
{
one: nodeTypeOne {
number
Expand All @@ -156,22 +157,27 @@ describe(`worker (schema)`, () => {
}
}
`)
if (!data) fail(`data not defined`)

// @ts-ignore - This is a test
expect(data.one.number).toBe(123)
expect(data.two).toBe(null)
// @ts-ignore - This is a test
expect(data.three.resolverField).toBe(`Custom String`)
})

it(`should have fieldsOnGraphQL from setFieldsOnGraphQLNodeType`, async () => {
// @ts-ignore - it exists
const { data } = await worker?.single.getRunQueryResult(`
if (!worker) fail(`worker not defined`)

const { data } = await worker.single.getRunQueryResult(`
{
four: nodeTypeOne {
fieldsOnGraphQL
}
}
`)

// @ts-ignore - This is a test
expect(data.four.fieldsOnGraphQL).toBe(`Another Custom String`)
})
})