slash_for_doc_comments
建議使用 ///
作為文件註解。
此規則自 Dart 2.0 起可用。
此規則有快速修正可用。
詳細資訊
#請使用 ///
作為文件註解。
雖然 Dart 支援兩種文件註解語法 (///
和 /**
),但我們偏好使用 ///
作為文件註解。
良好
dart
/// Parses a set of option strings. For each option:
///
/// * If it is `null`, then it is ignored.
/// * If it is a string, then [validate] is called on it.
/// * If it is any other type, it is *not* validated.
void parse(List options) {
// ...
}
在文件註解中,您可以使用 markdown 進行格式化。
用法
#若要啟用 slash_for_doc_comments
規則,請在您的 analysis_options.yaml
檔案中的 linter > rules 下新增 slash_for_doc_comments
analysis_options.yaml
yaml
linter:
rules:
- slash_for_doc_comments
除非另有說明,否則本網站上的文件反映的是 Dart 3.6.0。頁面最後更新於 2024-07-03。 檢視原始碼 或 回報問題。