@@ -72,6 +72,7 @@ JSDoc linting rules for ESLint.
72
72
* [`require-yields-check`](#user-content-eslint-plugin-jsdoc-rules-require-yields-check)
73
73
* [`sort-tags`](#user-content-eslint-plugin-jsdoc-rules-sort-tags)
74
74
* [`tag-lines`](#user-content-eslint-plugin-jsdoc-rules-tag-lines)
75
+ * [`text-escaping`](#user-content-eslint-plugin-jsdoc-rules-text-escaping)
75
76
* [`valid-types`](#user-content-eslint-plugin-jsdoc-rules-valid-types)
76
77
77
78
@@ -22100,6 +22101,155 @@ The following patterns are not considered problems:
22100
22101
````
22101
22102
22102
22103
22104
+ <a name="user-content-eslint-plugin-jsdoc-rules-text-escaping"></a>
22105
+ <a name="eslint-plugin-jsdoc-rules-text-escaping"></a>
22106
+ ### <code>text-escaping</code>
22107
+
22108
+ This rule can auto-escape certain characters that are input within block and
22109
+ tag descriptions.
22110
+
22111
+ This rule may be desirable if your text is known not to contain HTML or
22112
+ Markdown and you therefore do not wish for it to be accidentally interpreted
22113
+ as such by the likes of Visual Studio Code or if you wish to view it escaped
22114
+ within it or your documentation.
22115
+
22116
+ <a name="user-content-eslint-plugin-jsdoc-rules-text-escaping-options-42"></a>
22117
+ <a name="eslint-plugin-jsdoc-rules-text-escaping-options-42"></a>
22118
+ #### Options
22119
+
22120
+ <a name="user-content-eslint-plugin-jsdoc-rules-text-escaping-options-42-escapehtml"></a>
22121
+ <a name="eslint-plugin-jsdoc-rules-text-escaping-options-42-escapehtml"></a>
22122
+ ##### <code>escapeHTML</code>
22123
+
22124
+ This option escapes all `<` and `&` characters (except those followed by
22125
+ whitespace which are treated as literals by Visual Studio Code).
22126
+
22127
+ <a name="user-content-eslint-plugin-jsdoc-rules-text-escaping-options-42-escapemarkdown"></a>
22128
+ <a name="eslint-plugin-jsdoc-rules-text-escaping-options-42-escapemarkdown"></a>
22129
+ ##### <code>escapeMarkdown</code>
22130
+
22131
+ This option escapes the first backtick (`` ` ``) in a paired sequence.
22132
+
22133
+ |||
22134
+ |---|---|
22135
+ |Context|everywhere|
22136
+ |Tags|``|
22137
+ |Recommended|false|
22138
+ |Settings||
22139
+ |Options||
22140
+
22141
+ The following patterns are considered problems:
22142
+
22143
+ ````js
22144
+ /**
22145
+ * Some things to escape: <a> and > and `test`
22146
+ */
22147
+ // Message: You must include either `escapeHTML` or `escapeMarkdown`
22148
+
22149
+ /**
22150
+ * Some things to escape: <a> and > and ઼ and `test`
22151
+ */
22152
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22153
+ // Message: You have unescaped HTML characters < or &
22154
+
22155
+ /**
22156
+ * Some things to escape: <a> and > and `test`
22157
+ */
22158
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22159
+ // Message: You have unescaped Markdown backtick sequences
22160
+
22161
+ /**
22162
+ * Some things to escape:
22163
+ * <a> and > and `test`
22164
+ */
22165
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22166
+ // Message: You have unescaped HTML characters < or &
22167
+
22168
+ /**
22169
+ * Some things to escape:
22170
+ * <a> and > and `test`
22171
+ */
22172
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22173
+ // Message: You have unescaped Markdown backtick sequences
22174
+
22175
+ /**
22176
+ * @param {SomeType} aName Some things to escape: <a> and > and `test`
22177
+ */
22178
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22179
+ // Message: You have unescaped HTML characters < or & in a tag
22180
+
22181
+ /**
22182
+ * @param {SomeType} aName Some things to escape: <a> and > and `test`
22183
+ */
22184
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22185
+ // Message: You have unescaped Markdown backtick sequences in a tag
22186
+
22187
+ /**
22188
+ * @param {SomeType} aName Some things to escape:
22189
+ * <a> and > and `test`
22190
+ */
22191
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22192
+ // Message: You have unescaped HTML characters < or & in a tag
22193
+
22194
+ /**
22195
+ * @param {SomeType} aName Some things to escape:
22196
+ * <a> and > and `test`
22197
+ */
22198
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22199
+ // Message: You have unescaped Markdown backtick sequences in a tag
22200
+ ````
22201
+
22202
+ The following patterns are not considered problems:
22203
+
22204
+ ````js
22205
+ /**
22206
+ * Some things to escape: <a> and > and `test`
22207
+ */
22208
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22209
+
22210
+ /**
22211
+ * Some things to escape: <a> and > and \`test`
22212
+ */
22213
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22214
+
22215
+ /**
22216
+ * Some things to escape: < and &
22217
+ */
22218
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22219
+
22220
+ /**
22221
+ * Some things to escape: `
22222
+ */
22223
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22224
+
22225
+ /**
22226
+ * @param {SomeType} aName Some things to escape: <a> and > and `test`
22227
+ */
22228
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22229
+
22230
+ /**
22231
+ * @param {SomeType} aName Some things to escape: <a> and > and \`test`
22232
+ */
22233
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22234
+
22235
+ /**
22236
+ * @param {SomeType} aName Some things to escape: < and &
22237
+ */
22238
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22239
+
22240
+ /**
22241
+ * @param {SomeType} aName Some things to escape: `
22242
+ */
22243
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeMarkdown":true}]
22244
+
22245
+ /**
22246
+ * Nothing
22247
+ * to escape
22248
+ */
22249
+ // "jsdoc/text-escaping": ["error"|"warn", {"escapeHTML":true}]
22250
+ ````
22251
+
22252
+
22103
22253
<a name="user-content-eslint-plugin-jsdoc-rules-valid-types"></a>
22104
22254
<a name="eslint-plugin-jsdoc-rules-valid-types"></a>
22105
22255
### <code>valid-types</code>
@@ -22181,8 +22331,8 @@ for valid types (based on the tag's `type` value), and either portion checked
22181
22331
for presence (based on `false` `name` or `type` values or their `required`
22182
22332
value). See the setting for more details.
22183
22333
22184
- <a name="user-content-eslint-plugin-jsdoc-rules-valid-types-options-42 "></a>
22185
- <a name="eslint-plugin-jsdoc-rules-valid-types-options-42 "></a>
22334
+ <a name="user-content-eslint-plugin-jsdoc-rules-valid-types-options-43 "></a>
22335
+ <a name="eslint-plugin-jsdoc-rules-valid-types-options-43 "></a>
22186
22336
#### Options
22187
22337
22188
22338
- `allowEmptyNamepaths` (default: true) - Set to `false` to bulk disallow
0 commit comments