1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Fix eslint no-undef violations (#58233)

This commit is contained in:
Kevin Heis
2025-10-30 09:13:18 -07:00
committed by GitHub
parent 8139ef18e5
commit 4f46d28722
30 changed files with 41 additions and 10 deletions

View File

@@ -25,6 +25,16 @@ export default [
...globals.node, ...globals.node,
...globals.commonjs, ...globals.commonjs,
...globals.es2020, ...globals.es2020,
// Fetch API types for TypeScript
RequestInit: 'readonly',
RequestInfo: 'readonly',
HeadersInit: 'readonly',
JSX: 'readonly',
// Node.js types for TypeScript
BufferEncoding: 'readonly',
NodeJS: 'readonly',
// cheerio namespace for TypeScript
cheerio: 'readonly',
}, },
parserOptions: { parserOptions: {
requireConfigFile: false, requireConfigFile: false,
@@ -87,7 +97,6 @@ export default [
// Disabled rules to review // Disabled rules to review
'github/no-then': 'off', // 30+ 'github/no-then': 'off', // 30+
'@typescript-eslint/ban-ts-comment': 'off', // 50+ '@typescript-eslint/ban-ts-comment': 'off', // 50+
'no-undef': 'off', // 50+
'no-shadow': 'off', // 150+ 'no-shadow': 'off', // 150+
'prefer-template': 'off', // 150+ 'prefer-template': 'off', // 150+
'github/array-foreach': 'off', // 250+ 'github/array-foreach': 'off', // 250+

View File

@@ -1,7 +1,8 @@
'use client' 'use client'
import React, { useEffect, useMemo, useState } from 'react'
import type { JSX } from 'react'
import { ThemeProvider } from '@primer/react' import { ThemeProvider } from '@primer/react'
import { useEffect, useMemo, useState } from 'react'
import { LocaleProvider } from '@/app/lib/locale-context' import { LocaleProvider } from '@/app/lib/locale-context'
import { useDetectLocale } from '@/app/lib/use-detect-locale' import { useDetectLocale } from '@/app/lib/use-detect-locale'

View File

@@ -1,6 +1,6 @@
'use client' 'use client'
import { createContext, useContext } from 'react' import React, { createContext, useContext } from 'react'
import { languages, type LanguageCode } from '@/languages/lib/languages' import { languages, type LanguageCode } from '@/languages/lib/languages'
export type AppRouterLanguageItem = { export type AppRouterLanguageItem = {

View File

@@ -1,6 +1,7 @@
import '@/frame/stylesheets/index.scss' import '@/frame/stylesheets/index.scss'
import type { Metadata, Viewport } from 'next' import type { Metadata, Viewport } from 'next'
import { ReactNode } from 'react' import { ReactNode } from 'react'
import type { JSX } from 'react'
export const metadata: Metadata = { export const metadata: Metadata = {
title: { title: {

View File

@@ -1,6 +1,7 @@
'use client' 'use client'
import { createContext, useContext, ReactNode, useMemo } from 'react' import { createContext, useContext, ReactNode, useMemo } from 'react'
import type { JSX } from 'react'
import { languages, languageKeys, type LanguageCode } from '@/languages/lib/languages' import { languages, languageKeys, type LanguageCode } from '@/languages/lib/languages'
interface LocaleContextType { interface LocaleContextType {

View File

@@ -2,6 +2,7 @@
* Enhanced type definitions for the app router with strict validation * Enhanced type definitions for the app router with strict validation
*/ */
import React from 'react'
import type { LanguageCode } from '@/languages/lib/languages' import type { LanguageCode } from '@/languages/lib/languages'
// Core theme types with strict validation // Core theme types with strict validation

View File

@@ -1,3 +1,4 @@
import React from 'react'
import { DefaultLayout } from '@/frame/components/DefaultLayout' import { DefaultLayout } from '@/frame/components/DefaultLayout'
import { ArticleTitle } from '@/frame/components/article/ArticleTitle' import { ArticleTitle } from '@/frame/components/article/ArticleTitle'
import { MarkdownContent } from '@/frame/components/ui/MarkdownContent' import { MarkdownContent } from '@/frame/components/ui/MarkdownContent'

View File

@@ -1,4 +1,5 @@
import { createContext, useContext } from 'react' import { createContext, useContext } from 'react'
import type { JSX } from 'react'
import type { MiniTocItem } from '@/frame/components/context/ArticleContext' import type { MiniTocItem } from '@/frame/components/context/ArticleContext'
export type AutomatedPageContextT = { export type AutomatedPageContextT = {

View File

@@ -1,4 +1,4 @@
import { useState, useRef, useEffect } from 'react' import React, { useState, useRef, useEffect } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react' import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'

View File

@@ -1,3 +1,4 @@
import React from 'react'
import Head from 'next/head' import Head from 'next/head'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'

View File

@@ -1,3 +1,5 @@
import React from 'react'
type Props = { type Props = {
children: React.ReactNode children: React.ReactNode
} }

View File

@@ -1,4 +1,5 @@
import GithubSlugger from 'github-slugger' import GithubSlugger from 'github-slugger'
import type { JSX } from 'react'
const slugger = new GithubSlugger() const slugger = new GithubSlugger()

View File

@@ -1,5 +1,6 @@
import { SupportPortalVaIframeProps } from '@/frame/components/article/SupportPortalVaIframe' import { SupportPortalVaIframeProps } from '@/frame/components/article/SupportPortalVaIframe'
import { createContext, useContext } from 'react' import { createContext, useContext } from 'react'
import type { JSX } from 'react'
import type { JourneyContext } from '@/journeys/lib/journey-path-resolver' import type { JourneyContext } from '@/journeys/lib/journey-path-resolver'
export type LearningTrack = { export type LearningTrack = {

View File

@@ -1,4 +1,5 @@
import { useCallback, useEffect, useRef, useState } from 'react' import { useCallback, useEffect, useRef, useState } from 'react'
import type { JSX } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { Dialog, IconButton } from '@primer/react' import { Dialog, IconButton } from '@primer/react'

View File

@@ -1,4 +1,5 @@
import cx from 'classnames' import cx from 'classnames'
import type { JSX } from 'react'
import { KebabHorizontalIcon, LinkExternalIcon } from '@primer/octicons-react' import { KebabHorizontalIcon, LinkExternalIcon } from '@primer/octicons-react'
import { IconButton, ActionMenu, ActionList } from '@primer/react' import { IconButton, ActionMenu, ActionList } from '@primer/react'

View File

@@ -1,4 +1,5 @@
import { ReactNode } from 'react' import { ReactNode } from 'react'
import type { JSX } from 'react'
import cx from 'classnames' import cx from 'classnames'
import styles from './Lead.module.scss' import styles from './Lead.module.scss'

View File

@@ -1,4 +1,5 @@
import { ReactNode } from 'react' import { ReactNode } from 'react'
import type { JSX } from 'react'
import cx from 'classnames' import cx from 'classnames'
import styles from './MarkdownContent.module.scss' import styles from './MarkdownContent.module.scss'

View File

@@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import ReactMarkdown from 'react-markdown' import ReactMarkdown from 'react-markdown'
import type { Components } from 'react-markdown' import type { Components } from 'react-markdown'
import type { JSX } from 'react'
import remarkGfm from 'remark-gfm' import remarkGfm from 'remark-gfm'
import cx from 'classnames' import cx from 'classnames'
import { IconButton } from '@primer/react' import { IconButton } from '@primer/react'

View File

@@ -2,6 +2,7 @@
* Utility functions for fetch with retry and timeout functionality * Utility functions for fetch with retry and timeout functionality
* to replace got library functionality * to replace got library functionality
*/ */
export interface FetchWithRetryOptions { export interface FetchWithRetryOptions {
retries?: number retries?: number
retryDelay?: number retryDelay?: number

View File

@@ -1,3 +1,4 @@
import React from 'react'
import { HeadingLink } from '@/frame/components/article/HeadingLink' import { HeadingLink } from '@/frame/components/article/HeadingLink'
import type { GraphqlT } from './types' import type { GraphqlT } from './types'
import { Notice } from './Notice' import { Notice } from './Notice'

View File

@@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import type { JSX } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { Enum } from './Enum' import { Enum } from './Enum'

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { LinkExternalIcon, NoteIcon } from '@primer/octicons-react' import { LinkExternalIcon, NoteIcon } from '@primer/octicons-react'

View File

@@ -1,3 +1,4 @@
import React from 'react'
import cx from 'classnames' import cx from 'classnames'
import { HeadingLink } from '@/frame/components/article/HeadingLink' import { HeadingLink } from '@/frame/components/article/HeadingLink'

View File

@@ -1,4 +1,4 @@
import { useState, useRef, useEffect, useMemo } from 'react' import React, { useState, useRef, useEffect, useMemo } from 'react'
import { TextInput, ActionMenu, ActionList, Token, Pagination } from '@primer/react' import { TextInput, ActionMenu, ActionList, Token, Pagination } from '@primer/react'
import { SearchIcon } from '@primer/octicons-react' import { SearchIcon } from '@primer/octicons-react'
import cx from 'classnames' import cx from 'classnames'

View File

@@ -1,4 +1,4 @@
import { useState, useEffect, useRef, FormEvent } from 'react' import React, { useState, useEffect, useRef, FormEvent } from 'react'
import { FormControl, IconButton, Select, SegmentedControl } from '@primer/react' import { FormControl, IconButton, Select, SegmentedControl } from '@primer/react'
import { CheckIcon, CopyIcon, InfoIcon } from '@primer/octicons-react' import { CheckIcon, CopyIcon, InfoIcon } from '@primer/octicons-react'
import { announce } from '@primer/live-region-element' import { announce } from '@primer/live-region-element'

View File

@@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from 'react'
import { uniqBy } from 'lodash-es' import { uniqBy } from 'lodash-es'
import { executeAISearch } from '../helpers/execute-search-actions' import { executeAISearch } from '../helpers/execute-search-actions'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'

View File

@@ -1,3 +1,4 @@
import React from 'react'
import cx from 'classnames' import cx from 'classnames'
import { IconButton } from '@primer/react' import { IconButton } from '@primer/react'
import { CopilotIcon, SearchIcon } from '@primer/octicons-react' import { CopilotIcon, SearchIcon } from '@primer/octicons-react'

View File

@@ -1,3 +1,4 @@
import React from 'react'
import { SearchOverlay } from './SearchOverlay' import { SearchOverlay } from './SearchOverlay'
import { QueryParams } from '../hooks/useMultiQueryParams' import { QueryParams } from '../hooks/useMultiQueryParams'

View File

@@ -1,7 +1,7 @@
import { Box, Pagination, Text } from '@primer/react' import { Box, Pagination, Text } from '@primer/react'
import { SearchIcon } from '@primer/octicons-react' import { SearchIcon } from '@primer/octicons-react'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { useEffect, useRef, useState } from 'react' import React, { useEffect, useRef, useState } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { useTranslation } from '@/languages/components/useTranslation' import { useTranslation } from '@/languages/components/useTranslation'

View File

@@ -1,5 +1,5 @@
import { ActionList } from '@primer/react' import { ActionList } from '@primer/react'
import { ReactNode } from 'react' import React, { ReactNode } from 'react'
import cx from 'classnames' import cx from 'classnames'
import { PickerItem } from './Picker' import { PickerItem } from './Picker'