Skip to content

Commit

Permalink
Disable two lint rules which are being removed. (#7959)
Browse files Browse the repository at this point in the history
Each of these are going to be removed soon.

* avoid_null_checks_in_equality_operators
* unsafe_html

Work towards https://github.com/dart-lang/linter/issues/5063 and https://github.com/dart-lang/linter/issues/5001
  • Loading branch information
srawlins authored Oct 30, 2024
1 parent d13a53b commit e12e073
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ linter:
- avoid_init_to_null
- avoid_js_rounded_ints
# - avoid_multiple_declarations_per_line # seems to be a stylistic choice we don't subscribe to
- avoid_null_checks_in_equality_operators
# - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it
- avoid_print
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
Expand Down Expand Up @@ -219,7 +218,6 @@ linter:
- unnecessary_to_list_in_spreads
- unreachable_from_main
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
- use_colored_box
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) {
// XSS attacks through the contents of the marker InfoWindow.
// See: https://pub.dev/documentation/sanitize_html/latest/sanitize_html/sanitizeHtml.html
// See: b/159137885, b/159598165
// ignore: unsafe_html
snippet.innerHTMLString = sanitizeHtml(markerSnippet);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class ImageResizer {
Completer<web.HTMLImageElement>();
final web.HTMLImageElement imageElement = web.HTMLImageElement();
imageElement
// ignore: unsafe_html
..src = blobUrl
..onLoad.listen((web.Event event) {
imageLoadCompleter.complete(imageElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class UrlLauncherPlugin extends UrlLauncherPlatform {
final String target = webOnlyWindowName ??
((_isSafari && _isSafariTargetTopScheme(scheme)) ? '_top' : '');

// ignore: unsafe_html
_window.open(url, target, 'noopener,noreferrer');

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class WebWebViewController extends PlatformWebViewController {

@override
Future<void> loadHtmlString(String html, {String? baseUrl}) async {
// ignore: unsafe_html
_webWebViewParams.iFrame.src = Uri.dataFromString(
html,
mimeType: 'text/html',
Expand All @@ -78,7 +77,6 @@ class WebWebViewController extends PlatformWebViewController {
if (params.headers.isEmpty &&
(params.body == null || params.body!.isEmpty) &&
params.method == LoadRequestMethod.get) {
// ignore: unsafe_html
_webWebViewParams.iFrame.src = params.uri.toString();
} else {
await _updateIFrameFromXhr(params);
Expand All @@ -99,7 +97,6 @@ class WebWebViewController extends PlatformWebViewController {
final ContentType contentType = ContentType.parse(header);
final Encoding encoding = Encoding.getByName(contentType.charset) ?? utf8;

// ignore: unsafe_html
_webWebViewParams.iFrame.src = Uri.dataFromString(
(await response.text().toDart).toDart,
mimeType: contentType.mimeType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class WebWebViewPlatform implements WebViewPlatform {
iFrame.style.border = 'none';
final String? initialUrl = creationParams.initialUrl;
if (initialUrl != null) {
// ignore: unsafe_html
iFrame.src = initialUrl;
}
if (onWebViewPlatformCreated != null) {
Expand Down Expand Up @@ -127,7 +126,6 @@ class WebWebViewPlatformController implements WebViewPlatformController {

@override
Future<void> loadUrl(String url, Map<String, String>? headers) async {
// ignore: unsafe_html
_element.src = url;
}

Expand Down Expand Up @@ -176,7 +174,6 @@ class WebWebViewPlatformController implements WebViewPlatformController {
String html, {
String? baseUrl,
}) async {
// ignore: unsafe_html
_element.src = Uri.dataFromString(
html,
mimeType: 'text/html',
Expand Down

0 comments on commit e12e073

Please sign in to comment.