From 90920aa4edfb2a0a951affbe68c6fc3022911b0d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 23 Aug 2024 03:03:57 -0400 Subject: [PATCH 1/4] docs(website-eslint): add README.md --- packages/website-eslint/README.md | 18 ++++++++++++++++++ packages/website/README.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/website-eslint/README.md diff --git a/packages/website-eslint/README.md b/packages/website-eslint/README.md new file mode 100644 index 000000000000..76f38886b9e5 --- /dev/null +++ b/packages/website-eslint/README.md @@ -0,0 +1,18 @@ +# `website-eslint` + +A bundled version of ESLint plus `typescript-eslint`, made to work in a browser. +This is exclusively used for the playground in the [`website` package](../website/README.md). + +## Building + +`yarn build` runs `build.ts`, which uses ESBuild to create a CommonJS bundle including: + +- ESLint's [`Linter` class](https://eslint.org/docs/latest/integrate/nodejs-api#linter) and built-in rules +- TypeScript's `typescript` and `typescript/lib/tsserverlibrary` module entry points +- typescript-eslint packages, including: + - `@typescript-eslint/eslint-plugin` and all its configs and rules + - `@typescript-eslint/parser` and `@typescript-eslint/typescript-estree` + +The build files intentionally use deep `/use-at-your-own-risk` imports into our packages. +This is so that esbuild can properly tree-shake and only include the necessary code. +This saves us having to mock unnecessary things and reduces our website bundle size. diff --git a/packages/website/README.md b/packages/website/README.md index 7f4c12e23722..435a13f12272 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -2,7 +2,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/128d21c7-b2fe-45ad-b141-9878fcf5de3a/deploy-status)](https://app.netlify.com/sites/typescript-eslint/deploys) -This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. +This website is built using [Docusaurus 3](https://docusaurus.io), a modern static website generator. ## Installation From 8a3ec8bcbf72b75134ef6e4d3098f9200bf1ee6e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 23 Aug 2024 11:44:10 -0400 Subject: [PATCH 2/4] On-the-fly typescript --- packages/website-eslint/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/website-eslint/README.md b/packages/website-eslint/README.md index 76f38886b9e5..8c0fc0b993ee 100644 --- a/packages/website-eslint/README.md +++ b/packages/website-eslint/README.md @@ -8,7 +8,8 @@ This is exclusively used for the playground in the [`website` package](../websit `yarn build` runs `build.ts`, which uses ESBuild to create a CommonJS bundle including: - ESLint's [`Linter` class](https://eslint.org/docs/latest/integrate/nodejs-api#linter) and built-in rules -- TypeScript's `typescript` and `typescript/lib/tsserverlibrary` module entry points +- A wrapper that causes TypeScript's `typescript` and `typescript/lib/tsserverlibrary` module entry points to be downloaded on the fly + - This uses the same source as the [TypeScript playground](https://typescript-eslint.io), giving us a "Monaco web" compatible bundle - typescript-eslint packages, including: - `@typescript-eslint/eslint-plugin` and all its configs and rules - `@typescript-eslint/parser` and `@typescript-eslint/typescript-estree` From 9a1c49f2f751e3df8d9a66ac2f25ac986c4b9939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 24 Aug 2024 18:19:37 -0400 Subject: [PATCH 3/4] Update packages/website/README.md Co-authored-by: Joshua Chen --- packages/website/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/README.md b/packages/website/README.md index 435a13f12272..6af12c5c79ce 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -2,7 +2,7 @@ [![Netlify Status](https://api.netlify.com/api/v1/badges/128d21c7-b2fe-45ad-b141-9878fcf5de3a/deploy-status)](https://app.netlify.com/sites/typescript-eslint/deploys) -This website is built using [Docusaurus 3](https://docusaurus.io), a modern static website generator. +This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. ## Installation From 8aa633986dbf6a9df97920735506c097bd420fe6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 25 Aug 2024 11:51:17 -0400 Subject: [PATCH 4/4] wrong url --- packages/website-eslint/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website-eslint/README.md b/packages/website-eslint/README.md index 8c0fc0b993ee..06e1fb2226bd 100644 --- a/packages/website-eslint/README.md +++ b/packages/website-eslint/README.md @@ -9,7 +9,7 @@ This is exclusively used for the playground in the [`website` package](../websit - ESLint's [`Linter` class](https://eslint.org/docs/latest/integrate/nodejs-api#linter) and built-in rules - A wrapper that causes TypeScript's `typescript` and `typescript/lib/tsserverlibrary` module entry points to be downloaded on the fly - - This uses the same source as the [TypeScript playground](https://typescript-eslint.io), giving us a "Monaco web" compatible bundle + - This uses the same source as the [TypeScript playground](https://typescriptlang.org/play), giving us a "Monaco web" compatible bundle - typescript-eslint packages, including: - `@typescript-eslint/eslint-plugin` and all its configs and rules - `@typescript-eslint/parser` and `@typescript-eslint/typescript-estree`