Feature Request: pattern specific config overrides #26
Labels
duplicate
This issue or pull request already exists
enhancement
New feature or request
help wanted
Extra attention is needed
In some of my projects there are special files (recognisable by their names) that always import certain base classes. I'd like to always have those base classes at the top as a kind of header, but split them into other groups in regular files.
I'd be helpful if one could create multiple group configurations, which are selected based on a regex matching the file path. Possibly by adding an option
overrides: { pattern: string, config: string }[]
which specifies alternative config files for special patterns.Since the files in question do not lie in separate folders and the imported functions appear elsewhere as well, it's not possible to use specialized config files in subfolders or more complicated grouping rules. Since I use the VSCode plugin for this, this machanic could be achieved by vscode issue 35350, but that might take some time. The only option right now is to exclude those files and do the sorting manually, but that defeats the purpose of using format-imports.
Basically a duplicate of issue 75 in the plugin repository, but now at the place where config resolution actually happens.
The text was updated successfully, but these errors were encountered: