Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: to loose/too lose→too loose/to lose (#2543)

Andrew Dunbar4b7ee5bfe4dc
diff --git a/harper-core/src/linting/weir_rules/ToLoseTooLoose.weir b/harper-core/src/linting/weir_rules/ToLoseTooLoose.weir
new file mode 100644
index 000000000..ed3c254a7
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/ToLoseTooLoose.weir
@@ -0,0 +1,9 @@
+expr main [(to loose), (too lose)]
+
+let message "For `not to win`, use `to lose`. For `not tight enough`, use `too loose`."
+let description "Corrects mixing up `to` with `too` and `lose` with `loose`."
+let kind "Spelling"
+let becomes ["to lose", "too loose"]
+
+test "Bits and pieces of legacy code that are lying around on my system and that it would be a pity to loose" "Bits and pieces of legacy code that are lying around on my system and that it would be a pity to lose"
+test "infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other" "infinite recursion caused by transforms that have their preconditions too loose and/or conflict with each other"
\ No newline at end of file