General developer forum

YUI + shifter

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Colin Chambers
Re: YUI + shifter

Hi Guys, a +1 from me for better tools for JS development. It's a big challenge for us at the OU and it's set to grow. Either that or we're unable to implement major improvements that the rest of the web are implementing. 

Just installed and used jshint for MDL-32750 on andrews suggestion. Was really simple to install and use. Thought I'd record the steps. Tim suggested here. 

These instructions are for Windows 7 64 bit.

install node js  

go to click install. When installed windows -> start -> programs -> node.js to start command line

install jshint
with an open node.js command line from above type npm install jshint -g

Check code
navigate in command line to the root directory of your moodle install.

Call jshint with the config options and path to the file to check.

Andrew has a jshint config file that sets the desired moodle code standards for jshint to use

I first used the line below and got the error "unexpected token". 
Wrapped configs in double quotes to fix it e.g. "evil":false (Yep, jshint can be configured to be evil
Now you're ready. Check your code by typing...
jshint --config pathtoandrewsconfigfile pathtofiletocheck e.g.git\lib\editor\tinymce\yui\collapse\collapse.js


Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: YUI + shifter
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

I just did this (thanks Colin for sharing) and it just worked! Really quick and easy. You can get the configuration file from, or more specifically

Average of ratings: -