Skip to content

Commit 2341ac7

Browse files
committed
Update README.md based on testing
1 parent 052a63c commit 2341ac7

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

eslint-plugin/README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,49 @@ This ESLint plugin provides a rule for validating that TypeScript doc comments c
55

66
## Usage
77

8-
1. Configure ESLint for your TypeScript project. See the instructions provided by the
9-
[typescript-eslint](
10-
https://github.com/typescript-eslint/typescript-eslint#how-do-i-configure-my-project-to-use-typescript-eslint) project.
8+
1. Configure ESLint for your TypeScript project. See the instructions provided by the
9+
[typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) project.
10+
You will end up with some dependencies like this:
1111

12-
2. Add the `eslint-plugin-tsdoc` dependency to your project:
12+
**my-project/package.json** (example)
13+
```ts
14+
{
15+
"name": "my-project",
16+
"version": "1.0.0",
17+
"dependencies": {},
18+
"devDependencies": {
19+
"@typescript-eslint/eslint-plugin": "~2.6.1",
20+
"@typescript-eslint/parser": "~2.6.1",
21+
"eslint": "~6.6.0",
22+
"typescript": "~3.7.2"
23+
},
24+
"scripts": {
25+
"lint": "eslint -f unix \"src/**/*.{ts,tsx}\""
26+
}
27+
}
28+
```
29+
30+
2. Add the `eslint-plugin-tsdoc` dependency to your project:
1331

1432
```bash
1533
$ cd my-project
1634
$ npm install --save-dev eslint-plugin-tsdoc
1735
```
1836

19-
3. Enable the rule in your ESLint config file. Example usage:
37+
3. In your ESLint config file, add the `"eslint-plugin-tsdoc"` package to your `plugins` field,
38+
and enable the `"tsdoc/syntax"` rule. For example:
2039

21-
**my-project/.eslintrc.js**
40+
**my-project/.eslintrc.js** (example)
2241
```ts
2342
module.exports = {
24-
parser: '@typescript-eslint/parser',
43+
plugins: [
44+
"@typescript-eslint/eslint-plugin",
45+
"eslint-plugin-tsdoc"
46+
],
2547
extends: [
2648
'plugin:@typescript-eslint/recommended'
2749
],
50+
parser: '@typescript-eslint/parser',
2851
parserOptions: {
2952
project: "./tsconfig.json",
3053
tsconfigRootDir: __dirname,
@@ -36,3 +59,6 @@ This ESLint plugin provides a rule for validating that TypeScript doc comments c
3659
}
3760
};
3861
```
62+
63+
This package is maintained by the TSDoc project. If you have questions or feedback, please
64+
[let us know](https://github.com/microsoft/tsdoc/issues)!

0 commit comments

Comments
 (0)