.. include:: /Includes.rst.txt .. index:: pair: Coding guidelines; JavaScript .. _cgl-javascript: ============================ JavaScript coding guidelines ============================ The rules suggested in the `Airbnb JavaScript Style Guide `__ should be used throughout the TYPO3 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 `__