Skip to content

Commit f965f20

Browse files
authored
docs: fix notes placement and update description
Signed-off-by: Athan <[email protected]>
1 parent eb49b5f commit f965f20

File tree

1 file changed

+15
-14
lines changed
  • lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest

1 file changed

+15
-14
lines changed

lib/node_modules/@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest/README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var rule = require( '@stdlib/_tools/eslint/rules/tsdoc-declarations-doctest' );
3838

3939
#### rule
4040

41-
[ESLint rule][eslint-rules] to ensure that return annotations in TSDoc examples match the actual output in TypeScript declaration files (`*.d.ts`). Return annotations may start with `returns`, `throws`, or `=>`. `returns` follow variable declarations or assignment expressions, whereas `=>` follow expression-only forms including `console.log` calls. The rule validates `@example` blocks in TSDoc comments within `.d.ts` files by automatically resolving the corresponding implementation via the nearest `package.json` file.
41+
[ESLint rule][eslint-rules] to ensure that return annotations in TSDoc examples match the actual output in TypeScript declaration files (`*.d.ts`).
4242

4343
**Bad**:
4444

@@ -84,6 +84,20 @@ export = add;
8484

8585
<!-- /.usage -->
8686

87+
<section class="notes">
88+
89+
## Notes
90+
91+
- Return annotations may start with `returns`, `throws`, or `=>`. `returns` follow variable declarations or assignment expressions, whereas `=>` follow expression-only forms including `console.log` calls.
92+
- The rule validates `@example` blocks in TSDoc comments within `*.d.ts` files by resolving the corresponding implementation via the nearest `package.json` file in the same or a parent directory and using its `main` field.
93+
- The rule skips validation if the `package.json` file cannot be found or if the resolved implementation cannot be loaded.
94+
- Examples are executed in a sandboxed VM context with limited globals for security.
95+
- This rule is specifically designed for TypeScript declaration files and will only process files with a `*.d.ts` filename extension.
96+
97+
</section>
98+
99+
<!-- /.notes -->
100+
87101
<section class="examples">
88102

89103
## Examples
@@ -151,19 +165,6 @@ var result = linter.verify( code, {
151165

152166
<!-- /.examples -->
153167

154-
<section class="notes">
155-
156-
## Notes
157-
158-
- The rule automatically resolves the implementation path by traversing up the directory tree to find the nearest `package.json` file and using its `main` field.
159-
- The rule skips validation if the `package.json` file cannot be found or if the resolved implementation cannot be loaded.
160-
- Examples are executed in a sandboxed VM context with limited globals for security.
161-
- This rule is specifically designed for TypeScript declaration files and will only process files with a `.d.ts` extension.
162-
163-
</section>
164-
165-
<!-- /.notes -->
166-
167168
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
168169

169170
<section class="related">

0 commit comments

Comments
 (0)