slash-for-doc-comments
Same as slash_for_doc_comments in Dart lints
- Group
- Style
- Path
lint/style/slash-for-doc-comments- Default
- On (recommended)
- Origin
- Dart lints
- Rule
- 435 of 512
Flags /** ... */ block documentation comments in favor of the /// form.
Dart supports two doc-comment syntaxes, but the community style guide standardizes
on the end-of-line /// form; the /** ... */ block form is discouraged. Using a
single style keeps doc comments consistent and easy to scan. Detection scans the
raw source with a small quote/comment state machine, not the Dart lexer, and
excludes the empty /**/ comment. It does not fully model raw, multiline or
interpolated strings, or nested block comments.
Invalid
/** A documented class. */
class A {}
/** Documents the second class. */
class B {}
/** Documents the third class. */
class C {}
/** Documents the fourth class. */
class D {}
/** Documents the fifth class. */
class E {}/** A documented class. */ /** Documents the second class. */ /** Documents the third class. */ /** Documents the fourth class. */ /** Documents the fifth class. */Valid
/// A documented class using the end-of-line form.
class A {}
/// Documents the second class.
class B {}
/* An ordinary block comment, not a doc comment. */
class C {}
/*
* A single-star banner block, still not a doc comment.
*/
class D {}
// A plain line comment.
class E {}Configure slash-for-doc-comments
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"slash-for-doc-comments": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/slash-for-doc-comments: <reason>More style rules
- sort-child-properties-last
sort_child_properties_lastrecommendedflutterSort Widget-valued child properties last, except before closure arguments.
- sort-constructors-first
sort_constructors_firstFlags a constructor declared after a non-constructor member.
- sort-unnamed-constructors-first
sort_unnamed_constructors_firstFlags an unnamed constructor declared after a named constructor.
- tighten-type-of-initializing-formals
tighten_type_of_initializing_formalsFlags a nullable
this.xorsuper.xinitializing formal whose constructor assertsx != null. - type-annotate-public-apis
type_annotate_public_apisrecommendedRequires type annotations on public declarations.
- type-init-formals
type_init_formalsrecommendedFlags a *redundant* type annotation on an initializing formal or super parameter (
type-init-formals, adopted from package:lints). - unawaited-futures
unawaited_futuresrecommendedFutureresults inasyncbodies must be awaited or markedunawaited. - unintended-html-in-doc-comment
unintended_html_in_doc_commentrecommendedFlags angle-bracket text in doc comments that Markdown would render as an HTML tag.