JavaScript Coding Guidelines

The rules suggested in the Airbnb JavaScript Style Guide should be used throughout the TYPO3 CMS core for JavaScript files.

Note that the TYPO3 core typically uses TypeScript now and automatically converts it to JavaScript.

Directories and Filenames

  • JavaScript files should have the file ending .js
  • JavaScript files are located under <extension>/Resources/Public/JavaScript/

Format

  • Use spaces, not TABs.
  • Indent with 2 spaces.
  • Use single quotes (‘’) for strings.
  • Prefix jQuery object variables with a $ .

More Information