Skip to main content

avoid-double-slash-imports

has auto-fix
pro+

Warns when an import/export directive contains a double slash.

Double slash in the URI is considered valid, but under some circumstances the program won't run.

Example

❌ Bad:

// LINT: Avoid import/export directives with double slashes.
import 'package:test//material.dart';
// LINT: Avoid import/export directives with double slashes.
import '../../..//rule_utils_test.dart';

// LINT: Avoid import/export directives with double slashes.
export 'package:mocktail//good_file.dart';

// LINT: Avoid import/export directives with double slashes.
part '../../..//individual/rules/empty.dart';

✅ Good:

import 'package:test/material.dart'; // Correct, no double slashes
import 'package:mocktail/good_file.dart';
import '../../../rule_utils_test.dart';

export 'package:mocktail/good_file.dart';

part '../../../individual/rules/empty.dart';

Additional Resources