Enable more lints (#91642)

This commit is contained in:
Ian Hickson
2021-10-14 22:03:03 -07:00
committed by GitHub
parent 9570d353b3
commit 299d484903
42 changed files with 138 additions and 87 deletions

View File

@@ -11,7 +11,7 @@ final AnchorElement _urlParsingNode = AnchorElement();
/// Example: for the url `http://example.com/foo`, the extracted pathname will
/// be `/foo`.
String extractPathname(String url) {
_urlParsingNode.href = url;
_urlParsingNode.href = url; // ignore: unsafe_html, node is never exposed to the user
final String pathname = _urlParsingNode.pathname ?? '';
return (pathname.isEmpty || pathname[0] == '/') ? pathname : '/$pathname';
}