1
1
# CONTRIBUTING to eslint-plugin-jsdoc
2
2
3
+ ## Installing ` pnpm `
4
+
5
+ Development is conducted using ` pnpm ` . Install via ` npm i -g pnpm ` .
6
+
3
7
## Testing changes locally
4
8
5
9
You might try a TDD approach and add tests within the ` test ` directory,
6
10
to try different configs you may find it easier to try out changes in
7
11
a separate local directory.
8
12
9
- You can run [ ` npm link` ] ( https://docs.npmjs.com/cli/link ) for this purpose,
13
+ You can run [ ` pnpm link` ] ( https://docs.npmjs.com/cli/link ) for this purpose,
10
14
pointing from your project to this project. For example, while in your project
11
15
root and with ` eslint-plugin-jsdoc ` as a sibling, run:
12
16
13
17
``` shell
14
- npm link ../eslint-plugin-jsdoc
18
+ pnpm link ../eslint-plugin-jsdoc
15
19
```
16
20
17
21
## Building the project
18
22
19
- After running ` npm install` to get the latest dependencies and devDependencies,
23
+ After running ` pnpm install` to get the latest dependencies and devDependencies,
20
24
you can run the following command to update the ` dist ` files, with ` dist/index.js `
21
25
being the ` main ` entry point from ` package.json ` :
22
26
23
27
``` shell
24
- npm run build
28
+ pnpm build
25
29
```
26
30
27
31
## Coding standards
28
32
29
33
The project follows ESLint rules from [ ` canonical ` ] ( https://www.npmjs.com/package/eslint-config-canonical )
30
34
and testing follows its subconfig, ` canonical/mocha ` . You can run
31
- ` npm run lint` to check the linting if your IDE is not already indicating
35
+ ` pnpm lint` to check the linting if your IDE is not already indicating
32
36
items needing fixing.
33
37
34
38
## Documentation building
@@ -38,7 +42,7 @@ modify files within the `.README` directory. `.README/README.md` contains the
38
42
main README skeleton and details on the project, its global ` settings ` , etc.,
39
43
while the documentation for specific rules (that will be pulled into the
40
44
README) ought to be modified within the relevant file within ` .README/rules ` .
41
- Once these files are modified, you can run ` npm run create-readme` to have
45
+ Once these files are modified, you can run ` pnpm create-readme` to have
42
46
these files integrated into the main ` /README.md ` . While you should include
43
47
the built file in your PR, you will not want to make manual changes
44
48
directly to this file, as they will be overwritten.
@@ -57,14 +61,14 @@ See ESLint's [RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#rul
57
61
for more on the allowable properties (e.g., ` code ` , ` errors ` (for invalid rules),
58
62
` options ` , ` settings ` , etc.).
59
63
60
- Note that besides ` npm test` there is ` npm run test-cov` , which shows more
64
+ Note that besides ` pnpm test` there is ` pnpm test-cov` , which shows more
61
65
detailed coverage information. Coverage should be maintained at 100%, and
62
66
if there are a few guards in place for future use, the code block in question
63
67
can be ignored by being preceded by ` /* istanbul ignore next */ ` (including
64
68
for warnings where the block is never passed over (i.e., the block is always
65
69
entered)). If you want to test without coverage at all, you can use
66
- ` npm run test-no-cov` . To only test rules rather than other files, you
67
- can use ` npm run test-index ` .
70
+ ` pnpm test-no-cov` . To only test rules rather than other files, you
71
+ can use ` npm run test-index ` ( ` pnpm ` doesn't work with this script currently) .
68
72
69
73
To test specific rules, you can supply a comma-separated list with the ` --rule `
70
74
flag passed to ` test-index ` , e.g., for ` check-examples ` and ` require-example ` :
@@ -77,7 +81,7 @@ accepts negative offsets from the end, e.g., `-1` for the last item). For
77
81
example, to check the first and third invalid tests of ` check-examples `
78
82
along with the second valid test, you can run:
79
83
80
- ` npm run -- rule=check-examples --invalid=0,2 --valid=1 test-index ` .
84
+ ` npm run test-index -- rule=require-example --invalid=0,2 --valid=1 ` .
81
85
82
86
## Requirements for PRs
83
87
0 commit comments