diff --git a/docs/contributing/local-development/Local_Linking.mdx b/docs/contributing/local-development/Local_Linking.mdx index 7c7b6cdaf086..8f313fffd21f 100644 --- a/docs/contributing/local-development/Local_Linking.mdx +++ b/docs/contributing/local-development/Local_Linking.mdx @@ -10,6 +10,10 @@ The general strategy to do so is: 2. [Repository linking](#repository-linking): Use your package manager's link command to reference those global symlinks in the local downstream repository. 3. [Trying rules](#trying-rules): Test your local rules and plugins by enabling them in the local downstream repository. +:::tip +Before linking a repository, make sure it's gone through the steps in [Getting Started](../../getting-started/Quickstart.mdx) to be able to use typescript-eslint rules. +::: + ## Global Linking To make all `@typescript-eslint/*` packages available globally, run this command from your `typescript-eslint` repository root: @@ -29,9 +33,15 @@ The command to put instead of that `#` comment, depends on the local downstream - [Yarn v1 / classic](https://classic.yarnpkg.com/lang/en/docs/cli/link/ 'Yarn v1 / classic docs'): `yarn link` - [Yarn v2 / v3 / berry](https://yarnpkg.com/cli/link 'Yarn v2 / v3 / berry docs'): _skip this step altogether_ +Additionally, if you haven't yet built the typescript-eslint repository, do so now: + +```shell +yarn build +``` + ## Repository Linking -Now that the `@typescript-eslint/*` packages are available locally, you can link to them in the local downstream repository. +Now that the `@typescript-eslint/*` packages are built and available locally, you can link to them in the local downstream repository. Run that repository's package manager's link command for any `@typescript-eslint/*` packages that repository depends on: - npm: `npm link @typescript-eslint/eslint-plugin @typescript-eslint/parser` @@ -85,6 +95,15 @@ In this case, you can manually install any missing packages in the local downstr yarn add ts-api-utils -D ``` +### Rules Not Found (`Definition for rule ... was not found`) + +Packages need to be built. +First try re-running `yarn build` from the typescript-eslint repository root. + +If you're adding new rules, you'll need to also modify [`packages/eslint-plugin/src/rules/index.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/rules/index.ts) to export the rule object, then re-build. + +If you're modifying preset configurations, you'll also need to run `yarn generate-configs`, then re-build. + ### Yarn Link Failures (`Cannot link ... conflicts with parent dependency`) Yarn v2 / v3 / berry can be strict about conflicting dependencies.