[go: nahoru, domu]

Skip to content

Commit

Permalink
docs: base Testing Rules documentation (#8033)
Browse files Browse the repository at this point in the history
* docs: base Testing Rules documentation

* fix(eslint-plugin): add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked (#8038)

fix: add no-unsafe-unary-minus, prefer-destructuring to disable-type-checked

* docs: testing rules review changes + build callout

* docs(eslint-plugin): [require-array-sort-compare] sync rule description (#8061)

* chore: resolve internal lint issues with new no-useless-template-literals rule (#8060)

* docs(eslint-plugin): [require-array-sort-compare] generalize sort method names (#8062)

docs: streamline

* chore: update sponsors (#8069)

Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>

* Update docs/contributing/local-development/Local_Linking.mdx

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>

* docs: changed section name + callout type from caution to note

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
Co-authored-by: auvred <61150013+auvred@users.noreply.github.com>
Co-authored-by: James <5511220+Zamiell@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <53356952+typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Costa Moura <drt69727@MAC452093-M.local>
  • Loading branch information
7 people committed Jan 9, 2024
1 parent 1aa8664 commit 9399029
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/contributing/local-development/Local_Linking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The general strategy to do so is:

1. [Global linking](#global-linking): Use your package manager's global link command to make `@typescript-eslint/*` packages available as global symlinks.
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.

## Global Linking

Expand Down Expand Up @@ -45,6 +46,27 @@ Now, you should be able to run ESLint in the local downstream repository as you
To check that the local package is being used, consider adding a `console.log("Hello, world!");` to a file such as `./packages/eslint-plugin/dist/index.js` and making sure that log appears when linting the local downstream repository.
:::

## Trying Rules

Now that you've linked the `@typescript-eslint/*` packages with your local downstream repository, the next step would be to include the rule on the local repository ESLint configuration file, e.g:

```json title=".eslintrc.json"
{
"rules": {
"@typescript-eslint/your-awesome-rule": "error"
}
// ...
}
```

After that, you need to run your repository's `lint` script and your changes should be reflected on the project.

:::note
Changes to `@typescript-eslint/` packages will not be reflected inside your linked repository until they're built locally.
To re-build all packages, run `yarn build` from the root.
To start a watch mode builder on just the ESLint plugin, run `yarn build --watch` from `./packages/eslint-plugin`.
:::

## Troubleshooting

### Packages Not Found (`Cannot find module`)
Expand Down

0 comments on commit 9399029

Please sign in to comment.