From 9fcbb5a900a399c43df6b3283312e240d8711744 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Fri, 2 Feb 2024 14:15:55 +0800 Subject: [PATCH] chore: update for lint --- src/components/templates/Hero.tsx | 64 +++---- src/components/templates/VerticalFeatures.tsx | 159 +++++++++--------- src/i18n/i18n.ts | 91 +++++----- tsconfig.json | 30 ++-- 4 files changed, 180 insertions(+), 164 deletions(-) diff --git a/src/components/templates/Hero.tsx b/src/components/templates/Hero.tsx index b5614e8..73571e2 100644 --- a/src/components/templates/Hero.tsx +++ b/src/components/templates/Hero.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { useTranslation } from "react-i18next"; +import { useTranslation } from 'react-i18next'; import { Background } from '@/components/background/Background'; import { Button } from '@/components/button/Button'; @@ -12,37 +12,39 @@ import { Logo } from './Logo'; const Hero = function () { const { t } = useTranslation(); - return -
- }> -
  • - GitHub -
  • -
    -
    + return ( + +
    + }> +
  • + GitHub +
  • +
    +
    -
    - - <>{ t('AI4SDLC') + '\n' } - {t('OS Solution')} - - } - description="Unveiling Next-Gen Software Enginneering: Pioneering Architectural Paradigms with GenAI" - button={ - <> - - - - - } - /> -
    -
    ; +
    + + <>{`${t('AI4SDLC')}\n`} + {t('OS Solution')} + + } + description="Unveiling Next-Gen Software Enginneering: Pioneering Architectural Paradigms with GenAI" + button={ + <> + + + + + } + /> +
    +
    + ); }; export { Hero }; diff --git a/src/components/templates/VerticalFeatures.tsx b/src/components/templates/VerticalFeatures.tsx index 2803726..1246e1e 100644 --- a/src/components/templates/VerticalFeatures.tsx +++ b/src/components/templates/VerticalFeatures.tsx @@ -1,92 +1,93 @@ +import { useTranslation } from 'react-i18next'; + import { VerticalFeatureRow } from '@/components/feature/VerticalFeatureRow'; import { Section } from '@/layout/Section'; -import { useTranslation } from "react-i18next"; function Overview() { - return overview; + return overview; } const VerticalFeatures = () => { - const { t } = useTranslation(); + const { t } = useTranslation(); - return ( -
    - - - + - - - - - - -
    - ); + image="/assets/images/chocolate-factory.svg" + imageAlt="Chocolate Factory Architecture diagram" + projectLink="https://github.com/unit-mesh/chocolate-factory" + demoVideo="https://www.bilibili.com/video/BV1T14y1C7p2/" + docLink="https://framework.unitmesh.cc" + reverse + /> + + + + + + + + ); }; export { VerticalFeatures }; diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 41f196c..db6a641 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -1,53 +1,56 @@ -import i18n from 'i18next' -import { initReactI18next } from 'react-i18next' -import LanguageDetector from 'i18next-browser-languagedetector' +import i18n from 'i18next'; +import LanguageDetector from 'i18next-browser-languagedetector'; +import { initReactI18next } from 'react-i18next'; // the translations // (tip move them in a JSON file and import them, // or even better, manage them separated from your code: https://react.i18next.com/guides/multiple-translation-files) const resources = { - zh: { - translation: { - 'AI4SDLC': '生成式 AI 赋能软件研发', - 'OS Solution': '开源解决方案', - 'Download White Paper': '下载《UnitMesh 技术白皮书》', - // 端到端的开源 AI 赋能软件研发全流程 - 'E2E open source AI4SDLC': '端到端的开源 AI 赋能软件研发全流程', - // 构建下一代软件生成式应用开发范式 - 'Build NG AI4SE': '构建下一代软件生成式应用开发范式', - // AI 编码助手 - 'AI-Assistant Development': 'AI 编码助手', - } - }, - 'en-US': { - translation: { - 'AI4SDLC': 'AI Empowered Software Development', - 'OS Solution': 'Open Source Solution', - 'Download White Paper': 'Download White Paper of UnitMesh Technology', - 'E2E open source AI4SDLC': 'End-to-end open source AI4SDLC', - 'Build NG AI4SE': 'Build next-gen AI4SDLC', - 'AI-Assistant Development': 'AI-Assistant Development', - } - }, -} + zh: { + translation: { + AI4SDLC: '生成式 AI 赋能软件研发', + 'OS Solution': '开源解决方案', + 'Download White Paper': '下载《UnitMesh 技术白皮书》', + // 端到端的开源 AI 赋能软件研发全流程 + 'E2E open source AI4SDLC': '端到端的开源 AI 赋能软件研发全流程', + // 构建下一代软件生成式应用开发范式 + 'Build NG AI4SE': '构建下一代软件生成式应用开发范式', + // AI 编码助手 + 'AI-Assistant Development': 'AI 编码助手', + }, + }, + 'en-US': { + translation: { + AI4SDLC: 'AI Empowered Software Development', + 'OS Solution': 'Open Source Solution', + 'Download White Paper': 'Download White Paper of UnitMesh Technology', + 'E2E open source AI4SDLC': 'End-to-end open source AI4SDLC', + 'Build NG AI4SE': 'Build next-gen AI4SDLC', + 'AI-Assistant Development': 'AI-Assistant Development', + }, + }, +}; i18n - .use(initReactI18next) // passes i18n down to react-i18next - .use(LanguageDetector) - .init({ - resources, - fallbackLng: 'en-US', - // debug: true, - lng: 'zh', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources - // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage - // if you're using a language detector, do not define the lng option + .use(initReactI18next) // passes i18n down to react-i18next + .use(LanguageDetector) + .init( + { + resources, + fallbackLng: 'en-US', + // debug: true, + lng: 'zh', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources + // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage + // if you're using a language detector, do not define the lng option - interpolation: { - escapeValue: false // react already safes from xss - } - }, (err) => { - if (err) return console.log('something went wrong loading', err) - console.log('i18n loaded successfully') - }) + interpolation: { + escapeValue: false, // react already safes from xss + }, + }, + (err) => { + if (err) return console.log('something went wrong loading', err); + console.log('i18n loaded successfully'); + }, + ); -export default i18n \ No newline at end of file +export default i18n; diff --git a/tsconfig.json b/tsconfig.json index dc6f5d2..0684090 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,10 @@ { "compilerOptions": { - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, @@ -10,7 +14,6 @@ "alwaysStrict": true, "strictNullChecks": true, "noUncheckedIndexedAccess": true, - "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, @@ -18,29 +21,36 @@ "noUnusedParameters": true, "allowUnreachableCode": false, "noFallthroughCasesInSwitch": true, - "target": "es5", "outDir": "out", "declaration": true, "sourceMap": true, - "esModuleInterop": true, "allowSyntheticDefaultImports": true, "allowJs": false, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "jsx": "preserve", "noEmit": true, "isolatedModules": true, "incremental": true, - "baseUrl": ".", "paths": { - "@/*": ["./src/*"], - "@/public/*": ["./public/*"] + "@/*": [ + "./src/*" + ], + "@/public/*": [ + "./public/*" + ] } }, - "exclude": ["./out/**/*", "./node_modules/**/*"], - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] + "exclude": [ + "./out/**/*", + "./node_modules/**/*" + ], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ] }