Closed Jannik-dev closed 9 months ago
Managed to get it to work using regex. This should be noted in the documentation and some more complex examples would be helpful
import_sorter:
ignored_files:
- (\\|\/)?lib(\\|\/)features(\\|\/)localization(\\|\/)generated((\\|\/)\w+)*.dart
- (\\|\/)?(\w+(\\|\/))*\w+.freezed.dart
Describe the bug I am not able to ignore generated files by localization and freezed. I apologize if I am using the parameter wrong, but I am expecting to use the same syntax as in a .gitignore file. Regardless of the outcome of this issue: It would be great if the documentation covers all 3 cases described below and maybe provides an example.
To Reproduce Create a file (for example t.dart under lib) Use the following configuraion in pubspec.yaml
File:
lib/t.dart
nothing happens Extension:lib/\*\*.freezed.dart
FormatException: Nothing to repeat lib/**.freezed.dart Folder:lib/generated
nothing happensExpected behavior File:
lib/t.dart
ignore the file Extension:lib/**.freezed.dart
ignore all files generated by freezed in folder lib Folder:lib/generated
ignore all files with lib/generated as a parentMeta Information:
import_sorter
Version: 4.6.0Additional Information Weird is that when using the sorter the file is mentioned as a child of itself:
generated\intl\messages_all.dart/messages_all.dart