Skip to main content

avoid-banned-file-names

added in: 1.4.0
⚙️

Configure file names that you want to ban.

note

This rule requires configuration in order to highlight any issues.

⚙️ Config

Set entries (default is empty) to configure a list of regular expressions for file names to ban.

dart_code_metrics:
...
rules:
...
- avoid-banned-file-names:
entries:
- .*example.dart
warning

For Windows devices, ensure that the entries config works with Windows path separators.

Example

❌ Bad:

some_example.dart
void main () { // LINT
// ...
}

✅ Good:

another_file.dart
void main () {
// ...
}