@@ -5,26 +5,49 @@ This ESLint plugin provides a rule for validating that TypeScript doc comments c
5
5
6
6
## Usage
7
7
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:
11
11
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 :
13
31
14
32
` ` ` bash
15
33
$ cd my-project
16
34
$ npm install --save-dev eslint-plugin-tsdoc
17
35
` ` `
18
36
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 :
20
39
21
- ** my-project/.eslintrc.js**
40
+ ** my - project / .eslintrc .js ** ( example )
22
41
` ` ` ts
23
42
module.exports = {
24
- parser: ' @typescript-eslint/parser' ,
43
+ plugins: [
44
+ "@typescript-eslint/eslint-plugin",
45
+ "eslint-plugin-tsdoc"
46
+ ],
25
47
extends: [
26
48
'plugin:@typescript-eslint/recommended'
27
49
],
50
+ parser: '@typescript-eslint/parser',
28
51
parserOptions: {
29
52
project: "./tsconfig.json",
30
53
tsconfigRootDir: __dirname,
@@ -36,3 +59,6 @@ This ESLint plugin provides a rule for validating that TypeScript doc comments c
36
59
}
37
60
};
38
61
` ` `
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