Skip to content

Commit

Permalink
Update eslint packages except eslint@9 (#52435)
Browse files Browse the repository at this point in the history
Co-authored-by: Rachael Sewell <rachmari@github.com>
  • Loading branch information
heiskr and rachmari authored Sep 25, 2024
1 parent bd97b59 commit edb9445
Show file tree
Hide file tree
Showing 14 changed files with 418 additions and 278 deletions.
636 changes: 389 additions & 247 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,21 +342,21 @@
"@types/semver": "^7.5.8",
"@types/tcp-port-used": "1.0.4",
"@types/website-scraper": "^1.2.10",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.18.0",
"@typescript-eslint/eslint-plugin": "^8.7.0",
"@typescript-eslint/parser": "^8.7.0",
"chalk": "^5.0.1",
"change-case": "^5.4.4",
"commander": "^12.1.0",
"cross-env": "^7.0.3",
"csp-parse": "0.0.2",
"csv-parse": "5.5.6",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-primer-react": "^5.4.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-primer-react": "^6.1.2",
"event-to-promise": "^0.8.0",
"graphql": "^16.9.0",
"http-status-code": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/events/components/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function resetPageParams() {
function uuidv4(): string {
try {
return crypto.randomUUID()
} catch (err) {
} catch {
// https://stackoverflow.com/a/2117523
return (<any>[1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c: number) =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16),
Expand Down Expand Up @@ -207,7 +207,7 @@ function getReferrer(documentReferrer: string) {
if (!referrerUrl.pathname || referrerUrl.pathname === '/') {
return referrerUrl.origin + previousPath
}
} catch (e) {}
} catch {}
return documentReferrer
}

Expand Down
4 changes: 2 additions & 2 deletions src/frame/components/article/ArticleGridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ArticleGridLayout = ({
}: Props) => {
const containerBoxStyles = fullWidth ? '' : styles.containerBox
return (
<Box className={cx(containerBoxStyles, className)}>
<div className={cx(containerBoxStyles, className)}>
{topper && <Box gridArea="topper">{topper}</Box>}
{intro && (
<Box id="article-intro" gridArea="intro" className="f4 pb-4">
Expand All @@ -52,6 +52,6 @@ export const ArticleGridLayout = ({
)}
{children}
</Box>
</Box>
</div>
)
}
8 changes: 4 additions & 4 deletions src/frame/components/article/ArticleInlineLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const ArticleInlineLayout = ({
supportPortalVaIframeProps,
}: Props) => {
return (
<Box className={cx(styles.containerBox, className)}>
<div className={cx(styles.containerBox, className)}>
{breadcrumbs && (
<Box gridArea="breadcrumbs" className={cx('d-none d-xxl-block mt-3 mr-auto width-full')}>
{breadcrumbs}
</Box>
)}
<Box className={cx(styles.contentBox)}>
<div className={cx(styles.contentBox)}>
{topper && <Box gridArea="topper">{topper}</Box>}

{intro && (
Expand Down Expand Up @@ -71,7 +71,7 @@ export const ArticleInlineLayout = ({
)}
{children}
</Box>
</Box>
</Box>
</div>
</div>
)
}
2 changes: 1 addition & 1 deletion src/graphql/scripts/utils/schema-helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { renderContent } from '#src/content-render/index.js'
import fs from 'fs/promises'
import graphql from 'graphql'
import { graphql } from 'graphql'
import path from 'path'

const graphqlTypes = JSON.parse(
Expand Down
8 changes: 4 additions & 4 deletions src/links/components/DomainNameEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRouter } from 'next/router'
import { BeakerIcon } from '@primer/octicons-react'

import { useTranslation } from 'src/languages/components/useTranslation'
import { Box, Flash, FormControl, Spinner, Text, TextInput } from '@primer/react'
import { Box, Flash, FormControl, Spinner, TextInput } from '@primer/react'
import { Dialog } from '@primer/react/experimental'
import { useEditableDomainName } from './useEditableDomainContext'
import { sendEvent, EventType } from 'src/events/components/events'
Expand Down Expand Up @@ -225,7 +225,7 @@ function SubmissionError({ error }: { error: boolean }) {
if (error) {
return (
<Flash variant="danger">
<Text>{t('submission_failed')}</Text>
<p>{t('submission_failed')}</p>
</Flash>
)
}
Expand Down Expand Up @@ -293,12 +293,12 @@ function LearnMoreSnippet() {
const { t } = useTranslation(TRANSLATION_NAMESPACE)
return (
<Box sx={{ p: 3 }}>
<Text>
<p>
{t('snippet_about')}{' '}
<a href="/enterprise-server@latest/early-access/admin/articles/editing-host-names-in-github-docs">
{t('learn_more')}
</a>
</Text>
</p>
</Box>
)
}
2 changes: 1 addition & 1 deletion src/links/scripts/rendered-content-link-checker-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ program
let stats
try {
stats = fs.statSync(resolvedPath)
} catch (error) {
} catch {
// Ignore
}

Expand Down
2 changes: 1 addition & 1 deletion src/search/components/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function NoSearchResults() {
<div className="d-flex flex-items-center flex-column my-6 border rounded-2">
<div className="d-flex flex-items-center flex-column p-4">
<SearchIcon size={24} />
<Text className="f2 mt-3">{t('n_results').replace('{n}', '0')}</Text>
<p className="f2 mt-3">{t('n_results').replace('{n}', '0')}</p>
</div>
</div>
)
Expand Down
6 changes: 2 additions & 4 deletions src/search/components/SidebarSearchAggregates.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Box } from '@primer/react'

import { useSearchContext } from './context/SearchContext'
import { SearchResultsAggregations } from './Aggregations'

Expand All @@ -11,8 +9,8 @@ export function SidebarSearchAggregates() {
}

return (
<Box className="px-4 pb-3 mt-4">
<div className="px-4 pb-3 mt-4">
<SearchResultsAggregations aggregations={results.aggregations} />
</Box>
</div>
)
}
2 changes: 1 addition & 1 deletion src/search/components/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function parseDebug(debug: string | Array<string> | undefined) {
try {
debug = JSON.parse(debug)
return Boolean(debug)
} catch (e) {}
} catch {}

return false
}
2 changes: 1 addition & 1 deletion src/tools/components/Fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Fields = (fieldProps: {
key={item.text}
href={item.href}
selected={item.selected === true}
onClick={() => {
onSelect={() => {
if (onSelect) onSelect(item)
setOpen(!open)
}}
Expand Down
2 changes: 1 addition & 1 deletion src/webhooks/scripts/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function processWebhookSchema(webhooks: Webhook[]): Promise<void> {
if (webhooks.length) {
await Promise.all(webhooks.map((webhook) => webhook.process()))
}
} catch (error) {
} catch {
throw new Error(
"🐛 Whoops! It looks like the decorator script wasn't able to parse the dereferenced schema. A recent change may not yet be supported by the decorator. Please reach out in the #docs-engineering slack channel for help.",
)
Expand Down
2 changes: 1 addition & 1 deletion src/workflows/content-changes-table-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function makeRow({
prodCell += '<br>'
}
}
} catch (e) {
} catch {
console.error(
`Version information for ${file.filename} couldn't be determined from its frontmatter.`,
)
Expand Down

0 comments on commit edb9445

Please sign in to comment.