Skip to content

Commit

Permalink
fix(eslint): update eslint to v9 (#1336)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi authored Nov 20, 2024
1 parent 2c83bd1 commit e876dbf
Show file tree
Hide file tree
Showing 133 changed files with 1,158 additions and 1,079 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 80,
"printWidth": 120,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
Expand Down
2 changes: 1 addition & 1 deletion app/post/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ParsedUrlQuery } from 'node:querystring'
import type { Metadata } from 'next'
import type { ParsedUrlQuery } from 'node:querystring'
import { Article } from '@/components'
import { getMetadata } from '@/config'
import { PostLayout } from '@/layouts'
Expand Down
2 changes: 1 addition & 1 deletion app/tag/[tag]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ParsedUrlQuery } from 'node:querystring'
import type { Metadata } from 'next'
import type { ParsedUrlQuery } from 'node:querystring'
import { PostsList, TagsCloud } from '@/components'
import { getMetadata } from '@/config'
import { Layout } from '@/layouts'
Expand Down
2 changes: 1 addition & 1 deletion components/Article/Article.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Article from './Article'
import mockData from '@/mocks/data'
import { render } from '@/utils'
import Article from './Article'

describe('Article', () => {
const mockBasePost = mockData.basePosts[0]
Expand Down
12 changes: 6 additions & 6 deletions components/Article/Article.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import ArticleComments from './ArticleComments'
import ArticleContent from './ArticleContent'
import ArticleHeader from './ArticleHeader'
import ArticleNav from './ArticleNav'
import ArticleToc from './ArticleToc'
import type { PostType, SiteConfig } from '@/types'
import Container from '@/components/Container'
import Divider from '@/components/Divider'
import { Comment } from '@/components/Icons'
import SocialGroup from '@/components/SocialGroup'
import { siteConfig } from '@/config'
import type { PostType, SiteConfig } from '@/types'
import ArticleComments from './ArticleComments'
import ArticleContent from './ArticleContent'
import ArticleHeader from './ArticleHeader'
import ArticleNav from './ArticleNav'
import ArticleToc from './ArticleToc'

interface Props {
post: PostType
Expand Down
2 changes: 1 addition & 1 deletion components/Article/ArticleComments.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render } from '@/utils'
import { axe } from 'jest-axe'
import ArticleComments from './ArticleComments'
import { render } from '@/utils'

describe('ArticleComments', () => {
it('should render correctly (snapshot)', () => {
Expand Down
4 changes: 2 additions & 2 deletions components/Article/ArticleComments.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import cx from 'classnames'
import styles from './ArticleComments.module.css'
import { siteConfig } from '@/config'
import { useDisqus } from '@/hooks'
import cx from 'classnames'
import styles from './ArticleComments.module.css'

interface Props {
url?: string
Expand Down
4 changes: 2 additions & 2 deletions components/Article/ArticleContent.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import { MDXRemote } from '@alisowski/next-mdx-remote'
import MDX from '@/components/MDX'
import type { PostType } from '@/types'
import MDX from '@/components/MDX'
import { MDXRemote } from '@alisowski/next-mdx-remote'

interface Props {
source: PostType['source']
Expand Down
4 changes: 2 additions & 2 deletions components/Article/ArticleHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import styles from './ArticleHeader.module.css'
import type { PostMeta } from '@/types'
import { H1 } from '@/components/Headings'
import { Calendar, ClockCircle, Edit } from '@/components/Icons'
import { Slide } from '@/components/Motion'
import { IconTag, LinkTag } from '@/components/Tags'
import { siteConfig } from '@/config'
import type { PostMeta } from '@/types'
import styles from './ArticleHeader.module.css'

interface Props {
post: PostMeta
Expand Down
2 changes: 1 addition & 1 deletion components/Article/ArticleNav.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { PostMeta } from '@/types'
import FlexContainer from '@/components/FlexContainer'
import { ArrowLeft, ArrowRight, Home } from '@/components/Icons'
import Link from '@/components/Link'
import { Bounce } from '@/components/Motion'
import type { PostMeta } from '@/types'

interface Props {
prevPost: PostMeta['prevPost']
Expand Down
2 changes: 1 addition & 1 deletion components/Article/ArticleToc.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ArticleToc from './ArticleToc'
import { render } from '@/utils'
import ArticleToc from './ArticleToc'

describe('ArticleToc', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Article/ArticleToc.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import Anchor from '@/components/Anchor'
import { useEffect, useState } from 'react'
import styles from './ArticleToc.module.css'
import Anchor from '@/components/Anchor'

interface Props {
slug: string
Expand Down
2 changes: 1 addition & 1 deletion components/Aside/Aside.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Aside from './Aside'
import { render } from '@/utils'
import Aside from './Aside'

describe('Aside', () => {
const types = [
Expand Down
5 changes: 3 additions & 2 deletions components/Aside/Aside.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cx from 'classnames'
import type { ReactNode } from 'react'
import styles from './Aside.module.css'
import Alert from '@/components/Alert'
import cx from 'classnames'
import styles from './Aside.module.css'

interface Props {
type?: string
Expand All @@ -24,6 +24,7 @@ function normalizeType(type?: string) {
case 'error':
case 'danger':
return 'error'
case undefined:
default:
return 'info'
}
Expand Down
2 changes: 1 addition & 1 deletion components/Blockquote/Blockquote.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Blockquote from './Blockquote'
import { render } from '@/utils'
import Blockquote from './Blockquote'

describe('Blockquote', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Blockquote/Blockquote.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import type { BlockquoteHTMLAttributes } from 'react'
import cx from 'classnames'
import styles from './Blockquote.module.css'

interface Props extends BlockquoteHTMLAttributes<HTMLElement> {}
Expand Down
2 changes: 1 addition & 1 deletion components/BooksGrid/BookCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'

import type { Book } from '@/types'
import Badge from '@/components/Badge'
import { Card, Meta } from '@/components/Card'
import { Book as BookIcon } from '@/components/Icons'
import { Span } from '@/components/Texts'
import { getColorByName } from '@/config'
import type { Book } from '@/types'

interface Props {
book: Book
Expand Down
2 changes: 1 addition & 1 deletion components/BooksGrid/BooksGrid.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render } from '@/utils'
import { axe } from 'jest-axe'
import BooksGrid from './BooksGrid'
import { render } from '@/utils'

describe('BooksGrid', () => {
it('should render correctly (snapshot)', () => {
Expand Down
4 changes: 2 additions & 2 deletions components/BooksGrid/BooksGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import BookCard from './BookCard'
import type { Book } from '@/types'
import Col from '@/components/Col'
import Row from '@/components/Row'
import { siteConfig } from '@/config'
import type { Book } from '@/types'
import BookCard from './BookCard'

interface Props {
books?: Book[]
Expand Down
2 changes: 1 addition & 1 deletion components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card as AntCard } from 'antd'
import type { CardMetaProps, CardProps } from 'antd/lib/card'
import { Card as AntCard } from 'antd'
import cx from 'classnames'

interface Props extends CardProps {}
Expand Down
2 changes: 1 addition & 1 deletion components/CodeBlocks/BlockCode.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import type { Language } from 'prism-react-renderer'
import cx from 'classnames'
import Highlight, { defaultProps } from 'prism-react-renderer'
import styles from './BlockCode.module.css'
import theme from './monokai'
Expand Down
2 changes: 1 addition & 1 deletion components/CodeBlocks/InlineCode.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InlineCode from './InlineCode'
import { render } from '@/utils'
import InlineCode from './InlineCode'

describe('InlineCode', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/CodeBlocks/LiveCode.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LiveCode from './LiveCode'
import { render } from '@/utils'
import LiveCode from './LiveCode'

describe('LiveCode', () => {
it('should render live code correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/CodeBlocks/Pre.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Pre from './Pre'
import { render } from '@/utils'
import Pre from './Pre'

describe('Pre', () => {
const languages = [
Expand Down
4 changes: 2 additions & 2 deletions components/CodeBlocks/Pre.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HTMLProps, ReactElement } from 'react'
import CopyButton from '@/components/CopyButton'
import cx from 'classnames'
import dynamic from 'next/dynamic'
import type { HTMLProps, ReactElement } from 'react'
import BlockCode from './BlockCode'
import styles from './Pre.module.css'
import {
Expand All @@ -9,7 +10,6 @@ import {
normalizeLanguageName,
normalizeLines,
} from './utils'
import CopyButton from '@/components/CopyButton'

const LiveCode = dynamic(async () => import('./LiveCode'))

Expand Down
2 changes: 1 addition & 1 deletion components/CodeBlocks/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import parseNumericRange from 'parse-numeric-range'
import type { Language } from 'prism-react-renderer'
import parseNumericRange from 'parse-numeric-range'

const normalizeCode = (code: string = '') => code.replace(/\n+$/, '')

Expand Down
2 changes: 1 addition & 1 deletion components/Container/Container.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@/utils'
import { axe } from 'jest-axe'
import Container from './Container'
import { render, screen } from '@/utils'

describe('Container', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Container/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import type { CSSProperties, HTMLProps, ReactNode } from 'react'
import cx from 'classnames'

interface Props extends HTMLProps<HTMLDivElement> {
children: ReactNode
Expand Down
6 changes: 3 additions & 3 deletions components/CopyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'

import cx from 'classnames'
import { useReducedMotion } from 'framer-motion'
import styles from './CopyButton.module.css'
import { Check, Copy } from '@/components/Icons'
import { Toggle } from '@/components/Motion'
import { useCopyToClipboard } from '@/hooks'
import cx from 'classnames'
import { useReducedMotion } from 'framer-motion'
import styles from './CopyButton.module.css'

interface Props {
code: string
Expand Down
2 changes: 1 addition & 1 deletion components/Editor/Editor.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Editor from './Editor'
import { render, screen } from '@/utils'
import Editor from './Editor'

describe('Editor', () => {
it('should render sandpack correctly', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SandpackPredefinedTemplate } from '@codesandbox/sandpack-react'
import type { ReactElement, ReactNode } from 'react'
import { Sandpack } from '@codesandbox/sandpack-react'
import { monokaiPro } from '@codesandbox/sandpack-themes'
import type { ReactElement, ReactNode } from 'react'
import { Children } from 'react'
import { normalizeFilepath } from './utils'

Expand Down
1 change: 1 addition & 0 deletions components/Editor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function languageToFilepath(language?: string): string {
return '/App.tsx'
case 'vue':
return '/src/App.vue'
case undefined:
default:
return '/App.tsx'
}
Expand Down
4 changes: 2 additions & 2 deletions components/ErrorBoundary/ErrorBoundary.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { axe } from 'jest-axe'
import type { JSXElementConstructor, ReactNode } from 'react'
import ErrorBoundary from './ErrorBoundary'
import { render, screen } from '@/utils'
import { axe } from 'jest-axe'
import ErrorBoundary from './ErrorBoundary'

describe('ErrorBoundary', () => {
const ComponentWithError = ({ shouldThrow }: { shouldThrow?: boolean }) => {
Expand Down
2 changes: 1 addition & 1 deletion components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client'

import type { ErrorInfo } from 'react'
import { Component } from 'react'
import Paragraph from '@/components/Paragraph'
import Result from '@/components/Result'
import { Text } from '@/components/Texts'
import { Component } from 'react'

interface Props {
children: JSX.Element
Expand Down
2 changes: 1 addition & 1 deletion components/FlexContainer/FlexContainer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@/utils'
import { axe } from 'jest-axe'
import FlexContainer from './FlexContainer'
import { render, screen } from '@/utils'

describe('FlexContainer', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/FlexContainer/FlexContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import type { CSSProperties, HTMLProps, ReactNode } from 'react'
import cx from 'classnames'

interface Props extends HTMLProps<HTMLDivElement> {
children: ReactNode
Expand Down
4 changes: 2 additions & 2 deletions components/Footer/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { axe } from 'jest-axe'
import Footer from './Footer'
import mockData from '@/mocks/data'
import { render } from '@/utils'
import { axe } from 'jest-axe'
import Footer from './Footer'

describe('Footer', () => {
const mockTime = mockData.time
Expand Down
4 changes: 2 additions & 2 deletions components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import FooterTime from './FooterTime'
import type { BuildTime, SiteConfig, SocialType } from '@/types'
import Col from '@/components/Col'
import Container from '@/components/Container'
import Divider from '@/components/Divider'
import Row from '@/components/Row'
import SocialButton from '@/components/SocialButton'
import { siteConfig, socialList } from '@/config'
import type { BuildTime, SiteConfig, SocialType } from '@/types'
import FooterTime from './FooterTime'

interface Props {
buildTime: BuildTime
Expand Down
2 changes: 1 addition & 1 deletion components/Footnote/Footnote.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Footnote from './Footnote'
import { render } from '@/utils'
import Footnote from './Footnote'

describe('Footnote', () => {
it('should render correctly (snapshot)', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Footnote/Footnote.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames'
import type { ReactNode } from 'react'
import cx from 'classnames'
import styles from './Footnote.module.css'

interface Props {
Expand Down
4 changes: 2 additions & 2 deletions components/GithubCard/GithubCard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { axe } from 'jest-axe'
import GithubCard from './GithubCard'
import mockData from '@/mocks/data'
import { render } from '@/utils'
import { axe } from 'jest-axe'
import GithubCard from './GithubCard'

describe('GithubCard', () => {
const mockBaseProfile = mockData.baseProfile
Expand Down
Loading

0 comments on commit e876dbf

Please sign in to comment.