From 2c61bdbe1ea4c755f8e4fe7e5d2d209f59c80c6f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 31 Jan 2023 09:40:45 -0500 Subject: [PATCH] chore(website): consistent .mdx file naming (#6325) * chore(website): consistent .mdx file naming * Ran Prettier * .md/s/x * Post merge fixups * Ignore warnonunsupportedtypescriptversion * Fix Versioning merge conflicts --- .cspell.json | 1 + .github/pull_request_template.md | 2 +- docs/{Architecture.md => Architecture.mdx} | 0 docs/{Custom_Rules.md => Custom_Rules.mdx} | 0 docs/{Getting_Started.md => Getting_Started.mdx} | 4 ++-- docs/{MAINTENANCE.md => Maintenance.mdx} | 0 docs/architecture/ESLint_Plugin.mdx | 2 +- docs/architecture/ESLint_Plugin_TSLint.mdx | 4 ++-- docs/linting/CONFIGURATIONS.mdx | 2 +- .../{Troubleshooting.md => Troubleshooting.mdx} | 6 +++--- .../{Typed_Linting.md => Typed_Linting.mdx} | 6 +++--- .../{Formatting.md => Formatting.mdx} | 0 docs/linting/troubleshooting/Performance.md | 4 ++-- .../troubleshooting/{TSLint.md => TSLint.mdx} | 0 .../typed-linting/{Monorepos.md => Monorepos.mdx} | 4 ++-- docs/maintenance/{BRANDING.md => Branding.mdx} | 7 ++++++- docs/maintenance/{ISSUES.md => Issues.mdx} | 2 +- .../{PULL_REQUESTS.md => Pull_Requests.mdx} | 0 docs/maintenance/{RELEASES.md => Releases.mdx} | 0 docs/maintenance/{Versioning.md => Versioning.mdx} | 14 ++++++++++++-- ...{Rule_Deprecations.md => Rule_Deprecations.mdx} | 0 .../versioning/dependant-version-upgrades.mdx | 10 +++++----- packages/experimental-utils/README.md | 2 +- 23 files changed, 43 insertions(+), 27 deletions(-) rename docs/{Architecture.md => Architecture.mdx} (100%) rename docs/{Custom_Rules.md => Custom_Rules.mdx} (100%) rename docs/{Getting_Started.md => Getting_Started.mdx} (94%) rename docs/{MAINTENANCE.md => Maintenance.mdx} (100%) rename docs/linting/{Troubleshooting.md => Troubleshooting.mdx} (99%) rename docs/linting/{Typed_Linting.md => Typed_Linting.mdx} (90%) rename docs/linting/troubleshooting/{Formatting.md => Formatting.mdx} (100%) rename docs/linting/troubleshooting/{TSLint.md => TSLint.mdx} (100%) rename docs/linting/typed-linting/{Monorepos.md => Monorepos.mdx} (96%) rename docs/maintenance/{BRANDING.md => Branding.mdx} (92%) rename docs/maintenance/{ISSUES.md => Issues.mdx} (99%) rename docs/maintenance/{PULL_REQUESTS.md => Pull_Requests.mdx} (100%) rename docs/maintenance/{RELEASES.md => Releases.mdx} (100%) rename docs/maintenance/{Versioning.md => Versioning.mdx} (95%) rename docs/maintenance/issues/{Rule_Deprecations.md => Rule_Deprecations.mdx} (100%) diff --git a/.cspell.json b/.cspell.json index edd2532abf9..415d46de1cf 100644 --- a/.cspell.json +++ b/.cspell.json @@ -121,6 +121,7 @@ "unoptimized", "unprefixed", "upsert", + "warnonunsupportedtypescriptversion", "Zacher" ], "overrides": [ diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3e72e13f7a9..b5037407620 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,7 +8,7 @@ Otherwise we may not be able to review your PR. - [ ] Addresses an existing open issue: fixes #000 - [ ] That issue was marked as [accepting prs](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22) -- [ ] Steps in [CONTRIBUTING.md](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md) were taken +- [ ] Steps in [Contributing](https://typescript-eslint.io/contributing) were taken ## Overview diff --git a/docs/Architecture.md b/docs/Architecture.mdx similarity index 100% rename from docs/Architecture.md rename to docs/Architecture.mdx diff --git a/docs/Custom_Rules.md b/docs/Custom_Rules.mdx similarity index 100% rename from docs/Custom_Rules.md rename to docs/Custom_Rules.mdx diff --git a/docs/Getting_Started.md b/docs/Getting_Started.mdx similarity index 94% rename from docs/Getting_Started.md rename to docs/Getting_Started.mdx index 91c978322f4..cdaf39899a9 100644 --- a/docs/Getting_Started.md +++ b/docs/Getting_Started.mdx @@ -73,6 +73,6 @@ ESLint will lint all TypeScript compatible files within the current folder, and ## Next Steps -We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/Typed_Linting.md 'Visit the next page for a typed rules setup guide'). +We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/Typed_Linting.mdx 'Visit the next page for a typed rules setup guide'). -If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/Troubleshooting.md). +If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/Troubleshooting.mdx). diff --git a/docs/MAINTENANCE.md b/docs/Maintenance.mdx similarity index 100% rename from docs/MAINTENANCE.md rename to docs/Maintenance.mdx diff --git a/docs/architecture/ESLint_Plugin.mdx b/docs/architecture/ESLint_Plugin.mdx index eca60141555..6db78ddfceb 100644 --- a/docs/architecture/ESLint_Plugin.mdx +++ b/docs/architecture/ESLint_Plugin.mdx @@ -8,7 +8,7 @@ sidebar_label: eslint-plugin > The TypeScript plugin for ESLint. ✨ :::info -See [Getting Started](../Getting_Started.md) for documentation on how to lint your TypeScript code with ESLint. +See [Getting Started](../Getting_Started.mdx) for documentation on how to lint your TypeScript code with ESLint. ::: `@typescript-eslint/eslint-plugin` is an ESLint plugin used to load in custom rules and rule configurations lists from typescript-eslint. diff --git a/docs/architecture/ESLint_Plugin_TSLint.mdx b/docs/architecture/ESLint_Plugin_TSLint.mdx index 582d93aab8e..525b1c07247 100644 --- a/docs/architecture/ESLint_Plugin_TSLint.mdx +++ b/docs/architecture/ESLint_Plugin_TSLint.mdx @@ -8,8 +8,8 @@ sidebar_label: eslint-plugin-tslint > ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. ✨ :::caution -Per [What About TSLint?](../linting/troubleshooting/TSLint.md), we highly recommend migrating off TSLint. -See [Getting Started](../Getting_Started.md) for documentation on how to lint your TypeScript code with ESLint. +Per [What About TSLint?](../linting/troubleshooting/TSLint.mdx), we highly recommend migrating off TSLint. +See [Getting Started](../Getting_Started.mdx) for documentation on how to lint your TypeScript code with ESLint. ::: ## Installation diff --git a/docs/linting/CONFIGURATIONS.mdx b/docs/linting/CONFIGURATIONS.mdx index aec668a16dd..10d3f6293d5 100644 --- a/docs/linting/CONFIGURATIONS.mdx +++ b/docs/linting/CONFIGURATIONS.mdx @@ -18,7 +18,7 @@ Most projects should extend from at least one of: - [`strict`](#strict): Additional strict rules that can also catch bugs but are more opinionated than recommended rules. :::tip -We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./Typed_Linting.md)). +We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./Typed_Linting.mdx)). ::: :::note diff --git a/docs/linting/Troubleshooting.md b/docs/linting/Troubleshooting.mdx similarity index 99% rename from docs/linting/Troubleshooting.md rename to docs/linting/Troubleshooting.mdx index 67e4316608f..cb59af28447 100644 --- a/docs/linting/Troubleshooting.md +++ b/docs/linting/Troubleshooting.mdx @@ -35,11 +35,11 @@ If you don't find an existing extension rule, or the extension rule doesn't work - If you **do not** want to lint the file: - Use [one of the options ESLint offers](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code) to ignore files, namely a `.eslintignore` file, or `ignorePatterns` config. - If you **do** want to lint the file: - - If you **do not** want to lint the file with [type-aware linting](./Typed_Linting.md): + - If you **do not** want to lint the file with [type-aware linting](./Typed_Linting.mdx): - Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information. - A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override. - Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work. - - If you **do** want to lint the file with [type-aware linting](./Typed_Linting.md): + - If you **do** want to lint the file with [type-aware linting](./Typed_Linting.mdx): - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it. - If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo: - [`tsconfig.eslint.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/tsconfig.eslint.json) @@ -64,7 +64,7 @@ For example, many projects have files like: In that case, viewing the `.eslintrc.cjs` in an IDE with the ESLint extension will show the error notice that the file couldn't be linted because it isn't included in `tsconfig.json`. -See our docs on [type aware linting](./Typed_Linting.md) for more information. +See our docs on [type aware linting](./Typed_Linting.mdx) for more information. ## I get errors telling me "The file must be included in at least one of the projects provided" diff --git a/docs/linting/Typed_Linting.md b/docs/linting/Typed_Linting.mdx similarity index 90% rename from docs/linting/Typed_Linting.md rename to docs/linting/Typed_Linting.mdx index 65e2c875fff..7d9de2f25bb 100644 --- a/docs/linting/Typed_Linting.md +++ b/docs/linting/Typed_Linting.mdx @@ -30,7 +30,7 @@ In more detail: - `plugin:@typescript-eslint/recommended-requiring-type-checking` is another [recommended configuration](./CONFIGURATIONS.mdx) we provide. This one contains recommended rules that additionally require type information. - `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is. - - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.md). + - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx). - `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../architecture/Parser.mdx#tsconfigRootDir)). With that done, run the same lint command you ran before. @@ -53,8 +53,8 @@ This means that generally they usually only run a complete lint before a push, o ### I get errors telling me "The file must be included in at least one of the projects provided" You're using an outdated version of `@typescript-eslint/parser`. -Update to the latest version to see a more informative version of this error message, explained in our [Troubleshooting and FAQs page](./Troubleshooting.md#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file). +Update to the latest version to see a more informative version of this error message, explained in our [Troubleshooting and FAQs page](./Troubleshooting.mdx#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file). ## Troubleshooting -If you're having problems getting this working, please have a look at our [Troubleshooting and FAQs page](./Troubleshooting.md). +If you're having problems getting this working, please have a look at our [Troubleshooting and FAQs page](./Troubleshooting.mdx). diff --git a/docs/linting/troubleshooting/Formatting.md b/docs/linting/troubleshooting/Formatting.mdx similarity index 100% rename from docs/linting/troubleshooting/Formatting.md rename to docs/linting/troubleshooting/Formatting.mdx diff --git a/docs/linting/troubleshooting/Performance.md b/docs/linting/troubleshooting/Performance.md index 6f696a7a05f..f4d0f9e3d53 100644 --- a/docs/linting/troubleshooting/Performance.md +++ b/docs/linting/troubleshooting/Performance.md @@ -3,7 +3,7 @@ id: performance-troubleshooting title: Performance Troubleshooting --- -As mentioned in the [type-aware linting doc](../Typed_Linting.md), if you're using type-aware linting, your lint times should be roughly the same as your build times. +As mentioned in the [type-aware linting doc](../Typed_Linting.mdx), if you're using type-aware linting, your lint times should be roughly the same as your build times. If you're experiencing times much slower than that, then there are a few common culprits. @@ -53,7 +53,7 @@ Across a large codebase, these can add up, and severely impact performance. We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/prettier) to enforce a standardized formatting. -See our [documentation on formatting](./Formatting.md) for more information. +See our [documentation on formatting](./Formatting.mdx) for more information. ## `eslint-plugin-prettier` diff --git a/docs/linting/troubleshooting/TSLint.md b/docs/linting/troubleshooting/TSLint.mdx similarity index 100% rename from docs/linting/troubleshooting/TSLint.md rename to docs/linting/troubleshooting/TSLint.mdx diff --git a/docs/linting/typed-linting/Monorepos.md b/docs/linting/typed-linting/Monorepos.mdx similarity index 96% rename from docs/linting/typed-linting/Monorepos.md rename to docs/linting/typed-linting/Monorepos.mdx index e55d2064779..7b01b81d662 100644 --- a/docs/linting/typed-linting/Monorepos.md +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -38,7 +38,7 @@ Be sure to update your `.eslintrc.js` to point at this new config file. ## One `tsconfig.json` per package (and an optional one in the root) -The `parserOptions.project` option introduced in [Linting with Type Information](../Typed_Linting.md) accepts an array of relative paths. +The `parserOptions.project` option introduced in [Linting with Type Information](../Typed_Linting.mdx) accepts an array of relative paths. Paths may be provided as [Node globs](https://github.com/isaacs/node-glob/blob/f5a57d3d6e19b324522a3fa5bdd5075fd1aa79d1/README.md#glob-primer). For each file being linted, the first matching project path will be used as its backing TSConfig. @@ -104,4 +104,4 @@ As an interim workaround, consider one of the following: ## Troubleshooting -If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](../Troubleshooting.md). +If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](../Troubleshooting.mdx). diff --git a/docs/maintenance/BRANDING.md b/docs/maintenance/Branding.mdx similarity index 92% rename from docs/maintenance/BRANDING.md rename to docs/maintenance/Branding.mdx index 25c08b216e6..d4e84d90dea 100644 --- a/docs/maintenance/BRANDING.md +++ b/docs/maintenance/Branding.mdx @@ -31,7 +31,12 @@ You can call it _blurple_ if you want. Our logo is also a halfway between [ESLint's logo](https://en.wikipedia.org/wiki/ESLint#/media/File:ESLint_logo.svg) and [TypeScript's logo](https://en.wikipedia.org/wiki/TypeScript#/media/File:Typescript.svg): -typescript-eslint logo +typescript-eslint logo - [Logo PNG download](/img/logo.png) - [Logo SVG download](/img/logo.svg) diff --git a/docs/maintenance/ISSUES.md b/docs/maintenance/Issues.mdx similarity index 99% rename from docs/maintenance/ISSUES.md rename to docs/maintenance/Issues.mdx index fb5eb655dd6..fc8a89711de 100644 --- a/docs/maintenance/ISSUES.md +++ b/docs/maintenance/Issues.mdx @@ -105,7 +105,7 @@ We avoid features that: - Are only relevant for a minority of users, as they aren't likely worth the maintenance burden - Aren't TypeScript-specific (e.g. should be in ESLint core instead) - Are only relevant with specific userland frameworks or libraries, such as Jest or React -- Are for "formatting" functionality (we [strongly recommend users use a separate dedicated formatter](../linting/troubleshooting/Formatting.md)) +- Are for "formatting" functionality (we [strongly recommend users use a separate dedicated formatter](../linting/troubleshooting/Formatting.mdx)) #### ✨ Rule Enhancements diff --git a/docs/maintenance/PULL_REQUESTS.md b/docs/maintenance/Pull_Requests.mdx similarity index 100% rename from docs/maintenance/PULL_REQUESTS.md rename to docs/maintenance/Pull_Requests.mdx diff --git a/docs/maintenance/RELEASES.md b/docs/maintenance/Releases.mdx similarity index 100% rename from docs/maintenance/RELEASES.md rename to docs/maintenance/Releases.mdx diff --git a/docs/maintenance/Versioning.md b/docs/maintenance/Versioning.mdx similarity index 95% rename from docs/maintenance/Versioning.md rename to docs/maintenance/Versioning.mdx index d9a4224dbf8..68a007c89c1 100644 --- a/docs/maintenance/Versioning.md +++ b/docs/maintenance/Versioning.mdx @@ -14,11 +14,21 @@ Additionally, we promote to the `latest` tag on NPM once per week, **on Mondays The latest version under the `latest` tag is: -NPM Version + + NPM Version + The latest version under the `canary` tag **(latest commit to `main`)** is: -NPM Version + + NPM Version + :::note The only exception to the automated publishes described above is when we are in the final phases of creating the next major version of the libraries - e.g. going from `1.x.x` to `2.x.x`. diff --git a/docs/maintenance/issues/Rule_Deprecations.md b/docs/maintenance/issues/Rule_Deprecations.mdx similarity index 100% rename from docs/maintenance/issues/Rule_Deprecations.md rename to docs/maintenance/issues/Rule_Deprecations.mdx diff --git a/docs/maintenance/versioning/dependant-version-upgrades.mdx b/docs/maintenance/versioning/dependant-version-upgrades.mdx index 49ba51ce1e4..bf1a17f2829 100644 --- a/docs/maintenance/versioning/dependant-version-upgrades.mdx +++ b/docs/maintenance/versioning/dependant-version-upgrades.mdx @@ -21,7 +21,7 @@ Whenever you discover any new areas of work that are blocked by dropping an old 1. Upgrade the root `package.json` `devDependency` to the latest ESLint 1. Add the new major version to the explicit `peerDependency` versions 1. Check [`eslint-visitor-keys`](https://www.npmjs.com/package/eslint-visitor-keys) for a new version to be upgraded to as well. -1. Update [Versioning > ESLint](../Versioning.md#eslint) +1. Update [Versioning > ESLint](../Versioning.mdx#eslint) ### Removing Support for an Old ESLint Version @@ -32,7 +32,7 @@ Whenever you discover any new areas of work that are blocked by dropping an old - `/eslint.*5/i` - `/todo.*eslint.*5/i` - `/todo.*eslint/i` -1. Update [Versioning > ESLint](../Versioning.md#eslint) +1. Update [Versioning > ESLint](../Versioning.mdx#eslint) See [chore: drop support for ESLint v6](https://github.com/typescript-eslint/typescript-eslint/pull/5972) for reference. @@ -88,8 +88,8 @@ We generally start the process of supporting a new TypeScript version just after - In the root `package.json`, change the `devDependency` on `typescript` to `~X.Y.3` - Rename and update `patches/typescript*` to the new TypeScript version - Any other changes made necessary due to changes in TypeScript between the RC version and stable version - - Update the supported version range in [Versioning](../Versioning.md) -1. Update [Versioning > TypeScript](../Versioning.md#typescript) + - Update the supported version range in [Versioning](../Versioning.mdx) +1. Update [Versioning > TypeScript](../Versioning.mdx#typescript) 1. Send a PR that updates this documentation page to point to your newer issues and PRs - Also update any of these steps if you go with a different process @@ -108,7 +108,7 @@ A single PR can remove support for old TypeScript versions as a breaking change: 1. Update the root `package.json` `devDependency` 1. Update the `SUPPORTED_TYPESCRIPT_VERSIONS` constant in `warnAboutTSVersion.ts` 1. Update the `versions` constant in `version-check.ts` -1. Update [Versioning > TypeScript](../Versioning.md#typescript) +1. Update [Versioning > TypeScript](../Versioning.mdx#typescript) 1. Search for source code comments (excluding `CHANGELOG.md` files) that mention a now-unsupported version of TypeScript. - For example, to remove support for v4.3, searches might include: - `4.3` diff --git a/packages/experimental-utils/README.md b/packages/experimental-utils/README.md index d1468f928b1..a285229f638 100644 --- a/packages/experimental-utils/README.md +++ b/packages/experimental-utils/README.md @@ -19,4 +19,4 @@ You should switch to importing from that non-experimental package instead. ## Contributing -[See the contributing guide here](../../CONTRIBUTING.md) +[See the contributing guide here](https://typescript-eslint.io).