Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lack of "use strict" directive doesn't always warn #2668

Closed
lukeapage opened this issue Sep 7, 2015 · 2 comments
Closed

lack of "use strict" directive doesn't always warn #2668

lukeapage opened this issue Sep 7, 2015 · 2 comments

Comments

@lukeapage
Copy link
Member

This code:

// jshint strict: true, globalstrict: true
a = 1;

(or its 2.9.x + equivalent)

// jshint strict: global
a = 1;

both do not warn about missing a "use strict" directive.

I'm guessing only very short code files suffer this problem (or this would be a big problem) but it requires investigation.

Found during investigation of #2663

@lukeapage lukeapage changed the title lack of "use struct" directive doesn't always warn lack of "use strict" directive doesn't always warn Sep 7, 2015
@nicolo-ribaudo
Copy link
Contributor

Another test case:

// jshint strict: global
a + b;

@nicolo-ribaudo
Copy link
Contributor

JSHint doesn't warn if the statement is a function or a punctuator (a = 2 is = -> JSHint doesn't warn; var a = 2 is var -> JSHint warns)

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

No branches or pull requests

2 participants