| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library linter.src.rules.slash_for_doc_comments; | 5 library linter.src.rules.slash_for_doc_comments; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:linter/src/linter.dart'; | 9 import 'package:linter/src/linter.dart'; |
| 10 | 10 |
| 11 const desc = r'Prefer to use /// for doc comments'; | 11 const desc = r'Prefer to use /// for doc comments'; |
| 12 | 12 |
| 13 const details = r''' | 13 const details = r''' |
| 14 From the [style guide] (https://www.dartlang.org/articles/style-guide/): | 14 From the [style guide](https://www.dartlang.org/articles/style-guide/): |
| 15 | 15 |
| 16 **PREFER** to use `///` for doc comments. | 16 **PREFER** to use `///` for doc comments. |
| 17 | 17 |
| 18 Although Dart supports two syntaxes of doc comments (`///` and `/**`), we | 18 Although Dart supports two syntaxes of doc comments (`///` and `/**`), we |
| 19 prefer using `///` for doc comments. | 19 prefer using `///` for doc comments. |
| 20 | 20 |
| 21 **GOOD:** | 21 **GOOD:** |
| 22 ``` | 22 ``` |
| 23 /// Parses a set of option strings. For each option: | 23 /// Parses a set of option strings. For each option: |
| 24 /// | 24 /// |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 @override | 111 @override |
| 112 visitMethodDeclaration(MethodDeclaration node) { | 112 visitMethodDeclaration(MethodDeclaration node) { |
| 113 checkComment(node.documentationComment); | 113 checkComment(node.documentationComment); |
| 114 } | 114 } |
| 115 | 115 |
| 116 @override | 116 @override |
| 117 visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 117 visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 118 checkComment(node.documentationComment); | 118 checkComment(node.documentationComment); |
| 119 } | 119 } |
| 120 } | 120 } |
| OLD | NEW |