Skip to content

Commit 4f46d28

Browse files
authored
Fix eslint no-undef violations (#58233)
1 parent 8139ef1 commit 4f46d28

30 files changed

+41
-10
lines changed

eslint.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ export default [
2525
...globals.node,
2626
...globals.commonjs,
2727
...globals.es2020,
28+
// Fetch API types for TypeScript
29+
RequestInit: 'readonly',
30+
RequestInfo: 'readonly',
31+
HeadersInit: 'readonly',
32+
JSX: 'readonly',
33+
// Node.js types for TypeScript
34+
BufferEncoding: 'readonly',
35+
NodeJS: 'readonly',
36+
// cheerio namespace for TypeScript
37+
cheerio: 'readonly',
2838
},
2939
parserOptions: {
3040
requireConfigFile: false,
@@ -87,7 +97,6 @@ export default [
8797
// Disabled rules to review
8898
'github/no-then': 'off', // 30+
8999
'@typescript-eslint/ban-ts-comment': 'off', // 50+
90-
'no-undef': 'off', // 50+
91100
'no-shadow': 'off', // 150+
92101
'prefer-template': 'off', // 150+
93102
'github/array-foreach': 'off', // 250+

src/app/client-layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use client'
22

3+
import React, { useEffect, useMemo, useState } from 'react'
4+
import type { JSX } from 'react'
35
import { ThemeProvider } from '@primer/react'
4-
import { useEffect, useMemo, useState } from 'react'
56

67
import { LocaleProvider } from '@/app/lib/locale-context'
78
import { useDetectLocale } from '@/app/lib/use-detect-locale'

src/app/components/AppRouterLanguagesContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { createContext, useContext } from 'react'
3+
import React, { createContext, useContext } from 'react'
44
import { languages, type LanguageCode } from '@/languages/lib/languages'
55

66
export type AppRouterLanguageItem = {

src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import '@/frame/stylesheets/index.scss'
22
import type { Metadata, Viewport } from 'next'
33
import { ReactNode } from 'react'
4+
import type { JSX } from 'react'
45

56
export const metadata: Metadata = {
67
title: {

src/app/lib/locale-context.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { createContext, useContext, ReactNode, useMemo } from 'react'
4+
import type { JSX } from 'react'
45
import { languages, languageKeys, type LanguageCode } from '@/languages/lib/languages'
56

67
interface LocaleContextType {

src/app/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Enhanced type definitions for the app router with strict validation
33
*/
44

5+
import React from 'react'
56
import type { LanguageCode } from '@/languages/lib/languages'
67

78
// Core theme types with strict validation

src/automated-pipelines/components/AutomatedPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react'
12
import { DefaultLayout } from '@/frame/components/DefaultLayout'
23
import { ArticleTitle } from '@/frame/components/article/ArticleTitle'
34
import { MarkdownContent } from '@/frame/components/ui/MarkdownContent'

src/automated-pipelines/components/AutomatedPageContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createContext, useContext } from 'react'
2+
import type { JSX } from 'react'
23
import type { MiniTocItem } from '@/frame/components/context/ArticleContext'
34

45
export type AutomatedPageContextT = {

src/events/components/Survey.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useRef, useEffect } from 'react'
1+
import React, { useState, useRef, useEffect } from 'react'
22
import cx from 'classnames'
33
import { useRouter } from 'next/router'
44
import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'

src/frame/components/DefaultLayout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react'
12
import Head from 'next/head'
23
import { useRouter } from 'next/router'
34

0 commit comments

Comments
 (0)