Remove outdated ignores (#162773)
Powered by the new and amazing `unnecessary_ignore` lint. We're not enabling this lint by default because being able to temporarily use ignores that don't ignore anything is a powerful tool to enable migrations. We should turn this lint on locally periodically, though, and clean up all outdated ignores.
This commit is contained in:
committed by
GitHub
parent
5944d992ac
commit
c783ce2344
@@ -357,7 +357,7 @@ class Size extends OffsetBase {
|
||||
///
|
||||
/// * [Size.fromRadius], which is more convenient when the available size
|
||||
/// is the radius of a circle.
|
||||
const Size.square(double dimension) : super(dimension, dimension); // ignore: use_super_parameters
|
||||
const Size.square(double dimension) : super(dimension, dimension);
|
||||
|
||||
/// Creates a [Size] with the given [width] and an infinite [height].
|
||||
const Size.fromWidth(double width) : super(width, double.infinity);
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// found in the LICENSE file.
|
||||
part of dart.ui;
|
||||
|
||||
// ignore_for_file: avoid_classes_with_only_static_members
|
||||
|
||||
/// Helper functions for Dart Plugin Registrants.
|
||||
abstract final class DartPluginRegistrant {
|
||||
static bool _wasInitialized = false;
|
||||
|
||||
@@ -7,8 +7,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test_api/backend.dart';
|
||||
// TODO(ditman): Fix ignore when https://github.com/flutter/flutter/issues/143599 is resolved.
|
||||
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/util/io.dart';
|
||||
|
||||
import 'browser.dart';
|
||||
import 'browser_process.dart';
|
||||
|
||||
@@ -10,10 +10,8 @@ import 'package:path/path.dart' as pathlib;
|
||||
// https://github.com/dart-lang/test/issues/1521
|
||||
import 'package:skia_gold_client/skia_gold_client.dart';
|
||||
import 'package:test_api/backend.dart' as hack;
|
||||
// TODO(ditman): Fix ignores when https://github.com/flutter/flutter/issues/143599 is resolved.
|
||||
import 'package:test_core/src/executable.dart' as test; // ignore: implementation_imports
|
||||
import 'package:test_core/src/runner/hack_register_platform.dart'
|
||||
as hack; // ignore: implementation_imports
|
||||
import 'package:test_core/src/executable.dart' as test;
|
||||
import 'package:test_core/src/runner/hack_register_platform.dart' as hack;
|
||||
|
||||
import '../browser.dart';
|
||||
import '../common.dart';
|
||||
|
||||
@@ -23,13 +23,12 @@ import 'package:skia_gold_client/skia_gold_client.dart';
|
||||
import 'package:stream_channel/stream_channel.dart';
|
||||
|
||||
import 'package:test_core/backend.dart' hide Compiler;
|
||||
// TODO(ditman): Fix ignores when https://github.com/flutter/flutter/issues/143599 is resolved.
|
||||
import 'package:test_core/src/runner/environment.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/runner/platform.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/runner/plugin/platform_helpers.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/runner/runner_suite.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/util/io.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/util/stack_trace_mapper.dart'; // ignore: implementation_imports
|
||||
import 'package:test_core/src/runner/environment.dart';
|
||||
import 'package:test_core/src/runner/platform.dart';
|
||||
import 'package:test_core/src/runner/plugin/platform_helpers.dart';
|
||||
import 'package:test_core/src/runner/runner_suite.dart';
|
||||
import 'package:test_core/src/util/io.dart';
|
||||
import 'package:test_core/src/util/stack_trace_mapper.dart';
|
||||
|
||||
import 'package:web_socket_channel/web_socket_channel.dart';
|
||||
import 'package:web_test_utils/image_compare.dart';
|
||||
|
||||
@@ -90,7 +90,7 @@ class Size extends OffsetBase {
|
||||
const Size(super.width, super.height);
|
||||
// Used by the rendering library's _DebugSize hack.
|
||||
Size.copy(Size source) : super(source.width, source.height);
|
||||
const Size.square(double dimension) : super(dimension, dimension); // ignore: use_super_parameters
|
||||
const Size.square(double dimension) : super(dimension, dimension);
|
||||
const Size.fromWidth(double width) : super(width, double.infinity);
|
||||
const Size.fromHeight(double height) : super(double.infinity, height);
|
||||
const Size.fromRadius(double radius) : super(radius * 2.0, radius * 2.0);
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
part of ui;
|
||||
|
||||
// ignore_for_file: avoid_classes_with_only_static_members
|
||||
|
||||
/// Helper functions for Dart Plugin Registrants.
|
||||
class DartPluginRegistrant {
|
||||
/// Makes sure the that the Dart Plugin Registrant has been called for this
|
||||
|
||||
@@ -16,7 +16,6 @@ typedef PlatformMessageCallback =
|
||||
void Function(String name, ByteData? data, PlatformMessageResponseCallback? callback);
|
||||
typedef ErrorCallback = bool Function(Object exception, StackTrace stackTrace);
|
||||
|
||||
// ignore: avoid_classes_with_only_static_members
|
||||
/// A token that represents a root isolate.
|
||||
class RootIsolateToken {
|
||||
static RootIsolateToken? get instance {
|
||||
|
||||
@@ -2756,30 +2756,16 @@ extension SkTextStylePropertiesExtension on SkTextStyleProperties {
|
||||
|
||||
@JS('shadows')
|
||||
external set _shadows(JSArray<JSAny?>? value);
|
||||
set shadows(List<SkTextShadow>? value) =>
|
||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
||||
// backends.
|
||||
// ignore: unnecessary_cast
|
||||
_shadows =
|
||||
(value as List<JSAny>?)?.toJS;
|
||||
set shadows(List<SkTextShadow>? value) => _shadows = (value as List<JSAny>?)?.toJS;
|
||||
|
||||
@JS('fontFeatures')
|
||||
external set _fontFeatures(JSArray<JSAny?>? value);
|
||||
set fontFeatures(List<SkFontFeature>? value) =>
|
||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
||||
// backends.
|
||||
// ignore: unnecessary_cast
|
||||
_fontFeatures =
|
||||
(value as List<JSAny>?)?.toJS;
|
||||
set fontFeatures(List<SkFontFeature>? value) => _fontFeatures = (value as List<JSAny>?)?.toJS;
|
||||
|
||||
@JS('fontVariations')
|
||||
external set _fontVariations(JSArray<JSAny?>? value);
|
||||
set fontVariations(List<SkFontVariation>? value) =>
|
||||
// TODO(joshualitt): remove this cast when we reify JS types on JS
|
||||
// backends.
|
||||
// ignore: unnecessary_cast
|
||||
_fontVariations =
|
||||
(value as List<JSAny>?)?.toJS;
|
||||
_fontVariations = (value as List<JSAny>?)?.toJS;
|
||||
}
|
||||
|
||||
@JS()
|
||||
|
||||
@@ -158,7 +158,6 @@ extension DomWindowExtension on DomWindow {
|
||||
message.toJSAnyShallow,
|
||||
targetOrigin.toJS,
|
||||
// Cast is necessary so we can call `.toJS` on the right extension.
|
||||
// ignore: unnecessary_cast
|
||||
(messagePorts as List<JSAny>).toJS,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -140,8 +140,7 @@ class HtmlRenderer implements Renderer {
|
||||
required ui.ImageFilter outer,
|
||||
required ui.ImageFilter inner,
|
||||
}) {
|
||||
// TODO(ferhat): add implementation and remove the "ignore".
|
||||
// ignore: avoid_unused_constructor_parameters
|
||||
// TODO(ferhat): add implementation.
|
||||
throw UnimplementedError('ImageFilter.erode not implemented for HTML renderer.');
|
||||
}
|
||||
|
||||
|
||||
@@ -869,7 +869,6 @@ class GlContext {
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: avoid_classes_with_only_static_members
|
||||
/// Creates gl context from cached OffscreenCanvas for webgl rendering to image.
|
||||
class GlContextCache {
|
||||
static int _maxPixelWidth = 0;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
@DefaultAsset('skwasm')
|
||||
// The web_sdk/sdk_rewriter.dart uses this directive.
|
||||
// ignore: unnecessary_library_directive
|
||||
library skwasm_impl;
|
||||
|
||||
import 'dart:ffi';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// ignore_for_file: avoid_unused_constructor_parameters
|
||||
|
||||
import 'dart:ffi';
|
||||
import 'dart:typed_data';
|
||||
|
||||
|
||||
@@ -74,9 +74,7 @@ class CustomElementDimensionsProvider extends DimensionsProvider {
|
||||
void close() {
|
||||
super.close();
|
||||
_hostElementResizeObserver?.disconnect();
|
||||
// ignore:unawaited_futures
|
||||
_dprChangeStreamSubscription?.cancel();
|
||||
// ignore:unawaited_futures
|
||||
_onResizeStreamController.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ class FullPageDimensionsProvider extends DimensionsProvider {
|
||||
void close() {
|
||||
super.close();
|
||||
_domResizeSubscription.cancel();
|
||||
// ignore:unawaited_futures
|
||||
_onResizeStreamController.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ double _rectDistance(Rect a, Rect b) {
|
||||
}
|
||||
|
||||
double _sizeDistance(Size a, Size b) {
|
||||
final Offset delta = (b - a) as Offset; // ignore: unnecessary_parenthesis
|
||||
final Offset delta = (b - a) as Offset;
|
||||
return delta.distance;
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ void testMain() {
|
||||
}
|
||||
|
||||
void twoCallback(ByteData? responseData) {
|
||||
throw TestFailure('wrong callback called'); // ignore: only_throw_errors
|
||||
throw TestFailure('wrong callback called');
|
||||
}
|
||||
|
||||
_resize(buffers, channel, 100);
|
||||
@@ -214,7 +214,7 @@ void testMain() {
|
||||
}
|
||||
|
||||
void twoCallback(ByteData? responseData) {
|
||||
throw TestFailure('wrong callback called'); // ignore: only_throw_errors
|
||||
throw TestFailure('wrong callback called');
|
||||
}
|
||||
|
||||
_resize(buffers, channel, 1);
|
||||
|
||||
@@ -46,7 +46,7 @@ Future<void> testMain() async {
|
||||
} on TestFailure {
|
||||
return;
|
||||
}
|
||||
throw TestFailure('transforms were too close to equal'); // ignore: only_throw_errors
|
||||
throw TestFailure('transforms were too close to equal');
|
||||
}
|
||||
|
||||
test('ui.Canvas.translate affects canvas.getTransform', () {
|
||||
@@ -136,7 +136,7 @@ Future<void> testMain() async {
|
||||
} on TestFailure {
|
||||
return;
|
||||
}
|
||||
throw TestFailure('transforms were too close to equal'); // ignore: only_throw_errors
|
||||
throw TestFailure('transforms were too close to equal');
|
||||
}
|
||||
|
||||
group('ui.Canvas clip tests', () {
|
||||
|
||||
@@ -159,7 +159,6 @@ void main() async {
|
||||
|
||||
List<ColorFilter> colorFilters() {
|
||||
// Create new color filter instances on each invocation.
|
||||
// ignore: prefer_const_constructors
|
||||
return <ColorFilter>[
|
||||
ColorFilter.mode(green, BlendMode.color), // ignore: prefer_const_constructors
|
||||
ColorFilter.mode(red, BlendMode.color), // ignore: prefer_const_constructors
|
||||
|
||||
@@ -75,5 +75,5 @@ void main() {
|
||||
final Pointer<Utf8> fakePath = 'fake-path'.toNativeUtf8();
|
||||
expect(_loadLibraryFromKernel(fakePath), null);
|
||||
malloc.free(fakePath);
|
||||
}, skip: kProfileMode || kReleaseMode); // ignore: avoid_redundant_argument_values
|
||||
}, skip: kProfileMode || kReleaseMode);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// ignore_for_file: prefer_const_constructors, unused_local_variable, depend_on_referenced_packages
|
||||
// ignore_for_file: prefer_const_constructors, unused_local_variable
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:const_finder_fixtures_package/package.dart';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// ignore_for_file: prefer_const_constructors, unused_local_variable, depend_on_referenced_packages
|
||||
// ignore_for_file: prefer_const_constructors, unused_local_variable
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:const_finder_fixtures_package/package.dart';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// ignore_for_file: prefer_const_constructors, depend_on_referenced_packages
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
import 'package:const_finder_fixtures/target.dart';
|
||||
|
||||
void createTargetInPackage() {
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
// this script (the first set for _canonicalizeLanguageCode and the second set
|
||||
// for _canonicalizeRegionCode).
|
||||
|
||||
// ignore_for_file: avoid_print
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
Reference in New Issue
Block a user