---
title: "JavaScript coding guidelines"
manual: "TYPO3 Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:cgl-javascript@13.4"
source: "CodingGuidelines/CglJavaScript/Index.rst"
rendered: "2026-09-21T07:21:01+00:00"
---

# JavaScript coding guidelines {#cgl-javascript}

The rules suggested in the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) 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 {#cgl-javascript-directories-filenames}

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

## Format {#cgl-javascript-format}

-   Use spaces, not TABs.
-   Indent with 2 spaces.
-   Use single quotes ('') for strings.
-   Prefix jQuery object variables with a `$`.

## More information {#cgl-javascript-information}

-   See [Setup IDE / editor](https://docs.typo3.org/permalink/t3coreapi:cgl-ide@13.4) in this manual for information about setting up your Editor / IDE to adhere to
    the coding guidelines.
-   [AirBnb JavaScript Style Guide: Whitespace](https://github.com/airbnb/javascript#whitespace)
-   [AirBnb JavaScript Style Guide: Strings](https://github.com/airbnb/javascript#strings)
-   [AirBnb JavaScript Style Guide: jQuery](https://github.com/airbnb/javascript#jquery)
