jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

requireUseStrict to ensure strict mode is used #2146

Closed erikvold closed 8 years ago

erikvold commented 8 years ago

It would be nice if there was a check called requireUseStrict or maybe requireStrictMode that each js file started with "use strict";.

To start the value could just be set to true or false/undefined, later we could perhaps add something like { "functions": true, "files": false }

markelog commented 8 years ago

Sounds good, would you like to implement it?

erikvold commented 8 years ago

sure

erikvold commented 8 years ago

Hmm I've come to realize that we should just accept a true value, I don't see why someone would require that people use "use strict"; in every functions, but not at the file level. And if it turns out someone can come up with a reason why that is useful then we can add it later.

erikvold commented 8 years ago

@markelog review?