Skip to content

Commit 5e30f71

Browse files
authored
Add separate Joomla 4 javascript page (#252)
1 parent bcd5ae7 commit 5e30f71

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
File renamed without changes.

manual/javascript-j4.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Javascript in Joomla 4
2+
3+
Joomla 4 uses ES6 syntax where ever possible. As part of this change we decided to use an industry standard codestyle
4+
rules for our javascript - the AirBNB coding standards. These can be found [on their GitHub page](https://github.com/airbnb/javascript#table-of-contents)
5+
6+
We have four modifications to the defaults.
7+
8+
1. We allow parameter reassignment of function parameters to allow easier setting
9+
of defaults (for examples please see the ESLint rules [here](https://eslint.org/docs/rules/no-param-reassign)).
10+
11+
2. Secondly we only allow the imports of dev dependencies from npm in our build directory (`build/`) (rather than in all
12+
files).
13+
14+
3. We currently allow browser alerts using the `alert()` function (the long term intention is to disable this as we move
15+
to our custom element alerts)
16+
17+
4. We always enable javascript strict mode as we aren't using javascript modules at the moment
18+
19+
We also use ESLint to enforce these rules. If you are familiar with javascript from other projects you've worked on you
20+
can find our eslint rules at (in the following location on GitHub)[https://github.com/joomla/joomla-cms/blob/4.0-dev/.eslintrc]

0 commit comments

Comments
 (0)