unintended-html-in-doc-comment
Same as unintended_html_in_doc_comment in Dart lints
- Group
- Style
- Path
lint/style/unintended-html-in-doc-comment- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 448 of 512
Flags angle-bracket text in doc comments that Markdown would render as an HTML tag.
Dart renders doc comments as Markdown, so an unbacktick-quoted <int> or
List<int> is parsed as an HTML tag and silently dropped from the generated docs.
The rule scans /// comment lines for <name sequences whose name is not a known
HTML tag and is followed by a tag-like character (>, ,, <, or whitespace),
which distinguishes a stray generic from real markup or a <https://...> autolink.
Wrap such type references in backticks so they survive rendering. Fenced code blocks,
indented code, and inline code spans are skipped.
Invalid
/// Returns a List<int> of the parsed values.
/// Wraps a Future<void> completion.
/// Builds a Map<String, int> lookup table.
/// Emits a Stream<Event> of updates.
/// Backed by a Set<String> of keys.
class Api {}/// Returns a List<int> of the parsed values./// Returns a List<int> of the parsed values./// Wraps a Future<void> completion./// Wraps a Future<void> completion./// Builds a Map<String, int> lookup table./// Builds a Map<String, int> lookup table./// Emits a Stream<Event> of updates./// Emits a Stream<Event> of updates./// Backed by a Set<String> of keys.Valid
/// Returns a `List<int>` of the parsed values.
/// See <https://example.com> for the full reference.
/// Uses <code>inline</code> markup for emphasis.
/// True whenever a < b holds for the inputs.
/// Insert a hard line break here.<br>
/// Plain prose with no angle brackets at all.
class Api {}Configure unintended-html-in-doc-comment
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"unintended-html-in-doc-comment": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/unintended-html-in-doc-comment: <reason>More style rules
- unnecessary-await-in-return
unnecessary_await_in_returnAvoid
awaiton a returnedFuturethe function's ownFuturealready covers. - unnecessary-brace-in-string-interps
unnecessary_brace_in_string_interpsrecommendedFlags
${x}string interpolations whose braces can be dropped. - unnecessary-breaks
unnecessary_breaksrecommendedFlags a trailing
breakin a switch case that already ends implicitly. - unnecessary-constructor-name
unnecessary_constructor_namerecommendedFlags a redundant
.newon constructor declarations and invocations. - unnecessary-final
unnecessary_finalDon't use
finalfor local variables and parameters. - unnecessary-late
unnecessary_laterecommendedFlags a redundant
latemodifier on an initialized static or top-level variable. - unnecessary-library-directive
unnecessary_library_directiverecommendedFlags a
librarydirective that has neither a doc comment nor annotations. - unnecessary-library-name
unnecessary_library_namerecommendedFlags a
librarydirective that carries an explicit name.