[javascriptlint-commit] SF.net SVN: javascriptlint: [189] trunk
Status: Beta
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2008-04-03 20:39:36
|
Revision: 189 http://javascriptlint.svn.sourceforge.net/javascriptlint/?rev=189&view=rev Author: matthiasmiller Date: 2008-04-03 13:39:28 -0700 (Thu, 03 Apr 2008) Log Message: ----------- Add warning against useless quotes. Modified Paths: -------------- trunk/pyjsl/warnings.py Added Paths: ----------- trunk/tests/warnings/useless_quotes.js Modified: trunk/pyjsl/warnings.py =================================================================== --- trunk/pyjsl/warnings.py 2008-04-02 19:11:36 UTC (rev 188) +++ trunk/pyjsl/warnings.py 2008-04-03 20:39:28 UTC (rev 189) @@ -434,6 +434,13 @@ if node.end_comma: return node +class useless_quotes: + 'the quotation marks are unnecessary' + @lookat(tok.STRING) + def _lint(self, node): + if node.node_index == 0 and node.parent.kind == tok.COLON: + return node + class mismatch_ctrl_comments: 'mismatched control comment; "ignore" and "end" control comments must have a one-to-one correspondence' pass Added: trunk/tests/warnings/useless_quotes.js =================================================================== --- trunk/tests/warnings/useless_quotes.js (rev 0) +++ trunk/tests/warnings/useless_quotes.js 2008-04-03 20:39:28 UTC (rev 189) @@ -0,0 +1,8 @@ +function useless_quotes() { + var o = { + 'key': 1 /*warning:useless_quotes*/ + }; + o = { + key: '1' + }; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |