Fixed linter warnings

This commit is contained in:
thomashii 2021-09-13 08:35:38 +08:00
parent 9865ed93d2
commit 4199da654b
4 changed files with 14 additions and 6 deletions

View file

@ -66,7 +66,9 @@ class JaelFormatter {
{bool isFirst = false, bool isLast = false}) {
if (child == null) {
return lineLength;
} else if (child is Element) return _formatElement(child, lineLength);
} else if (child is Element) {
return _formatElement(child, lineLength);
}
String s;
if (child is Interpolation) {
var b = StringBuffer('{{');

View file

@ -16,14 +16,18 @@ Document? parseDocument(String text,
if (scanner.errors.isNotEmpty && onError != null) {
scanner.errors.forEach(onError);
} else if (scanner.errors.isNotEmpty) throw scanner.errors.first;
} else if (scanner.errors.isNotEmpty) {
throw scanner.errors.first;
}
var parser = Parser(scanner, asDSX: asDSX);
var doc = parser.parseDocument();
if (parser.errors.isNotEmpty && onError != null) {
parser.errors.forEach(onError);
} else if (parser.errors.isNotEmpty) throw parser.errors.first;
} else if (parser.errors.isNotEmpty) {
throw parser.errors.first;
}
return doc;
}

View file

@ -46,7 +46,7 @@ void main() {
});
test('sets etag, cache-control, expires, last-modified', () async {
var response = await client.get(Uri.parse('$url'));
var response = await client.get(Uri.parse(url));
print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');
@ -60,7 +60,7 @@ void main() {
});
test('if-modified-since', () async {
var response = await client.get(Uri.parse('$url'), headers: {
var response = await client.get(Uri.parse(url), headers: {
'if-modified-since':
HttpDate.format(DateTime.now().add(Duration(days: 365)))
});

View file

@ -11,7 +11,9 @@ ContextAwareMatcher predicateWithContext(
ContextAwareMatcher wrapContextAwareMatcher(x) {
if (x is ContextAwareMatcher) {
return x;
} else if (x is Matcher) return _WrappedContextAwareMatcher(x);
} else if (x is Matcher) {
return _WrappedContextAwareMatcher(x);
}
return wrapContextAwareMatcher(wrapMatcher(x));
}