Skip to content

Add better error for '=+' typo #164

Open

Description

@sderickson

from @alexholman, copied from codecombat/codecombat#3710

Related to my initial issue report: codecombat/codecombat#3709
I found my problem was typing =+ instead of += for an increment, resulting in an infinite loop condition.

This is not a very informative error for this easy typo. The code should catch the use of =+ and warn, much like it catches capitalization issues in object names and missing ':' in loops.

Activity

  1. UltCombo commented on Jun 25, 2016

    @UltCombo
    Contributor

    I guess most of you already know this, but a problem is that =+ is actually valid syntax. For example, in JavaScript:

    var x = '5';
    x=+x; // Convert string to number
    hero.say(typeof x); // number
    hero.say(x); // 5

    But still, maybe Aether can show a custom JSHint warning for this specific construct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions