Skip to content

Commit cdb42d9

Browse files
committed
docs: base Testing Rules documentation
1 parent ee158a6 commit cdb42d9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: docs/contributing/local-development/Local_Linking.mdx

+19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The general strategy to do so is:
88

99
1. [Global linking](#global-linking): Use your package manager's global link command to make `@typescript-eslint/*` packages available as global symlinks.
1010
2. [Repository linking](#repository-linking): Use your package manager's link command to reference those global symlinks in the local downstream repository.
11+
3. [Testing rules](#testing): Test your local rules and plugins by enabling them in the local downstream repository.
1112

1213
## Global Linking
1314

@@ -45,6 +46,24 @@ Now, you should be able to run ESLint in the local downstream repository as you
4546
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.
4647
:::
4748

49+
## Testing Rules
50+
51+
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:
52+
53+
```json
54+
{
55+
"rules": {
56+
"@typescript-eslint/your-awesome-rule": "error"
57+
}
58+
// etc
59+
}
60+
```
61+
62+
After that, you just need to run your repository `lint` script.
63+
64+
- `npm run lint`
65+
- `yarn lint`
66+
4867
## Troubleshooting
4968

5069
### Packages Not Found (`Cannot find module`)

0 commit comments

Comments
 (0)