Skip to content

Commit efe86ef

Browse files
committed
The string 'use strict' on its own line shouldn't cause a warning
1 parent 040bf5e commit efe86ef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

javascriptlint/warnings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ def want_assign_or_call(node):
518518
# Ignore function calls.
519519
if child.kind == tok.LP and child.opcode == op.CALL:
520520
return
521+
if child.kind == tok.STRING and child.atom == 'use strict':
522+
return
521523
# Allow new function() { } as statements.
522524
if child.kind == tok.NEW:
523525
# The first kid is the constructor, followed by its arguments.

0 commit comments

Comments
 (0)