Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add TS import tag #1219

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .README/rules/informative-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ For example, with `{ excludedTags: ["category"] }`, the following comment would
function computeTypes(node) {
// ...
}
```

No tags are excluded by default.

Expand Down
1 change: 1 addition & 0 deletions .README/rules/sort-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ a fixed order that doesn't change into the future, supply your own
'file',
'fileoverview',
'overview',
'import',

// Identifying (name, type)
'typedef',
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/check-tag-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ function quux (foo) {}
* @variation
* @version
* @yields
* @import
* @internal
* @overload
* @satisfies
Expand Down Expand Up @@ -1028,6 +1029,7 @@ function quux (foo) {}
* @variation
* @version
* @yields
* @import
* @internal
* @overload
* @satisfies
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/informative-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* [Options](#user-content-informative-docs-options)
* [`aliases`](#user-content-informative-docs-options-aliases)
* [`excludedTags`](#user-content-informative-docs-options-excludedtags)
* [`uselessWords`](#user-content-informative-docs-options-uselesswords)
* [Context and settings](#user-content-informative-docs-context-and-settings)
* [Failing examples](#user-content-informative-docs-failing-examples)
Expand Down Expand Up @@ -60,6 +61,7 @@ For example, with `{ excludedTags: ["category"] }`, the following comment would
function computeTypes(node) {
// ...
}
```

No tags are excluded by default.

Expand Down
19 changes: 10 additions & 9 deletions docs/rules/sort-tags.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/defaultTagOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const defaultTagOrder = [
'file',
'fileoverview',
'overview',
'import',

// Identifying (name, type)
'typedef',
Expand Down
3 changes: 3 additions & 0 deletions src/tagNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ const jsdocTags = {
const typeScriptTags = {
...jsdocTags,

// https://github.com/microsoft/TypeScript/issues/22160
import: [],

// https://www.typescriptlang.org/tsconfig/#stripInternal
internal: [],

Expand Down
4 changes: 4 additions & 0 deletions test/rules/assertions/checkTagNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,10 @@ export default {
{
code: `${ALL_TYPESCRIPT_TAGS_COMMENT}\nfunction quux (foo) {}`,
errors: [
{
line: lineCount(ALL_TYPESCRIPT_TAGS_COMMENT) - 4,
message: 'Invalid JSDoc tag name "import".',
},
{
line: lineCount(ALL_TYPESCRIPT_TAGS_COMMENT) - 3,
message: 'Invalid JSDoc tag name "internal".',
Expand Down