Skip to content

Commit 9e9fed5

Browse files
committed
fix: add TS import tag; fixes #1218
1 parent 3e88f9a commit 9e9fed5

File tree

8 files changed

+24
-9
lines changed

8 files changed

+24
-9
lines changed

.README/rules/informative-docs.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ For example, with `{ excludedTags: ["category"] }`, the following comment would
4646
function computeTypes(node) {
4747
// ...
4848
}
49+
```
4950

5051
No tags are excluded by default.
5152

.README/rules/sort-tags.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ a fixed order that doesn't change into the future, supply your own
6363
'file',
6464
'fileoverview',
6565
'overview',
66+
'import',
6667

6768
// Identifying (name, type)
6869
'typedef',

docs/rules/check-tag-names.md

+2
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ function quux (foo) {}
714714
* @variation
715715
* @version
716716
* @yields
717+
* @import
717718
* @internal
718719
* @overload
719720
* @satisfies
@@ -1028,6 +1029,7 @@ function quux (foo) {}
10281029
* @variation
10291030
* @version
10301031
* @yields
1032+
* @import
10311033
* @internal
10321034
* @overload
10331035
* @satisfies

docs/rules/informative-docs.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* [Options](#user-content-informative-docs-options)
66
* [`aliases`](#user-content-informative-docs-options-aliases)
7+
* [`excludedTags`](#user-content-informative-docs-options-excludedtags)
78
* [`uselessWords`](#user-content-informative-docs-options-uselesswords)
89
* [Context and settings](#user-content-informative-docs-context-and-settings)
910
* [Failing examples](#user-content-informative-docs-failing-examples)
@@ -60,6 +61,7 @@ For example, with `{ excludedTags: ["category"] }`, the following comment would
6061
function computeTypes(node) {
6162
// ...
6263
}
64+
```
6365

6466
No tags are excluded by default.
6567

docs/rules/sort-tags.md

+10-9
Large diffs are not rendered by default.

src/defaultTagOrder.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const defaultTagOrder = [
1111
'file',
1212
'fileoverview',
1313
'overview',
14+
'import',
1415

1516
// Identifying (name, type)
1617
'typedef',

src/tagNames.js

+3
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ const jsdocTags = {
136136
const typeScriptTags = {
137137
...jsdocTags,
138138

139+
// https://github.com/microsoft/TypeScript/issues/22160
140+
import: [],
141+
139142
// https://www.typescriptlang.org/tsconfig/#stripInternal
140143
internal: [],
141144

test/rules/assertions/checkTagNames.js

+4
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ export default {
856856
{
857857
code: `${ALL_TYPESCRIPT_TAGS_COMMENT}\nfunction quux (foo) {}`,
858858
errors: [
859+
{
860+
line: lineCount(ALL_TYPESCRIPT_TAGS_COMMENT) - 4,
861+
message: 'Invalid JSDoc tag name "import".',
862+
},
859863
{
860864
line: lineCount(ALL_TYPESCRIPT_TAGS_COMMENT) - 3,
861865
message: 'Invalid JSDoc tag name "internal".',

0 commit comments

Comments
 (0)