diff --git a/.eslintrc.json b/.eslintrc.json index 545d039632..4cd59f27f7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,27 +1,17 @@ { "root": true, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "react", "react-hooks"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "prettier" - ], - "settings": { - "react": { - "version": "detect" - } - }, - "env": { - "browser": true, - "node": true - }, + "extends": ["@fisch0920/eslint-config"], "rules": { - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-non-null-assertion": 0, - "@typescript-eslint/no-unused-vars": 2, - "react/prop-types": 0 + "react/prop-types": "off", + "unicorn/no-array-reduce": "off", + "unicorn/filename-case": "off", + "no-process-env": "off", + "array-callback-return": "off", + "jsx-a11y/click-events-have-key-events": "off", + "jsx-a11y/no-static-element-interactions": "off", + "jsx-a11y/media-has-caption": "off", + "jsx-a11y/interactive-supports-focus": "off", + "jsx-a11y/anchor-is-valid": "off", + "@typescript-eslint/naming-convention": "off" } } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6deb091f4c..1e5e858f33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,34 @@ -name: Build +name: CI -on: [push, pull_request] +on: [push] jobs: - Build: + test: + name: Test Node.js ${{ matrix.node-version }} runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + strategy: + fail-fast: true + matrix: + node-version: + - 20 + - 22 + - 24 + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 - cache: yarn + node-version: ${{ matrix.node-version }} + cache: "pnpm" + + - run: pnpm install --frozen-lockfile --strict-peer-dependencies + - run: pnpm test - - run: yarn install --frozen-lockfile - - name: build - # TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets - # env: - # REDIS_HOST: ${{ secrets.REDIS_HOST }} - # REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} - run: yarn build + # TODO Enable those lines below if you use a Redis cache, you'll also need to configure GitHub Repository Secrets + # env: + # REDIS_HOST: ${{ secrets.REDIS_HOST }} + # REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }} + # - name: Build + # run: pnpm build diff --git a/.prettierignore b/.prettierignore index 18d230488d..46f16f3b45 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,6 +4,4 @@ dist/ node_modules/ .next/ .vercel/ - -.demo/ -.renderer/ +next-env.d.ts diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 26d4848990..0000000000 --- a/.prettierrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - "singleQuote": true, - "jsxSingleQuote": true, - "semi": false, - "useTabs": false, - "tabWidth": 2, - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParens": "always", - "trailingComma": "none", - "importOrder": [ - "^(react/(.*)$)|^(react$)|^(next/(.*)$)|^(next$)", - "", - "^(@/lib/(.*)$)|^(@/components/(.*)$)|^(@/styles/(.*)$)", - "^[./]" - ], - "importOrderSeparation": true, - "importOrderSortSpecifiers": true, - "importOrderGroupNamespaceSpecifiers": true -} diff --git a/.vscode/launch.json b/.vscode/launch.json index 62b7917c36..156a4bb240 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,6 @@ "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next", "runtimeArgs": ["dev"], "cwd": "${workspaceFolder}", - "port": 9229, "smartStep": true, "console": "integratedTerminal", "skipFiles": ["/**"], diff --git a/components/ErrorPage.tsx b/components/ErrorPage.tsx index 43720d45d2..9682dde71f 100644 --- a/components/ErrorPage.tsx +++ b/components/ErrorPage.tsx @@ -1,9 +1,7 @@ -import * as React from 'react' - import { PageHead } from './PageHead' import styles from './styles.module.css' -export const ErrorPage: React.FC<{ statusCode: number }> = ({ statusCode }) => { +export function ErrorPage({ statusCode }: { statusCode: number }) { const title = 'Error' return ( diff --git a/components/Footer.tsx b/components/Footer.tsx index 2e5452627b..6cd0c1c55e 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -1,29 +1,22 @@ import * as React from 'react' -import { FaEnvelopeOpenText } from '@react-icons/all-files/fa/FaEnvelopeOpenText' -import { FaGithub } from '@react-icons/all-files/fa/FaGithub' -import { FaLinkedin } from '@react-icons/all-files/fa/FaLinkedin' -import { FaMastodon } from '@react-icons/all-files/fa/FaMastodon' -import { FaTwitter } from '@react-icons/all-files/fa/FaTwitter' -import { FaYoutube } from '@react-icons/all-files/fa/FaYoutube' -import { FaZhihu } from '@react-icons/all-files/fa/FaZhihu' -import { IoMoonSharp } from '@react-icons/all-files/io5/IoMoonSharp' -import { IoSunnyOutline } from '@react-icons/all-files/io5/IoSunnyOutline' - import * as config from '@/lib/config' +import { GitHubIcon } from '@/lib/icons/github' +import { LinkedInIcon } from '@/lib/icons/linkedin' +import { MoonIcon } from '@/lib/icons/moon' +import { SunIcon } from '@/lib/icons/sun' +import { TwitterIcon } from '@/lib/icons/twitter' import { useDarkMode } from '@/lib/use-dark-mode' import styles from './styles.module.css' -// TODO: merge the data and icons from PageSocial with the social links in Footer - -export const FooterImpl: React.FC = () => { +export function FooterImpl() { const [hasMounted, setHasMounted] = React.useState(false) const { isDarkMode, toggleDarkMode } = useDarkMode() const currentYear = new Date().getFullYear() const onToggleDarkMode = React.useCallback( - (e) => { + (e: any) => { e.preventDefault() toggleDarkMode() }, @@ -36,7 +29,9 @@ export const FooterImpl: React.FC = () => { return (