JSLint reports “Unexpected dangling” character in an underscore prefixed variable name

后端 未结 4 1649
一整个雨季
一整个雨季 2020-12-02 14:56

I know that some people consider the presence of a leading underscore to imply that a variable is \"private,\" that such privacy is a fiction, and assume this is why JSLint

4条回答
  •  北海茫月
    2020-12-02 15:37

    JSLint is just a code quality tool. Not completely passing its tests does not mean your code is bad; it simply means you don't follow all the conventions laid out by its creator. Although JSLint makes very good suggestions, it is not always possible to fulfill them all, especially when using someone else's library which was not tested against it. Rather than littering your source code with meaningless meta-comments, you should check your code with the "Disallow dangling _ in identifiers" option disabled, since it seems not to makes sense to use with your particular code.

提交回复
热议问题