Skip to content

docs: base Testing Rules documentation #8033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cdb42d9
docs: base Testing Rules documentation
c0sta Dec 7, 2023
d24fb94
fix(eslint-plugin): add no-unsafe-unary-minus, prefer-destructuring t…
JoshuaKGoldberg Dec 7, 2023
1b0875b
docs: testing rules review changes + build callout
c0sta Dec 7, 2023
d4abbb4
Merge branch 'main' into docs/how-to-test-changes
c0sta Dec 7, 2023
139195e
Merge branch 'main' into docs/how-to-test-changes
c0sta Dec 13, 2023
0fdf55a
docs(eslint-plugin): [require-array-sort-compare] sync rule descripti…
auvred Dec 13, 2023
763e6bc
chore: resolve internal lint issues with new no-useless-template-lite…
auvred Dec 13, 2023
47390bb
docs(eslint-plugin): [require-array-sort-compare] generalize sort met…
Zamiell Dec 13, 2023
3158881
chore: update sponsors (#8069)
typescript-eslint[bot] Dec 15, 2023
04528e8
Merge branch 'main' into docs/how-to-test-changes
c0sta Dec 18, 2023
c714ea3
Merge branch 'main' of github.com:c0sta/typescript-eslint into docs/h…
Dec 27, 2023
b9d08d5
Update docs/contributing/local-development/Local_Linking.mdx
c0sta Dec 28, 2023
a60fb3a
Merge branch 'docs/how-to-test-changes' of github.com:c0sta/typescrip…
Jan 3, 2024
23785a1
Merge branch 'main' of github.com:c0sta/typescript-eslint into docs/h…
Jan 3, 2024
62fc387
docs: changed section name + callout type from caution to note
Jan 3, 2024
c9660c0
Merge branch 'main' into docs/how-to-test-changes
c0sta Jan 5, 2024
c1db089
Merge branch 'main' into docs/how-to-test-changes
c0sta Jan 8, 2024
caaa5a7
Merge branch 'main' into docs/how-to-test-changes
c0sta Jan 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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