8000 docs(linter): clarify jsdoc/check-tag-names configuration (#11394) · oxc-project/oxc@eae51ca · GitHub
[go: up one dir, main page]

Skip to content

Commit eae51ca

Browse files
Ragnar-Oockgraphite-app[bot]camc314autofix-ci[bot]
authored
docs(linter): clarify jsdoc/check-tag-names configuration (#11394)
Explain how custom tags can be registered to avoid false positives when using them in comments. related issue #11392 --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Cameron <cameron.clark@hey.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 42738f0 commit eae51ca

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,40 @@ declare_oxc_lint!(
4343
/// ```javascript
4444
/// /** @param */
4545
/// ```
46+
///
47+
/// ### Options
48+
///
49+
/// Configuration for allowed tags is done via [`settings.jsdoc.tagNamePreference`](/docs/guide/usage/linter/config-file-reference.html#settings-jsdoc-tagnamepreference).
50+
/// There is no CLI-only parameter for this rule.
51+
///
52+
/// You can add custom tags by adding a key-value pair where both match the name of the tag you want to add, like so:
53+
///
54+
/// ::: code-group
55+
///
56+
/// ```json [Config (.oxlintrc.json)]
57+
/// {
58+
/// "plugins": ["jsdoc"],
59+
/// "rules": {
60+
/// "jsdoc/check-tag-names": "error"
61+
/// },
62+
/// "settings": { // [!code highlight:7]
63+
/// "jsdoc": {
64+
/// "tagNamePreference": {
65+
/// "customTagName": "customTagName"
66+
/// }
67+
/// }
68+
/// }
69+
/// }
70+
/// ```
71+
/// :::
72+
///
73+
/// Examples of correct code for this rule with the above configuration, adding the `customTagName` tag:
74+
///
75+
/// ```js
76+
/// /**
77+
/// * @customTagName
78+
/// */
79+
/// ```
4680
CheckTagNames,
4781
jsdoc,
4882
correctness

0 commit comments

Comments
 (0)
0