Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: lib/src/linter.dart

Issue 1754813003: Suppress lints on synthetic nodes/tokens (#193). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: review_fix Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/_data/synthetic/synthetic.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/linter.dart
diff --git a/lib/src/linter.dart b/lib/src/linter.dart
index b81583a629280662109f0509143eb54722c87527..69b33ba9a8ed1f254de4a875730323587b93e9b2 100644
--- a/lib/src/linter.dart
+++ b/lib/src/linter.dart
@@ -261,14 +261,14 @@ abstract class LintRule extends Linter implements Comparable<LintRule> {
@override
AstVisitor getVisitor() => null;
- void reportLint(AstNode node) {
- if (node != null) {
+ void reportLint(AstNode node, {bool ignoreSyntheticNodes: true}) {
+ if (node != null && (!node.isSynthetic || !ignoreSyntheticNodes)) {
reporter.reportErrorForNode(new _LintCode(name, description), node, []);
}
}
- void reportLintForToken(Token token) {
- if (token != null) {
+ void reportLintForToken(Token token, {bool ignoreSyntheticTokens: true}) {
+ if (token != null && (!token.isSynthetic || !ignoreSyntheticTokens)) {
reporter.reportErrorForToken(new _LintCode(name, description), token, []);
}
}
« no previous file with comments | « no previous file | test/_data/synthetic/synthetic.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698