--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs for (var i = 0; i < 10; i--) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i < 10; i--) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 0; i <= 10; i--) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i <= 10; i--) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i > 10; i++) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i > 10; i++) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i >= 0; i++) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i >= 0; i++) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 0; i < 10; i -= 1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i < 10; i -= 1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 0; i <= 10; i -= 1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i <= 10; i -= 1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i > 10; i += 1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i > 10; i += 1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i >= 0; i += 1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i >= 0; i += 1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 0; i < 10; i += -1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i < 10; i += -1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 0; i <= 10; i += -1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 0; i <= 10; i += -1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i > 10; i -= -1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i > 10; i -= -1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` # Input ```cjs for (var i = 10; i >= 0; i -= -1) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/useValidForDirection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The update clause in this loop moves the variable in the wrong direction. > 1 │ for (var i = 10; i >= 0; i -= -1) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```