-
Notifications
You must be signed in to change notification settings - Fork 109
Code Style
Please follow the these guidelines. Some are just preference, others are good practice.
Typically, code editors support .editorconfig
, eslint.config.js
, and .prettierrc.json
files which are located in the repository and therefore automatically format your code to match the project style code.
-
Use modern JS (ECMAScript 2024 standard).
-
eqeqeq: use identity operators:
===
and!==
. Why do I want this? -
You can use jQuery, but you should favor vanilla JS whenever possible.
-
Indentation: 2 spaces.
-
enforce semicolon.
-
'one true brace-style' (see also curly):
- opening brace on the same line:
if (blub) {
- else clauses:
} else if (blub) {
or} else {
- opening brace on the same line:
-
keyword-spacing: there should be a space after
if
,for
, etc.E.g.
if (true) { doStuff(); } else { dontDoStuff(); }
-
spaced-comment:
// this is a comment
-
quotes: Use single-quotes for JavaScript and double-quotes for HTML content.
Example:
$('body').append('<div id="soup">Soup!</div>');
-
Line length: Soft limit of 160 characters (set in .prettierrc.json with "printWidth": 160), but try to keep them shorter where suitable.
-
no-trailing-spaces: ensure you remove all trailing whitespace before submitting your patch.
If you editor doesn’t detect those for you, try
grep -nE "[[:space:]]+$" «filename»
For IITC users
-
Guide on how to migrate data from an legacy version of IITC Mobile
-
(click to expand )
Cache (Data caching to prevent reloading)
Controls (Map controls/widgets)
Draw (Allow drawing things onto the current map so you may plan your next move)
Highlighter (Portal highlighters)
- Hide portal ownership
- Highlight portals by level color
- Highlight inactive portals
- Highlight portal weakness
- Highlight high level portals
- Highlight portals by my level
- Highlight portals with ornaments
- Highlight portals that need recharging
- Highlight portals with ornaments
- Highlight portals that need recharging
- Highlight portals missing resonators
- Highlight portals with infrastructure problems
Info (Display additional information)
- Available AP statistics
- Portal count
- Portals list
- Player level guess
- Localized scoreboard
- Missions
- Scoring cycle / checkpoint times
- Layer count
Layer (Additional map layers)
- Find farms on map
- Portal Level Numbers
- Overlay KML / GPX / GeoJSON
- Ingress scoring regions
- Zaprange
- Player activity tracker
- Portal Names
- Keys on map
Map Tiles (Alternative map layers)
- Stamen.com map layers
- Blank map
- Gray Google map
- Bing maps
- OpenStreetMap.org map
- Gaode (高德地图) / AutoNavi map
- Kartverket.no maps (Norway)
- Yandex maps
Portal Info (Enhanced information on the selected portal)
Tweaks (Adjust IITC settings)
Misc (Unclassified plugins)
For plugin developers
For IITC developers