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
.js
- JavaScript files are located under
<extension>/
Resources/ Public/ Java Script/
Format
- Use spaces, not TABs.
- Indent with 2 spaces.
- Use single quotes ('') for strings.
- Prefix jQuery object variables with a
$
.
More information
- See Setup IDE / editor 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