Parsoid/Style guide

Jump to navigation Jump to search

This page documents differences from the MediaWiki JS coding conventions. Our conventions are enforced by jshint.


The team would prefer to use spaces for indentation, but for now we are following the MediaWiki preference for tabs. Our tabs are four chars in width. [1]

Strict mode[edit]

Enable strict mode near the top of all js files:

"use strict";


if (foo
    && (aReallyLongCondition
        || anotherReallyReallyLongCondition)
    && foo.bat
) {


  1. Example .vimrc line for vim users:
    autocmd BufNewFile,BufRead /home/gabriel/src/parsoid/**.js set ts=4 sw=4 noexpandtab