OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 services.src.linter; | 5 library services.src.linter; |
6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; |
7 import 'package:analyzer/plugin/options.dart'; | 8 import 'package:analyzer/plugin/options.dart'; |
8 import 'package:analyzer/analyzer.dart'; | 9 import 'package:linter/src/rules.dart'; |
9 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
10 import 'package:linter/src/rules.dart'; | |
11 import 'package:linter/src/linter.dart'; | |
12 | 11 |
13 /** | 12 /** |
14 * An error code indicating an undefined lint rule. | 13 * An error code indicating an undefined lint rule. |
15 * | 14 * |
16 * Parameters: | 15 * Parameters: |
17 * 0: the rule name | 16 * 0: the rule name |
18 */ | 17 */ |
19 const AnalysisOptionsWarningCode UNDEFINED_LINT_WARNING = | 18 const AnalysisOptionsWarningCode UNDEFINED_LINT_WARNING = |
20 const AnalysisOptionsWarningCode( | 19 const AnalysisOptionsWarningCode( |
21 'UNDEFINED_LINT_WARNING', "'{0}' is not a recognized lint rule"); | 20 'UNDEFINED_LINT_WARNING', "'{0}' is not a recognized lint rule"); |
(...skipping 20 matching lines...) Expand all Loading... |
42 Iterable<String> registeredLints = ruleRegistry.map((r) => r.name); | 41 Iterable<String> registeredLints = ruleRegistry.map((r) => r.name); |
43 rules.nodes.forEach((YamlNode ruleNode) { | 42 rules.nodes.forEach((YamlNode ruleNode) { |
44 if (!registeredLints.contains(ruleNode.value)) { | 43 if (!registeredLints.contains(ruleNode.value)) { |
45 reporter.reportErrorForSpan( | 44 reporter.reportErrorForSpan( |
46 UNDEFINED_LINT_WARNING, ruleNode.span, [ruleNode.value]); | 45 UNDEFINED_LINT_WARNING, ruleNode.span, [ruleNode.value]); |
47 } | 46 } |
48 }); | 47 }); |
49 } | 48 } |
50 } | 49 } |
51 } | 50 } |
OLD | NEW |