You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: developer_manual/getting_started/codingguidelines.rst
+44-39Lines changed: 44 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@ General
20
20
Labels
21
21
------
22
22
23
-
We assign labels to issues and pull requests to make it easy to find them and to signal what needs to be done. Some of these are assigned by the developers, others by QA, bug triagers, project lead or maintainers and so on. It is not desired that users/reporters of bugs assign labels themselves, unless they are developers/contributors to Nextcloud.
23
+
We assign labels to issues and pull requests to make it easy to find them and to signal what needs to be done.
24
+
Some of these are assigned by the developers, others by QA, bug triagers, project lead or maintainers and so on.
25
+
It is not desired that users/reporters of bugs assign labels themselves, unless they are developers/contributors to Nextcloud.
24
26
25
27
The most important labels and their meaning:
26
28
@@ -31,7 +33,8 @@ The most important labels and their meaning:
31
33
* ``2. developing`` - development in progress
32
34
* ``3. to review`` - ready for review
33
35
* ``4. to release`` - reviewed PR that awaits unfreeze of a branch to get merged or has pending CI jobs
34
-
* ``needs info`` - this issue needs further information from the reporter, see :doc:`../../prologue/bugtracker/triaging`. This tag is typically combined with ``0. to triage`` to signal a bug report is not confirmed yet or a feature request has not been approved.
36
+
* ``needs info`` - this issue needs further information from the reporter, see :doc:`../../prologue/bugtracker/triaging`.
37
+
This tag is typically combined with ``0. to triage`` to signal a bug report is not confirmed yet or a feature request has not been approved.
35
38
36
39
* Tags showing the type of issue or PR
37
40
@@ -271,15 +274,16 @@ with ``Data``.
271
274
}
272
275
273
276
274
-
JavaScript
275
-
----------
277
+
JavaScript and Typescript
278
+
-------------------------
276
279
277
-
There is a shared configuration for`eslint <https://eslint.org/>`_ that you can use to automatically format your Nextcloud apps's JavaScript code. It consists of two parts: a `config package <https://github.com/nextcloud/eslint-config>`_ that contains the formatting preferences and a `plugin <https://github.com/nextcloud/eslint-plugin>`_ to detect deprecated and removed APIs in your code. See their readmes for instructions.
280
+
There is a shared configuration for`eslint <https://eslint.org/>`_ that you can use to automatically format your Nextcloud apps's JavaScript code.
281
+
It consists of two parts: a `config package <https://github.com/nextcloud-libraries/eslint-config>`_ that contains the formatting preferences and a `plugin <https://github.com/nextcloud-libraries/eslint-plugin>`_ to detect deprecated and removed APIs in your code. See their readmes for instructions.
278
282
279
-
* Use a :file:`js/main.js` or :file:`js/app.js` where your program is started
283
+
* Use a :file:`js/main.js` or :file:`js/app.ts` where your program is started
280
284
* Use **const** or **let** to limit variable to local scope
281
-
* Use JavaScript strict mode
282
-
* Use a global namespace object where you bind publicly used functions and objects to
285
+
* Use JavaScript strict mode (automatically the case when using JavaScript modules)
286
+
* Use a global namespace object where you bind publicly used functions and objects to instead of plain global variables.
283
287
284
288
**DO**:
285
289
@@ -321,36 +325,37 @@ This is how you'd do inheritance in JavaScript:
321
325
322
326
.. code-block:: javascript
323
327
324
-
// create parent object and bind methods to it
325
-
var ParentObject = function(name) {
326
-
this.name = name;
327
-
};
328
-
329
-
ParentObject.prototype.sayHello = function() {
330
-
console.log(this.name);
331
-
}
328
+
class ParentClass {
329
+
// a public property
330
+
name;
331
+
// names prefixed with # are private in JavaScript and can not be accessed from outside
332
+
// #privateProperty;
332
333
334
+
constructor(name) {
335
+
this.name = name;
336
+
}
333
337
334
-
// create childobject, call parents constructor and inherit methods
0 commit comments