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.
JS linting
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: JS linting
I generally like the idea. As far as I can tell this will require node.js though?
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: JS linting
To run it on Travis or on the command line, yeah. They have plugins for most editors, though.
Re: JS linting
And every phpstorm user should install the jshint plugin too
Has an irascible disposition.
Re: JS linting
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.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: JS linting
If you can install that in your editor then sure. I'm not suggesting adding any dependencies.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: JS linting
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
http://www.lornajane.net/posts/2014/add ... is-project
Re: JS linting
I won't vote in favor until I know the rule list you are thinking on using for phpBB.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: JS linting
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)
https://github.com/phpbb/phpbb/pull/3668/files
http://area51.phpbb.com/docs/31x/coding-guidelines.html (this has been like this for years)