obsidian-linter
obsidian-linter copied to clipboard
FR: Add check to avoid recursive rule combinations
Is Your Feature Request Related to a Problem? Please Describe.
Assume you have enabled the following rules:
- Lint of file change
- Insert file name as H1 if no H1 exists
- Start header increment at H2
If you have a note called filename
every file change will result in a new H1 which is immediately turned into H2 and pushes all other headings one level down, resulting in:
# Filename
## Filename
### Filename
#### Filename
##### Filename
###### Original H2
Describe the Solution You'd Like
Show a warning when both Insert file name as H1 if no H1 exists
and Start header increment at H2
are enabled, or make those options mutually exclusive.
Hey @tsievert . I like this suggestion, but I am not sure how to best do this since rules do not know about each other. They just know the common settings and their own information.
It is not easy to build these relationships out of which settings are not compatible with others and so enabling one should disable or at least warn you when it is enabled. I am not sure if you have any ideas on how to do this logically?
I was thinking I could show a modal before running the Linter if incompatible/contradictory rules are enabled and list out the rules that are incompatible and that they may cause issues if run together. However it would be better to tackle this at the level of enabling settings.
Unfortunately I don't have any good idea. A quick and easy solution would be to group the two toggles under a separate header and display a giant warning message that enabling both at the same time WILL cause issues (and maybe link to this issue?).