Currently we have no guidelines for TYPO3 Core JS files. This result in inconsistency in how code is formatted and makes JS harder to maintain and review new changes.
Unfortunately there is no “One standard to rule them all” in JS world like PSR2 in PHP. Seems that every bigger JS library, or framework creates it’s own standard.
Just to name a few:
CGL discussion can be long and emotional, so if we don’t reach consensus during discussion on which CGL standard to use, I propose to agree on some basic stuff like indentation, spaces after keywords, and leave introduction of some full blown CGL rules for later.
The long term goal should be to be able to setup a JS lint in pre merge tests in Bamboo.
- All core JS files should be reformatted to match the CGL
- CGL Documentation should be updated
- consistent look and feel for JS files, easier to read
- ease mantaining of JS files
- opens a way to add some linting, syntax checking
- existing code has to be reformatted
- docs needs to be written and change need to be communicated
Topic Initiator: Tymoteusz Motylewski
Topic Mentor: Tymoteusz Motylewski