0

Are there any code standards/style guide checkers for JavaScript?

Basically, the equivalent of PHP_CodeSniffer, but for JavaScript.

samanime
  • 25,408
  • 15
  • 90
  • 139
  • Yes, there are, but this really isn't a question for SO. – Cerbrus Jun 02 '14 at 14:14
  • I want to be irked by the LMGTFU, but it gave me the result I was looking for. I did do some searching myself, but didn't find anything because I was using "javascript code standards checker", which doesn't yield anything useful (except now, this post). If you want to put the jscs link in an actual answer, I'll mark it correct. @Cerbrus: Where would be an appropriate place to ask this then? – samanime Jun 02 '14 at 14:19
  • @Cerbrus I disagree, this is most certainly the place to ask this question. It relates to coding, it is not spam, and it is tagged properly. I understand that SO is mainly used to fix specific code problems, but it is also for helping people find the right direction to do things themselves. – Matthew R. Jun 02 '14 at 14:47
  • See https://standardjs.com/index.html#i-disagree-with-rule-x-can-you-change-it – Michael Freidgeim Feb 17 '23 at 22:25

2 Answers2

1

Google JSLint, JSHint. Those are somewhat subjective though, especially JSLint.

Personally, I would recommend JSHint because it's community maintained. Also it has node.js-based CLI tools for code validation.

Anton Melnikov
  • 1,048
  • 7
  • 21
1

There is an open source one called jscs, no experience with it though:

https://github.com/mdevils/node-jscs

It offers NPM (node.js) and Grunt packages for download.

MarioDS
  • 12,895
  • 15
  • 65
  • 121