Skip to content
Alexander Danilov edited this page Mar 12, 2024 · 5 revisions

Please follow the these guidelines. Some are just preference, others are good practice.

Typically, code editors support .editorconfig, .eslintrc.json, and .prettierrc.json files which are located in the repository and therefore automatically format your code to match the project style code.

  • Use modern JS, such as the ES 2024 standard.

  • eqeqeq: use identity operators: === and !==. Why do I want this?

  • You can use jQuery, but you should favor vanilla JS whenever possible.

  • indent using two spaces.

  • enforce semicolon.

  • 'one true brace-style' (see also curly):

    • opening brace on the same line: if (blub) {
    • else clauses: } else if (blub) { or } else {
  • keyword-spacing: there should be a space after if, for, etc.

    E.g. if (true) { doStuff(); } else { dontDoStuff(); }

  • spaced-comment: // this is a comment

  • quotes: Use single-quotes for JavaScript and double-quotes for HTML content.

    Example: $('body').append('<div id="soup">Soup!</div>');

  • there is no length limit on lines, but try to keep them short where suitable.

  • no-trailing-spaces: ensure you remove all trailing whitespace before submitting your patch.

    If you editor doesn’t detect those for you, try grep -nE "[[:space:]]+$" «filename»


For IITC users


For plugin developers


For IITC developers

Clone this wiki locally