diff --git a/.eslintignore b/.eslintignore index 9990df5fb57e..6a8267f9478f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,7 +6,6 @@ build coverage jest.config.js jest.transform.js -website/ scripts examples/ diff --git a/.eslintrc.js b/.eslintrc.js index d379a078aa32..0586a31c0f64 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -49,7 +49,16 @@ module.exports = { // Ignore certain webpack alias because it can't be resolved 'import/no-unresolved': [ ERROR, - {ignore: ['^@theme', '^@docusaurus', '^@generated', 'unist', 'mdast']}, + { + ignore: [ + '^@theme', + '^@docusaurus', + '^@generated', + '^@site', + 'unist', + 'mdast', + ], + }, ], 'import/extensions': OFF, 'header/header': [ diff --git a/website/_dogfooding/_pages tests/error-boundary-tests.js b/website/_dogfooding/_pages tests/error-boundary-tests.tsx similarity index 68% rename from website/_dogfooding/_pages tests/error-boundary-tests.js rename to website/_dogfooding/_pages tests/error-boundary-tests.tsx index b4c016c0a5dd..2edbd8ff5331 100644 --- a/website/_dogfooding/_pages tests/error-boundary-tests.js +++ b/website/_dogfooding/_pages tests/error-boundary-tests.tsx @@ -1,9 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + import React from 'react'; import Layout from '@theme/Layout'; import ErrorBoundaryTestButton from '@site/src/components/ErrorBoundaryTestButton'; -export default function ErrorBoundaryTests() { +export default function ErrorBoundaryTests(): JSX.Element { return ( <> Crash outside layout diff --git a/website/_dogfooding/_pages tests/hydration-tests.js b/website/_dogfooding/_pages tests/hydration-tests.tsx similarity index 50% rename from website/_dogfooding/_pages tests/hydration-tests.js rename to website/_dogfooding/_pages tests/hydration-tests.tsx index 308930a25d85..4a133497b65d 100644 --- a/website/_dogfooding/_pages tests/hydration-tests.js +++ b/website/_dogfooding/_pages tests/hydration-tests.tsx @@ -1,3 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + import React from 'react'; import Layout from '@theme/Layout'; @@ -6,15 +13,18 @@ function BuggyText() { return ( Built using the{' '} - + Electron {' '} , based on{' '} - + Chromium , and written using{' '} - + TypeScript {' '} , Xplorer promises you an unprecedented experience. @@ -22,7 +32,7 @@ function BuggyText() { ); } -export default function Home() { +export default function Home(): JSX.Element { return ( diff --git a/website/_dogfooding/clientModuleExample.ts b/website/_dogfooding/clientModuleExample.ts index f04597e22621..e730f3f3a74e 100644 --- a/website/_dogfooding/clientModuleExample.ts +++ b/website/_dogfooding/clientModuleExample.ts @@ -7,7 +7,8 @@ import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; -export function onRouteUpdate({location}: {location: Location}) { +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function onRouteUpdate({location}: {location: Location}): void { // console.log('onRouteUpdate', {location}); } diff --git a/website/_dogfooding/docs-tests-sidebars.js b/website/_dogfooding/docs-tests-sidebars.js index 02682bbdd8d3..5dd836d53cba 100644 --- a/website/_dogfooding/docs-tests-sidebars.js +++ b/website/_dogfooding/docs-tests-sidebars.js @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -64,7 +64,6 @@ module.exports = { }; function generateHugeSidebarItems() { - const maxLevel = 4; const linksCount = 8; const categoriesCount = 8; @@ -88,5 +87,5 @@ function generateHugeSidebarItems() { return [...linkItems, ...categoryItems]; } - return generateRecursive(maxLevel); + return generateRecursive(4); } diff --git a/website/_dogfooding/dogfooding.config.js b/website/_dogfooding/dogfooding.config.js index be9960027238..efd1eed139ed 100644 --- a/website/_dogfooding/dogfooding.config.js +++ b/website/_dogfooding/dogfooding.config.js @@ -1,3 +1,10 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + const fs = require('fs'); /** @type {import('@docusaurus/types').PluginConfig[]} */ diff --git a/website/babel.config.js b/website/babel.config.js index 81604ce8ec2e..cd005dd9cccc 100644 --- a/website/babel.config.js +++ b/website/babel.config.js @@ -3,8 +3,6 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - * - * @format */ module.exports = { diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 51714a03c948..033433424b07 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -11,11 +11,16 @@ const versions = require('./versions.json'); const math = require('remark-math'); const katex = require('rehype-katex'); const VersionsArchived = require('./versionsArchived.json'); -const ArchivedVersionsDropdownItems = Object.entries(VersionsArchived).splice( - 0, - 5, -); const {dogfoodingPluginInstances} = require('./_dogfooding/dogfooding.config'); +const FeatureRequestsPlugin = require('./src/featureRequests/FeatureRequestsPlugin'); +const npm2yarn = require('@docusaurus/remark-plugin-npm2yarn'); +// eslint-disable-next-line import/no-extraneous-dependencies +const lightTheme = require('prism-react-renderer/themes/github'); +// eslint-disable-next-line import/no-extraneous-dependencies +const darkTheme = require('prism-react-renderer/themes/dracula'); + +const ArchivedVersionsDropdownItems = + Object.entries(VersionsArchived).splice(0, 5); // This probably only makes sense for the beta phase, temporary function getNextBetaVersionName() { @@ -80,6 +85,7 @@ const config = { ], i18n: { defaultLocale: 'en', + // eslint-disable-next-line no-nested-ternary locales: isDeployPreview ? // Deploy preview: keep it fast! ['en'] @@ -109,7 +115,7 @@ const config = { clientModules: [require.resolve('./_dogfooding/clientModuleExample.ts')], themes: ['@docusaurus/theme-live-codeblock'], plugins: [ - require('./src/featureRequests/FeatureRequestsPlugin'), + FeatureRequestsPlugin, [ '@docusaurus/plugin-content-docs', /** @type {import('@docusaurus/plugin-content-docs').Options} */ @@ -134,12 +140,13 @@ const config = { /** @type {import('@docusaurus/plugin-client-redirects').Options} */ ({ fromExtensions: ['html'], - createRedirects: function (path) { + createRedirects(routePath) { // redirect to /docs from /docs/introduction, // as introduction has been made the home doc - if (allDocHomesPaths.includes(path)) { - return [`${path}/introduction`]; + if (allDocHomesPaths.includes(routePath)) { + return [`${routePath}/introduction`]; } + return []; }, redirects: [ { @@ -254,11 +261,12 @@ const config = { showLastUpdateTime: true, remarkPlugins: [ math, - [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}], + [npm2yarn, {sync: true}], ], rehypePlugins: [katex], disableVersioning: isVersioningDisabled, lastVersion: isDev ? 'current' : undefined, + // eslint-disable-next-line no-nested-ternary onlyIncludeVersions: isBuildFast ? ['current'] : !isVersioningDisabled && (isDev || isDeployPreview) @@ -288,7 +296,7 @@ const config = { blogSidebarTitle: 'All our posts', }, pages: { - remarkPlugins: [require('@docusaurus/remark-plugin-npm2yarn')], + remarkPlugins: [npm2yarn], }, theme: { customCss: [require.resolve('./src/css/custom.css')], @@ -314,8 +322,8 @@ const config = { content: `⭐️ If you like Docusaurus, give it a star on GitHub and follow us on Twitter ${TwitterSvg}`, }, prism: { - theme: require('prism-react-renderer/themes/github'), - darkTheme: require('prism-react-renderer/themes/dracula'), + theme: lightTheme, + darkTheme, additionalLanguages: ['java'], }, image: 'img/docusaurus-soc.png', diff --git a/website/package.json b/website/package.json index daf8e430ee27..32806d4cbca3 100644 --- a/website/package.json +++ b/website/package.json @@ -38,6 +38,7 @@ "@docusaurus/preset-classic": "2.0.0-beta.9", "@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.9", "@docusaurus/theme-live-codeblock": "2.0.0-beta.9", + "@docusaurus/utils": "2.0.0-beta.9", "clsx": "^1.1.1", "color": "^4.0.1", "esbuild-loader": "2.13.1", diff --git a/website/sidebars.js b/website/sidebars.js index bba95b456a00..56fc549a5f18 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the diff --git a/website/sidebarsCommunity.js b/website/sidebarsCommunity.js index ff125aaa6020..472c48590f95 100644 --- a/website/sidebarsCommunity.js +++ b/website/sidebarsCommunity.js @@ -1,4 +1,4 @@ -/* +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the diff --git a/website/src/components/BrowserWindow/index.tsx b/website/src/components/BrowserWindow/index.tsx index 0feb3b8267f6..d3aa77384427 100644 --- a/website/src/components/BrowserWindow/index.tsx +++ b/website/src/components/BrowserWindow/index.tsx @@ -15,7 +15,7 @@ interface Props { url: string; } -function BrowserWindow({children, minHeight, url}: Props) { +function BrowserWindow({children, minHeight, url}: Props): JSX.Element { return (
diff --git a/website/src/components/ColorGenerator/index.tsx b/website/src/components/ColorGenerator/index.tsx index 9cbb4ef885dc..70c8313655b7 100644 --- a/website/src/components/ColorGenerator/index.tsx +++ b/website/src/components/ColorGenerator/index.tsx @@ -66,10 +66,10 @@ const COLOR_SHADES: Record< const DEFAULT_PRIMARY_COLOR = '3578e5'; -function ColorGenerator() { +function ColorGenerator(): JSX.Element { const [baseColor, setBaseColor] = useState(DEFAULT_PRIMARY_COLOR); const [shades, setShades] = useState(COLOR_SHADES); - const color = Color('#' + baseColor); + const color = Color(`#${baseColor}`); const adjustedColors = Object.keys(shades) .map((shade) => ({ ...shades[shade], @@ -83,6 +83,7 @@ function ColorGenerator() { return (

+ {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */} {' '} @@ -96,7 +97,7 @@ function ColorGenerator() { const colorValue = event.target.value.replace(/^#+/, ''); try { - Color('#' + colorValue); + Color(`#${baseColor}`); setBaseColor(colorValue); } catch { // Don't update for invalid colors. @@ -150,7 +151,7 @@ function ColorGenerator() { [variableName]: { ...shades[variableName], adjustmentInput: event.target.value, - adjustment: isNaN(newValue) + adjustment: Number.isNaN(newValue) ? adjustment : newValue / 100.0, }, diff --git a/website/src/components/ErrorBoundaryTestButton/index.tsx b/website/src/components/ErrorBoundaryTestButton/index.tsx index 5c7f0edfd2c9..0dd2fc5f5190 100644 --- a/website/src/components/ErrorBoundaryTestButton/index.tsx +++ b/website/src/components/ErrorBoundaryTestButton/index.tsx @@ -5,12 +5,20 @@ * LICENSE file in the root directory of this source tree. */ -import React, {useState} from 'react'; +import React, {ReactNode, useState} from 'react'; -export default function ErrorBoundaryTestButton({children = 'Boom!'}) { +export default function ErrorBoundaryTestButton({ + children = 'Boom!', +}: { + children?: ReactNode; +}): JSX.Element { const [state, setState] = useState(false); if (state) { throw new Error('Boom!'); } - return ; + return ( + + ); } diff --git a/website/src/components/Playground/index.tsx b/website/src/components/Playground/index.tsx index 3d19b4bd4c0e..eeea130f5b9e 100644 --- a/website/src/components/Playground/index.tsx +++ b/website/src/components/Playground/index.tsx @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +/* eslint-disable global-require */ + import React from 'react'; import Translate from '@docusaurus/Translate'; import Link from '@docusaurus/Link'; @@ -32,7 +34,7 @@ const Playgrounds = [ id="playground.stackblitz.description" values={{ webContainersLink: ( - + WebContainers ), @@ -77,7 +79,7 @@ function PlaygroundCard({name, image, url, description}: Props) { ); } -export function PlaygroundCardsRow() { +export function PlaygroundCardsRow(): JSX.Element { return (

{Playgrounds.map((playground) => ( diff --git a/website/src/components/TeamProfileCards/index.tsx b/website/src/components/TeamProfileCards/index.tsx index a2110c471068..a3c9e8032416 100644 --- a/website/src/components/TeamProfileCards/index.tsx +++ b/website/src/components/TeamProfileCards/index.tsx @@ -41,7 +41,7 @@ function TeamProfileCard({
{`${name}'s
@@ -71,11 +71,11 @@ function TeamProfileCard({ function TeamProfileCardCol(props: ProfileProps) { return ( - + ); } -export function ActiveTeamRow() { +export function ActiveTeamRow(): JSX.Element { return (
Full Front End Stack developer who likes working on the Jamstack. - Working on Docusaurus made him Facebook's unofficial part-time Open - Source webmaster, which is an awesome role to be in. + Working on Docusaurus made him Facebook's unofficial part-time + Open Source webmaster, which is an awesome role to be in.
); } -export function HonoraryAlumniTeamRow() { +export function HonoraryAlumniTeamRow(): JSX.Element { return (
Fullstack developer who loves to code and try new technologies. In his free time, he contributes to open source, writes blog posts on his{' '} - + website {' '} and watches Anime. @@ -184,11 +184,14 @@ export function StudentFellowsTeamRow() { Fanny got started with web development in high school, building a project for the school kitchen. In her free time she loves contributing to Open Source, occasionally writing on{' '} - + her blog {' '} about her experiences, cooking, and creating{' '} - + Spotify playlists . diff --git a/website/src/components/showcase/ShowcaseCheckbox/index.tsx b/website/src/components/showcase/ShowcaseCheckbox/index.tsx index 43b571646d57..13599312300b 100644 --- a/website/src/components/showcase/ShowcaseCheckbox/index.tsx +++ b/website/src/components/showcase/ShowcaseCheckbox/index.tsx @@ -14,7 +14,12 @@ interface Props extends ComponentProps<'input'> { label: ReactNode; } -function ShowcaseCheckbox({title, className, label, ...props}: Props) { +function ShowcaseCheckbox({ + title, + className, + label, + ...props +}: Props): JSX.Element { const id = `showcase_checkbox_id_${props.name};`; return (
diff --git a/website/src/components/showcase/ShowcaseSelect/index.tsx b/website/src/components/showcase/ShowcaseSelect/index.tsx index 423335cc94eb..c685a212912c 100644 --- a/website/src/components/showcase/ShowcaseSelect/index.tsx +++ b/website/src/components/showcase/ShowcaseSelect/index.tsx @@ -13,7 +13,7 @@ interface Props extends ComponentProps<'select'> { label: string; } -function ShowcaseSelect({label, ...props}: Props) { +function ShowcaseSelect({label, ...props}: Props): JSX.Element { const id = `showcase_select_id_${props.name};`; return (
diff --git a/website/src/data/users.tsx b/website/src/data/users.tsx index fb42ae1a0ec3..26dd7e2bbea1 100644 --- a/website/src/data/users.tsx +++ b/website/src/data/users.tsx @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +/* eslint-disable global-require */ + import React from 'react'; import {difference, sortBy} from '../utils/jsUtils'; @@ -154,7 +156,8 @@ export const Tags: Record = { const Users: User[] = [ { title: 'Aide Jeune', - description: 'French Discord server that helps young people who have been bullied or feel bad about themselves', + description: + 'French Discord server that helps young people who have been bullied or feel bad about themselves', preview: require('./showcase/aide_jeune.png'), website: 'https://aidejeune.fr', source: 'https://github.com/AideJeune', @@ -200,7 +203,7 @@ const Users: User[] = [ preview: require('./showcase/apache-apisix.png'), website: 'https://apisix.apache.org/', source: 'https://github.com/apache/apisix-website', - tags: ['opensource','i18n','large'], + tags: ['opensource', 'i18n', 'large'], }, { title: 'Apex FP', @@ -246,7 +249,8 @@ const Users: User[] = [ }, { title: 'Blink Shell Docs', - description: 'Documentation for Blink Shell a professional, desktop grade terminal for iOS', + description: + 'Documentation for Blink Shell a professional, desktop grade terminal for iOS', preview: require('./showcase/blinkshell.png'), website: 'https://docs.blink.sh/', source: 'https://github.com/blinksh/docs', @@ -258,7 +262,7 @@ const Users: User[] = [ preview: require('./showcase/johnnyreilly.png'), website: 'https://blog.johnnyreilly.com/', source: 'https://github.com/johnnyreilly/blog.johnnyreilly.com', - tags: ['opensource','personal','large'], + tags: ['opensource', 'personal', 'large'], }, { title: 'Blogasaurus', @@ -266,7 +270,7 @@ const Users: User[] = [ preview: require('./showcase/Blogasaurus.png'), website: 'https://blog.palashsh.me/', source: 'https://github.com/BattleOfPlassey/blogasaurus', - tags: ['personal', 'opensource'] + tags: ['personal', 'opensource'], }, { title: 'Botonic', @@ -295,7 +299,8 @@ const Users: User[] = [ }, { title: 'ClarityChallenge', - description: 'Documentation for the Clarity machine learning challenges for improving hearing aid signal processing', + description: + 'Documentation for the Clarity machine learning challenges for improving hearing aid signal processing', preview: require('./showcase/claritychallenge.png'), website: 'https://claritychallenge.github.io/clarity_CEC1_doc', source: 'https://github.com/claritychallenge/clarity_CEC1_doc', @@ -303,10 +308,12 @@ const Users: User[] = [ }, { title: 'Cloudy with a chance of Big Data', - description: 'A blog only Docusaurus site showcasing cloud, data and full stack design patterns and tutorials', + description: + 'A blog only Docusaurus site showcasing cloud, data and full stack design patterns and tutorials', preview: require('./showcase/cloudywithachanceofbigdata.png'), website: 'https://cloudywithachanceofbigdata.com/', - source: 'https://github.com/cloudywithachanceofbigdata/cloudywithachanceofbigdata.github.io', + source: + 'https://github.com/cloudywithachanceofbigdata/cloudywithachanceofbigdata.github.io', tags: ['opensource', 'personal'], }, { @@ -319,7 +326,8 @@ const Users: User[] = [ }, { title: 'CodeYourFuture', - description: 'The syllabus for CodeYourFuture - a free code school for refugees, asylum seekers and disadvantaged people', + description: + 'The syllabus for CodeYourFuture - a free code school for refugees, asylum seekers and disadvantaged people', preview: require('./showcase/codeyourfuture.png'), website: 'https://syllabus.codeyourfuture.io/', source: 'https://github.com/CodeYourFuture/syllabus', @@ -351,7 +359,8 @@ const Users: User[] = [ }, { title: 'Country State City API', - description: 'Get simplified countries, states & cities data without bloating up your database.', + description: + 'Get simplified countries, states & cities data without bloating up your database.', preview: require('./showcase/countrystatecity.png'), website: 'https://countrystatecity.in/', source: 'https://github.com/dr5hn/csc-website', @@ -367,7 +376,8 @@ const Users: User[] = [ }, { title: 'CryptoDevHub', - description: 'The place where Blockchain- and Crypto developers learn, meet and grow.', + description: + 'The place where Blockchain- and Crypto developers learn, meet and grow.', preview: require('./showcase/cryptodevhub.png'), website: 'https://cryptodevhub.io', source: 'https://github.com/cryptodevhub/site', @@ -384,7 +394,8 @@ const Users: User[] = [ }, { title: 'Dart Code Metrics', - description: 'Static analysis tool that helps analyse and improve Dart code quality.', + description: + 'Static analysis tool that helps analyse and improve Dart code quality.', preview: require('./showcase/dart-code-metrics.png'), website: 'https://dartcodemetrics.dev/', source: 'https://github.com/dart-code-checker/dart-code-metrics', @@ -413,7 +424,7 @@ const Users: User[] = [ preview: require('./showcase/djamaile.png'), website: 'https://djamaile.dev/', source: 'https://github.com/djamaile/portfolio', - tags: ['opensource','personal'], + tags: ['opensource', 'personal'], }, { title: 'Draft.js', @@ -421,7 +432,7 @@ const Users: User[] = [ preview: require('./showcase/draftjs.png'), website: 'https://draftjs.org/', source: 'https://github.com/facebook/draft-js', - tags: ['opensource','facebook'], + tags: ['opensource', 'facebook'], }, { title: 'Easyjwt', @@ -429,7 +440,7 @@ const Users: User[] = [ preview: require('./showcase/easyjwt.png'), website: 'https://www.easyjwt.org', source: 'https://github.com/authdog/easyjwt', - tags: ['opensource','i18n'], + tags: ['opensource', 'i18n'], }, { title: 'Eightshift Docs', @@ -459,7 +470,8 @@ const Users: User[] = [ }, { title: "Evan Tay's Personal Website", - description: "A Software Engineer's blog, documentation and project portfolio.", + description: + "A Software Engineer's blog, documentation and project portfolio.", preview: require('./showcase/evantay.png'), website: 'https://evantay.com/', source: 'https://github.com/DigiPie/kaya-folio', @@ -511,7 +523,7 @@ const Users: User[] = [ preview: require('./showcase/flexit.png'), website: 'https://learn.flexitanalytics.com/', source: 'https://github.com/ataft/flexit-docs', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'Flux', @@ -560,7 +572,7 @@ const Users: User[] = [ preview: require('./showcase/graphql-codegen.png'), website: 'https://graphql-code-generator.com/', source: 'https://github.com/dotansimha/graphql-code-generator', - tags: ['favorite', 'opensource','design'], + tags: ['favorite', 'opensource', 'design'], }, { title: 'GraphQL Inspector', @@ -568,7 +580,7 @@ const Users: User[] = [ preview: require('./showcase/graphql-inspector.png'), website: 'https://graphql-inspector.com', source: 'https://github.com/kamilkisiela/graphql-inspector', - tags: ['opensource', 'design','product'], + tags: ['opensource', 'design', 'product'], }, { title: 'GraphQL Mesh', @@ -633,24 +645,26 @@ const Users: User[] = [ preview: require('./showcase/intelagent.png'), website: 'https://www.intelagent.ca/', source: 'https://github.com/intelagentbilling/docs', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'Indent', - description: 'Indent provides on-demand access control for cloud apps and infrastructure.', + description: + 'Indent provides on-demand access control for cloud apps and infrastructure.', preview: require('./showcase/indent.png'), website: 'https://indent.com/developers', source: null, - tags: ['product','design'], + tags: ['product', 'design'], }, { title: 'InfraQL Technologies', - description: 'InfraQL is a SQL based approach to cloud infrastructure coding, API querying and automation.', + description: + 'InfraQL is a SQL based approach to cloud infrastructure coding, API querying and automation.', preview: require('./showcase/infraql-docs.png'), website: 'https://docs.infraql.io/', source: null, tags: ['product'], - }, + }, { title: 'IOTA-Wiki', description: 'Documantation and wiki for the IOTA project', @@ -661,11 +675,12 @@ const Users: User[] = [ }, { title: 'Jest', - description: 'Jest is a delightful JavaScript Testing Framework with a focus on simplicity.', + description: + 'Jest is a delightful JavaScript Testing Framework with a focus on simplicity.', preview: require('./showcase/jest.png'), website: 'https://jestjs.io/', source: 'https://github.com/facebook/jest/tree/master/website', - tags: ['favorite','opensource','design','i18n','versioning'], + tags: ['favorite', 'opensource', 'design', 'i18n', 'versioning'], }, { title: 'Kosko', @@ -673,7 +688,7 @@ const Users: User[] = [ preview: require('./showcase/kosko.png'), website: 'https://kosko.dev', source: 'https://github.com/tommy351/kosko', - tags: ['opensource'] + tags: ['opensource'], }, { title: 'Kotest', @@ -725,7 +740,8 @@ const Users: User[] = [ }, { title: 'Meli', - description: 'Platform to deploy static sites, frontend applications and hosted forms', + description: + 'Platform to deploy static sites, frontend applications and hosted forms', preview: require('./showcase/meli.png'), website: 'https://docs.meli.sh/', source: 'https://github.com/getmeli/meli', @@ -741,7 +757,8 @@ const Users: User[] = [ }, { title: 'Mia-Platform', - description: 'Mia-Platform is the simplest way to develop and operate modern applications on Kubernetes. Don\'t waste time to set up your platform, just push the code!', + description: + "Mia-Platform is the simplest way to develop and operate modern applications on Kubernetes. Don't waste time to set up your platform, just push the code!", preview: require('./showcase/mia-platform.png'), website: 'https://docs.mia-platform.eu/', source: null, @@ -776,7 +793,8 @@ const Users: User[] = [ }, { title: 'nanos world documentation', - description: "nanos world is the next-generation multiplayer open world sandbox game.", + description: + 'nanos world is the next-generation multiplayer open world sandbox game.', preview: require('./showcase/nanos-world.png'), website: 'https://docs.nanos.world/', source: 'https://github.com/nanos-world/docs', @@ -792,7 +810,8 @@ const Users: User[] = [ }, { title: 'Netdata Learn', - description: 'An educational site for monitoring and troubleshooting systems', + description: + 'An educational site for monitoring and troubleshooting systems', preview: require('./showcase/netdata.png'), website: 'https://learn.netdata.cloud', source: 'https://github.com/netdata/netdata-learn-docusaurus', @@ -812,7 +831,7 @@ const Users: User[] = [ preview: require('./showcase/nextauthjs.png'), website: 'https://next-auth.js.org/', source: 'https://github.com/nextauthjs/next-auth', - tags: ['opensource','design'], + tags: ['opensource', 'design'], }, { title: 'Node SerialPort', @@ -820,7 +839,7 @@ const Users: User[] = [ preview: require('./showcase/node-serialport.png'), website: 'https://serialport.io', source: 'https://github.com/serialport/node-serialport', - tags: ['opensource','versioning'], + tags: ['opensource', 'versioning'], }, { title: 'Nodify', @@ -863,7 +882,7 @@ const Users: User[] = [ preview: require('./showcase/orbitjs.png'), website: 'https://orbitjs.com', source: 'https://github.com/orbitjs/orbit/tree/main/website', - tags: ['opensource','versioning'], + tags: ['opensource', 'versioning'], }, { title: 'Oxidizer', @@ -879,9 +898,9 @@ const Users: User[] = [ preview: require('./showcase/paubox.png'), website: 'https://docs.paubox.com/', source: null, - tags: ["product"], + tags: ['product'], }, - { + { title: 'Pipeline UI', description: 'Pipeline UI Documentation', preview: require('./showcase/pipeline-ui.png'), @@ -891,11 +910,12 @@ const Users: User[] = [ }, { title: 'Plausible Analytics Docs', - description: 'Plausible Analytics is a simple, open source, lightweight (< 1 KB) and privacy-friendly alternative to Google Analytics. ', + description: + 'Plausible Analytics is a simple, open source, lightweight (< 1 KB) and privacy-friendly alternative to Google Analytics. ', preview: require('./showcase/plausible.png'), website: 'https://plausible.io/docs', source: 'https://github.com/plausible/docs', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'pnpm', @@ -903,7 +923,7 @@ const Users: User[] = [ preview: require('./showcase/pnpm.png'), website: 'https://pnpm.js.org/', source: 'https://github.com/pnpm/pnpm.github.io/', - tags: ['opensource','i18n'], + tags: ['opensource', 'i18n'], }, { title: 'Postgres.ai – Database Lab', @@ -928,7 +948,7 @@ const Users: User[] = [ preview: require('./showcase/pptxgenjs.png'), website: 'https://gitbrent.github.io/PptxGenJS/', source: 'https://github.com/gitbrent/PptxGenJS', - tags: ['opensource','design'], + tags: ['opensource', 'design'], }, { title: 'Prismatic', @@ -970,7 +990,7 @@ const Users: User[] = [ preview: require('./showcase/quantcdn.png'), website: 'https://docs.quantcdn.io', source: 'https://github.com/quantcdn/docs', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'QuestDB', @@ -991,7 +1011,8 @@ const Users: User[] = [ }, { title: 'React Complex Tree', - description: 'Unopinionated Accessible React Tree Component with Multi-Select and Drag-And-Drop', + description: + 'Unopinionated Accessible React Tree Component with Multi-Select and Drag-And-Drop', preview: require('./showcase/react-complex-tree.png'), website: 'https://rct.lukasbach.com/', source: 'https://github.com/lukasbach/react-complex-tree', @@ -1056,18 +1077,21 @@ const Users: User[] = [ }, { title: 'React Native Reanimated', - description: 'React Native\'s Animated library reimplemented', + description: "React Native's Animated library reimplemented", preview: require('./showcase/react-native-reanimated.png'), website: 'https://docs.swmansion.com/react-native-reanimated/', - source: 'https://github.com/software-mansion/react-native-reanimated/tree/master/docs', - tags: ['opensource','design','versioning'], + source: + 'https://github.com/software-mansion/react-native-reanimated/tree/master/docs', + tags: ['opensource', 'design', 'versioning'], }, { - title: "React Native Render HTML", - description: "The hackable, full-featured Open Source HTML rendering solution for React Native.", + title: 'React Native Render HTML', + description: + 'The hackable, full-featured Open Source HTML rendering solution for React Native.', preview: require('./showcase/rnrh.png'), - website: "https://meliorence.github.io/react-native-render-html", - source: "https://github.com/meliorence/react-native-render-html/tree/master/apps/website", + website: 'https://meliorence.github.io/react-native-render-html', + source: + 'https://github.com/meliorence/react-native-render-html/tree/master/apps/website', tags: ['opensource', 'design'], }, { @@ -1084,7 +1108,7 @@ const Users: User[] = [ preview: require('./showcase/react-navigation.png'), website: 'https://reactnavigation.org/', source: 'https://github.com/react-navigation/react-navigation.github.io', - tags: ['opensource','design','versioning'], + tags: ['opensource', 'design', 'versioning'], }, { title: 'React Redux', @@ -1117,7 +1141,7 @@ const Users: User[] = [ preview: require('./showcase/redis-developer.png'), website: 'https://developer.redislabs.com', source: 'https://github.com/redis-developer/redis-developer.github.io', - tags: ['opensource','product','design','favorite'], + tags: ['opensource', 'product', 'design', 'favorite'], }, { title: 'Rematch', @@ -1134,7 +1158,7 @@ const Users: User[] = [ preview: require('./showcase/relay.png'), website: 'https://relay.dev/', source: 'https://github.com/facebook/relay/tree/main/website', - tags: ['opensource','favorite','design','versioning'], + tags: ['opensource', 'favorite', 'design', 'versioning'], }, { title: 'Remotion', @@ -1142,7 +1166,7 @@ const Users: User[] = [ preview: require('./showcase/remotion.png'), website: 'https://www.remotion.dev/', source: 'https://github.com/JonnyBurger/remotion/tree/main/packages/docs', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'Repeater.js', @@ -1177,7 +1201,7 @@ const Users: User[] = [ source: 'https://github.com/runletapp/website', tags: ['opensource'], }, - { + { title: 'Runiac', description: 'Run IaC Anywhere with Ease', preview: require('./showcase/runiac.png'), @@ -1215,7 +1239,7 @@ const Users: User[] = [ preview: require('./showcase/smashgg.png'), website: 'https://developer.smash.gg', source: 'https://github.com/smashgg/developer-portal', - tags: ['opensource','product'], + tags: ['opensource', 'product'], }, { title: 'Shabad OS Docs', @@ -1273,7 +1297,7 @@ const Users: User[] = [ preview: require('./showcase/supabase.png'), website: 'https://www.supabase.io/', source: 'https://github.com/supabase/monorepo', - tags: ['opensource', 'favorite', 'design', 'large','product'], + tags: ['opensource', 'favorite', 'design', 'large', 'product'], }, { title: 'T-Regx', @@ -1315,15 +1339,16 @@ const Users: User[] = [ preview: require('./showcase/the-diff.png'), website: 'https://thediffpodcast.com', source: null, - tags: [ 'facebook'], + tags: ['facebook'], }, { title: 'Tinaël Devresse', - description: 'Personal website of Tinaël Devresse, a blog about anything that crosses my mind which I think could interest y\'all.', + description: + "Personal website of Tinaël Devresse, a blog about anything that crosses my mind which I think could interest y'all.", preview: require('./showcase/tinaeldevresse.png'), website: 'https://tinaeldevresse.eu/', source: 'https://github.com/hunteroi/tinaeldevresse.eu', - tags: ['personal', 'opensource', 'i18n'] + tags: ['personal', 'opensource', 'i18n'], }, { title: 'TRPG Engine', @@ -1390,7 +1415,7 @@ const Users: User[] = [ preview: require('./showcase/webdriverio.png'), website: 'https://webdriver.io/', source: 'https://github.com/webdriverio/webdriverio', - tags: ['opensource', 'design', 'large','favorite'], + tags: ['opensource', 'design', 'large', 'favorite'], }, { title: 'Wisdom', @@ -1400,14 +1425,13 @@ const Users: User[] = [ source: 'https://github.com/Wisdom/dev-docs', tags: ['opensource', 'design', 'product'], }, -{ + { title: 'Whirl', - description: - 'Whirl\'s Personal Website and Blog', + description: "Whirl's Personal Website and Blog", preview: require('./showcase/whirlcodes.png'), website: 'https://whirl.codes', source: 'https://github.com/whirl21/website', - tags: ['opensource', 'personal'] + tags: ['opensource', 'personal'], }, { title: 'KubeVela', @@ -1432,31 +1456,34 @@ const Users: User[] = [ preview: require('./showcase/joelpo.png'), website: 'https://joelpo.github.io', source: 'https://github.com/Joelpo/joelpo.github.io', - tags: ['personal', 'opensource'] + tags: ['personal', 'opensource'], }, { title: 'LiveKit', - description: 'Open source, scalable, real-time audio and video rooms over WebRTC', + description: + 'Open source, scalable, real-time audio and video rooms over WebRTC', preview: require('./showcase/livekit.png'), website: 'https://docs.livekit.io', source: 'https://github.com/livekit/livekit-docs', - tags: ['opensource', 'product', 'design'] + tags: ['opensource', 'product', 'design'], }, { title: 'Zowe', - description: 'Open source framework for leveraging data and applications in z/OS', + description: + 'Open source framework for leveraging data and applications in z/OS', preview: require('./showcase/zowe.png'), website: 'https://docs.zowe.org', source: 'https://github.com/zowe/docs-site', - tags: ['opensource', 'product', 'large', 'design', 'versioning'] + tags: ['opensource', 'product', 'large', 'design', 'versioning'], }, { title: 'Quickwit', - description: 'The open source search engine on object storage with subsecond latency', + description: + 'The open source search engine on object storage with subsecond latency', preview: require('./showcase/quickwit.png'), website: 'https://quickwit.io', source: 'https://github.com/quickwit-inc/quickwit', - tags: ['favorite', 'opensource', 'design'] + tags: ['favorite', 'opensource', 'design'], }, { title: 'Verdaccio', @@ -1464,23 +1491,25 @@ const Users: User[] = [ preview: require('./showcase/verdaccio.png'), website: 'https://verdaccio.org', source: 'https://github.com/verdaccio/verdaccio', - tags: ['favorite', 'opensource', 'large', 'i18n', 'design' ] + tags: ['favorite', 'opensource', 'large', 'i18n', 'design'], }, { title: 'Unmand', - description: 'A business automation platform that liberates users from repetitive tasks.', + description: + 'A business automation platform that liberates users from repetitive tasks.', preview: require('./showcase/unmand.png'), website: 'https://unmand.com', source: null, - tags: ['product', 'design'] + tags: ['product', 'design'], }, - { + { title: 'Haochen', - description: 'My personal website with a blog section to record all tech-related issues I encountered.', + description: + 'My personal website with a blog section to record all tech-related issues I encountered.', preview: require('./showcase/haochen.png'), website: 'https://haochenqi.com/', source: 'https://github.com/HaochenQ/Haochen-Blog', - tags: ['personal', 'opensource'] + tags: ['personal', 'opensource'], }, { title: 'Drayman', @@ -1488,15 +1517,16 @@ const Users: User[] = [ preview: require('./showcase/drayman.png'), website: 'https://drayman.io/', source: 'https://github.com/Claviz/drayman', - tags: ['opensource'] + tags: ['opensource'], }, { title: 'Nocalhost', - description: 'An open-source toolsets help to build cloud-native applications easier and faster.', + description: + 'An open-source toolsets help to build cloud-native applications easier and faster.', preview: require('./showcase/nocalhost.png'), website: 'https://nocalhost.dev/', source: 'https://github.com/nocalhost/nocalhost', - tags: ['opensource', 'i18n'] + tags: ['opensource', 'i18n'], }, { title: 'Patrik Mäsiar', @@ -1507,7 +1537,6 @@ const Users: User[] = [ tags: ['personal', 'opensource'], }, - /* Pro Tip: add your site in alphabetical order. Appending your site here (at the end) is more likely to produce Git conflicts. diff --git a/website/src/featureRequests/FeatureRequestsPage.tsx b/website/src/featureRequests/FeatureRequestsPage.tsx index 7e07b01c03e2..66ccd79d60b6 100644 --- a/website/src/featureRequests/FeatureRequestsPage.tsx +++ b/website/src/featureRequests/FeatureRequestsPage.tsx @@ -14,10 +14,11 @@ import styles from './styles.module.css'; const BOARD_TOKEN = '054e0e53-d951-b14c-7e74-9eb8f9ed2f91'; -function FeatureRequests() { +function FeatureRequests(): JSX.Element { useEffect(() => { cannyScript(); - const Canny = (window as any).Canny; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const {Canny} = window as any; Canny('render', { boardToken: BOARD_TOKEN, basePath: '/feature-requests', diff --git a/website/src/featureRequests/cannyScript.js b/website/src/featureRequests/cannyScript.js index 85f9854cc314..a97536feec73 100644 --- a/website/src/featureRequests/cannyScript.js +++ b/website/src/featureRequests/cannyScript.js @@ -1,11 +1,5 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - // Provided by Canny. +/* eslint-disable */ function cannyScript() { !(function (w, d, i, s) { diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index b0f84a1677ae..db0f07f427ab 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +/* eslint-disable global-require */ + import React from 'react'; import Link from '@docusaurus/Link'; import Translate, {translate} from '@docusaurus/Translate'; @@ -78,7 +80,7 @@ const QUOTES = [ }, ]; -function Home() { +function Home(): JSX.Element { const { siteConfig: { customFields: {description}, @@ -98,6 +100,7 @@ function Home() { />

- Save time and focus on your project's documentation. Simply - write docs and blog posts with Markdown/MDX and Docusaurus - will publish a set of static HTML files ready to serve. You - can even embed JSX components into your Markdown thanks to - MDX. + Save time and focus on your project's documentation. + Simply write docs and blog posts with Markdown/MDX and + Docusaurus will publish a set of static HTML files ready to + serve. You can even embed JSX components into your Markdown + thanks to MDX.

@@ -181,9 +184,9 @@ function Home() {

- Extend or customize your project's layout by reusing React. - Docusaurus can be extended while reusing the same header and - footer. + Extend or customize your project's layout by reusing + React. Docusaurus can be extended while reusing the same + header and footer.

diff --git a/website/src/pages/showcase/index.tsx b/website/src/pages/showcase/index.tsx index f3b7c4bf38b6..c0297ff1b119 100644 --- a/website/src/pages/showcase/index.tsx +++ b/website/src/pages/showcase/index.tsx @@ -105,9 +105,10 @@ function ShowcaseHeader() {

{DESCRIPTION}

+ target="_blank" + rel="noreferrer"> 🙏 Add your site now!

@@ -195,7 +196,7 @@ function ShowcaseCards({filteredUsers}: {filteredUsers: User[]}) { ); } -function Showcase() { +function Showcase(): JSX.Element { const {selectedTags, toggleTag} = useSelectedTags(); const [operator, setOperator] = useState('OR'); const filteredUsers = useFilteredUsers(SortedUsers, selectedTags, operator); diff --git a/website/src/pages/versions.tsx b/website/src/pages/versions.tsx index 44623e2379f0..f6e55c9a94f7 100644 --- a/website/src/pages/versions.tsx +++ b/website/src/pages/versions.tsx @@ -16,7 +16,7 @@ import VersionsArchived from '@site/versionsArchived.json'; const VersionsArchivedList = Object.entries(VersionsArchived); -function Version() { +function Version(): JSX.Element { const { siteConfig: {organizationName, projectName}, } = useDocusaurusContext(); @@ -128,7 +128,9 @@ function Version() { 1.x - + Documentation diff --git a/website/src/theme/ReactLiveScope/components.tsx b/website/src/theme/ReactLiveScope/components.tsx index b094dc285dac..786924502c9d 100644 --- a/website/src/theme/ReactLiveScope/components.tsx +++ b/website/src/theme/ReactLiveScope/components.tsx @@ -1,7 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + import React, {ComponentProps} from 'react'; -export const ButtonExample = (props: ComponentProps<'button'>) => ( +export const ButtonExample = (props: ComponentProps<'button'>): JSX.Element => (