Connect, collaborate, and grow with a community of TypeScript developers
cleanup (#1674)
bautistaaaf95942d20a0f
diff --git a/apps/aot/src/components/navigation/index.tsx b/apps/aot/src/components/navigation/index.tsxindex a4b822c4..be0030b0 100644--- a/apps/aot/src/components/navigation/index.tsx+++ b/apps/aot/src/components/navigation/index.tsx@@ -21,7 +21,7 @@ import { Button } from '@repo/ui/components/button';import { Separator } from '@repo/ui/components/separator';import { NavLinksWithYear, YearSwitcher } from './year-switcher';-const DISCORD_INVITE_LINK = 'https://discord.gg/trash-devs-796594544980000808';+const DISCORD_INVITE_LINK = 'https://discord.gg/WjZhvVbFHM';const TWITTER_LINK = 'https://x.com/typeheroapp';const GITHUB_LINK = 'https://github.com/typehero/typehero';diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 6338101a..af98ed64 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -74,6 +74,7 @@"react-syntax-highlighter": "^15.5.0","recharts": "^2.12.7","rehype-raw": "^7.0.0",+ "rehype-sanitize": "^6.0.0","remark-gfm": "^3.0.1","tailwind-merge": "^1.14.0","tailwindcss-animate": "^1.0.6",diff --git a/packages/ui/src/components/markdown.tsx b/packages/ui/src/components/markdown.tsxindex bd26a267..0c0a2652 100644--- a/packages/ui/src/components/markdown.tsx+++ b/packages/ui/src/components/markdown.tsx@@ -7,6 +7,7 @@ import { useState } from 'react';import ReactMarkdown from 'react-markdown';import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';import rehypeRaw from 'rehype-raw';+import rehypeSanitize from 'rehype-sanitize';import remarkGfm from 'remark-gfm';import type { Transformer } from 'unified';import { SKIP, visit, type BuildVisitor } from 'unist-util-visit';@@ -83,6 +84,15 @@ export function Markdown({p: ({ className, ...props }) => (<p className={clsx(className, 'mb-4 overflow-hidden text-ellipsis')} {...props} />),+ blockquote: ({ className, ...props }) => (+ <blockquote+ className={clsx(+ className,+ 'mx-3 my-[10px] border-l-8 border-gray-400 bg-zinc-200 px-2 py-[10px] dark:border-gray-200 dark:bg-zinc-700 ',+ )}+ {...props}+ />+ ),code({ inline, className, children, style: _, ...props }) {const match = /language-(\w+)/.exec(className || '');return !inline && match ? (@@ -118,10 +128,8 @@ export function Markdown({details: ({ ...props }) => <details {...props} />,summary: ({ ...props }) => <summary {...props} />,}}- // FIXME: this is vuln to XSS and I don't know why we use it, let's remove it- // or add in a sanitizer lib like: https://github.com/rehypejs/rehype-sanitize// eslint-disable-next-line @typescript-eslint/no-explicit-any- rehypePlugins={[rehypeRaw as any]}+ rehypePlugins={[rehypeRaw as any, rehypeSanitize]}remarkPlugins={[removeHtmlComments, remarkGfm, ...(disableMentions ? [] : [userMentions])]}>{children}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex b078e243..1e8abdbe 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -158,7 +158,7 @@ importers:version: 13.4.10([email protected])([email protected])eslint-plugin-import:specifier: ^2.27.5- version: 2.27.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 2.27.5([email protected])postcss:specifier: ^8.4.31version: 8.4.31@@ -675,7 +675,7 @@ importers:version: 13.4.10([email protected])([email protected])eslint-plugin-import:specifier: ^2.27.5- version: 2.27.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 2.27.5([email protected])postcss:specifier: ^8.4.31version: 8.4.31@@ -996,6 +996,9 @@ importers:rehype-raw:specifier: ^7.0.0version: 7.0.0+ rehype-sanitize:+ specifier: ^6.0.0+ version: 6.0.0remark-gfm:specifier: ^3.0.1version: 3.0.1@@ -1029,7 +1032,7 @@ importers:dependencies:'@next/eslint-plugin-next':specifier: canary- version: 15.0.4-canary.31+ version: 15.0.4-canary.32'@repo/tsconfig':specifier: workspace:*version: link:../config-typescript@@ -1041,7 +1044,7 @@ importers:version: 5.62.0([email protected])([email protected])'@vercel/style-guide':specifier: ^4.0.2eslint:specifier: ^8.45.0version: 8.45.0@@ -2161,8 +2164,8 @@ packages:'@next/[email protected]':resolution: {integrity: sha512-YJqyq6vk39JQfvaNtN83t/p5Jy45+bazRL+V4QI8FPd3FBqFYMEsULiwRLgSJMgFqkk4t4JbeZurz+gILEAFpA==}- '@next/[email protected]':- resolution: {integrity: sha512-MKVZiozu+3LOM7eo3DNEcmeD0V3i/AXM1lQr9ayFYMgxeCiqXSt9bRPy6KPIKJutw//Md0s16i1rtYFLB3531A==}+ '@next/[email protected]':+ resolution: {integrity: sha512-/unTTW/QcaRS+axtB8FaAKrUD7fviPomAaSYhLuSvQoQUh/mdtddufq9bIpCZ/sX1NWZni4tzybQKjeotOiRfw==}'@next/[email protected]':resolution: {integrity: sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==}@@ -6089,6 +6092,9 @@ packages:resolution: {integrity: sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==}+ resolution: {integrity: sha512-3yTWghByc50aGS7JlGhk61SPenfE/p1oaFeNwkOOyrscaOkMGrcW9+Cy/QAIOBpZxP1yqDIzFMR0+Np0i0+usg==}+resolution: {integrity: sha512-QQhWMhgTFRhCaQdgTKzZ5g31GLQ9qRb1hZtDPMqQaOhpLBziWcshUS0uCR5IJ0U1jrK/mxg35fmcq+Dp/Cy2Aw==}@@ -7917,6 +7923,9 @@ packages:resolution: {integrity: sha512-REDTNCvsKcAazy8IQWzKp66AhSUDSOIKssSCqNqCcT9sN7JCwAAm3mWGTUdUzq80ABuy8d0D6RBwbnewu1aY1g==}engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}+ resolution: {integrity: sha512-CsnhKNsyI8Tub6L4sm5ZFsme4puGfc6pYylvXo1AeqaGbjOYyzNv3qZPwvs0oMJ39eryyeOdmxwUIo94IpEhqg==}+resolution: {integrity: sha512-Gf91dJoXneiorNEnn+Phx97CO7oRMrpi+6r155tTxzGuLtm+QrI4cTwCa9e1rtePdL4i9tSO58PeSS6HWfgsiw==}@@ -8324,7 +8333,7 @@ packages:resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==}engines: {node: '>= 4.0'}- deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net+ deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==}@@ -10092,7 +10101,7 @@ snapshots:dependencies:glob: 7.1.7- '@next/[email protected]':+ '@next/[email protected]':dependencies:fast-glob: 3.3.1@@ -12403,7 +12412,7 @@ snapshots:next: 14.2.5(@babel/[email protected])(@playwright/[email protected])([email protected]([email protected]))([email protected])react: 18.2.0- '@vercel/[email protected](@next/[email protected])([email protected])([email protected])([email protected])':+ '@vercel/[email protected](@next/[email protected])([email protected])([email protected])([email protected])':dependencies:'@babel/core': 7.22.10'@babel/eslint-parser': 7.22.10(@babel/[email protected])([email protected])@@ -12425,7 +12434,7 @@ snapshots:eslint-plugin-unicorn: 43.0.2([email protected])prettier-plugin-packagejson: 2.4.3([email protected])optionalDependencies:- '@next/eslint-plugin-next': 15.0.4-canary.31+ '@next/eslint-plugin-next': 15.0.4-canary.32eslint: 8.45.0prettier: 3.1.1typescript: 5.3.3@@ -13785,7 +13794,7 @@ snapshots:'@typescript-eslint/parser': 5.62.0([email protected])([email protected])eslint: 8.56.0eslint-import-resolver-node: 0.3.7- eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])eslint-plugin-import: 2.27.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])eslint-plugin-jsx-a11y: 6.7.1([email protected])eslint-plugin-react: 7.32.2([email protected])@@ -13823,7 +13832,7 @@ snapshots:enhanced-resolve: 5.15.0eslint: 8.45.0eslint-module-utils: 2.8.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])- eslint-plugin-import: 2.27.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]))([email protected])+ eslint-plugin-import: 2.27.5([email protected])get-tsconfig: 4.6.2globby: 13.2.2is-core-module: 2.12.1@@ -13853,7 +13862,7 @@ snapshots:- eslint-import-resolver-webpack- supports-color- [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected]):+ [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected]):dependencies:debug: 4.3.4enhanced-resolve: 5.15.0@@ -13900,7 +13909,7 @@ snapshots:'@typescript-eslint/parser': 5.62.0([email protected])([email protected])eslint: 8.56.0eslint-import-resolver-node: 0.3.7- eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected]))([email protected])+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])transitivePeerDependencies:- supports-color@@ -13985,6 +13994,29 @@ snapshots:- eslint-import-resolver-webpack- supports-color+ dependencies:+ array-includes: 3.1.6+ array.prototype.flat: 1.3.1+ array.prototype.flatmap: 1.3.1+ debug: 3.2.7+ doctrine: 2.1.0+ eslint: 8.45.0+ eslint-import-resolver-node: 0.3.7+ eslint-module-utils: 2.8.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])+ has: 1.0.3+ is-core-module: 2.12.1+ is-glob: 4.0.3+ minimatch: 3.1.2+ object.values: 1.1.6+ resolve: 1.22.2+ semver: 6.3.1+ tsconfig-paths: 3.14.2+ transitivePeerDependencies:+ - eslint-import-resolver-typescript+ - eslint-import-resolver-webpack+ - supports-color+[email protected](@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]))([email protected])([email protected]):dependencies:'@typescript-eslint/utils': 5.59.1([email protected])([email protected])@@ -14785,6 +14817,12 @@ snapshots:web-namespaces: 2.0.1zwitch: 2.0.4+ dependencies:+ '@types/hast': 3.0.2+ '@ungap/structured-clone': 1.2.0+ unist-util-position: 5.0.0+dependencies:'@types/hast': 2.3.5@@ -16970,6 +17008,11 @@ snapshots:unified: 10.1.2unist-util-visit: 4.1.2+ dependencies:+ '@types/hast': 3.0.2+ hast-util-sanitize: 5.0.2+dependencies:'@types/hast': 2.3.5