JS linting

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

JS linting

Post by callumacrae » Thu May 28, 2015 12:14 pm

The JavaScript going in phpBB is a bit of a mess and looks like it was written by 20 different people (which it was).

I'd suggest we use JSHint and possibly JSCS, or ESLint.
Made by developers, for developers!
My blog

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 123
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: JS linting

Post by Marc » Thu May 28, 2015 1:15 pm

I generally like the idea. As far as I can tell this will require node.js though?

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: JS linting

Post by callumacrae » Thu May 28, 2015 1:47 pm

To run it on Travis or on the command line, yeah. They have plugins for most editors, though.
Made by developers, for developers!
My blog

User avatar
VSE
Extension Customisations
Extension Customisations
Posts: 670
Joined: Mon Mar 08, 2010 9:18 am

Re: JS linting

Post by VSE » Fri May 29, 2015 4:42 am

And every phpstorm user should install the jshint plugin too ;)
Has an irascible disposition.

User avatar
brunoais
Registered User
Posts: 958
Joined: Fri Dec 18, 2009 3:55 pm

Re: JS linting

Post by brunoais » Sat May 30, 2015 9:56 am

If using jsLint or JsHint, please also use FixMyJS. At least, it should be able to suggest copy & paste changes to help understanding the complaint when dealing with blanks.

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: JS linting

Post by callumacrae » Sat May 30, 2015 11:44 am

If you can install that in your editor then sure. I'm not suggesting adding any dependencies.
Made by developers, for developers!
My blog

User avatar
naderman
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: JS linting

Post by naderman » Sun May 31, 2015 11:36 am

All in favour, prepare a PR to enable them on travis?

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: JS linting

Post by callumacrae » Sun May 31, 2015 12:03 pm

Both projects depend on Node. It looks like it might already be installed, though—even on the PHP instances.

http://www.lornajane.net/posts/2014/add ... is-project
Made by developers, for developers!
My blog

User avatar
brunoais
Registered User
Posts: 958
Joined: Fri Dec 18, 2009 3:55 pm

Re: JS linting

Post by brunoais » Sun May 31, 2015 12:08 pm

I won't vote in favor until I know the rule list you are thinking on using for phpBB.

User avatar
callumacrae
Infrastructure Team
Infrastructure Team
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: JS linting

Post by callumacrae » Sun May 31, 2015 12:15 pm

It's a relaxed version of what I use at work and what I've always used for phpBB. Most code already conforms to it.

https://github.com/phpbb/phpbb/pull/3668/files

http://area51.phpbb.com/docs/31x/coding-guidelines.html (this has been like this for years)
Made by developers, for developers!
My blog

Post Reply