.. include:: ../../Includes.txt .. _cgl-javascript: ============================ 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 :file:`.js` * JavaScript files are located under :file:`/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 ================ * See :ref:`cgl-ide` in this manual for information about setting up your Editor / IDE to adhere to the coding guidelines. * `AirBnb JavaScript Style Guide: Whitespace `__ * `AirBnb JavaScript Style Guide: Strings `__ * `AirBnb JavaScript Style Guide: jQuery `__