If you'd like to contribute an example or bug fix, feel free to send us a pull request. Please make sure to search the issue tracker first for duplicates.
Create tests for your examples. This is so we can ensure they don't break when future changes are made and it also helps people to understand the processes within.
Please make sure to use always the latest riot releases:
For all the other libraries use either jsdelivr.com or cdnjs
Please follow the standard set by the other examples by using this folder structure suggestion:
- example-tag.css
- example-tag.js
- example-tag.tag
- index.html
- README.md
- package.json
- test/
Not all of these are required, it will differ between examples.
Follow the coding style established in the rest of the codebase.
Semicolons
No
semicolons,
please!
Spacing
Use two spaces for indentation. No tabs.
Spacing around brackets: if (foo) {
instead of if(foo){
Quotes
Single-quoted strings are preferred to double-quoted strings.
Equality Checking
Prefer ==
over ===
unless it's a must.
Bitwise Operations
Prefer classic conditionals i < 0
over bitwise operators !~pos