Skip to content

Commit 711a045

Browse files
Add cspell, fix typos and format (#282)
* var -> let/const * Install cspell, fix typos, remove trailing spaces, run prettier * Update year, Use uppercase for filename
1 parent 351cf3e commit 711a045

16 files changed

+8314
-3859
lines changed

Diff for: about/license.md renamed to about/LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: License
44

55
# The MIT License (MIT)
66

7-
Copyright © 2016-2024 Michael Teeuw
7+
Copyright © 2016-2025 Michael Teeuw
88

99
Permission is hereby granted, free of charge, to any person obtaining a copy of
1010
this software and associated documentation files (the “Software”), to deal in

Diff for: about/donate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Donate
22

3-
MagicMirror² is opensource and free. That doesn't mean we don't need any money.
3+
MagicMirror² is open source and free. That doesn't mean we don't need any money.
44

55
Please consider a donation to help us cover the ongoing costs like webservers
66
and email services. If we receive enough donations we might even be able to free

Diff for: configuration/introduction.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction
22

3-
### Basic Configuration of MagicMirror²
3+
## Basic Configuration of MagicMirror²
44

55
1. Go to your configuration directory: In Bash/linux, it'll be in
66
`~/MagicMirror/config/`
@@ -28,7 +28,7 @@
2828
[installation](/getting-started/installation.md) if you're not sure how to do
2929
so.
3030

31-
### More useful configuration of your MagicMirror
31+
## More useful configuration of your MagicMirror
3232

3333
These directions assume a linux/bash style command line, and previous
3434
instructions followed. If not, please insert the path directly from your
@@ -73,10 +73,10 @@ are:
7373
| Environment Variable Name | Use |
7474
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
7575
| MM_CONFIG_FILE | This specifies an alternate configuration file for the system. This is useful when running multiple mirrors on the same device. This does not work with the template option below. NOTE: this file **_MUST_** be located in a directory within the MagicMirror directory. Ideally, place any config file in the config subdirectory. |
76-
| MM_PORT | This specifies an alternate TCPIP port, overriding "port" item within the config file. This is useful for testing to see if the product will run using another port. |
76+
| MM_PORT | This specifies an alternate TCP/IP port, overriding "port" item within the config file. This is useful for testing to see if the product will run using another port. |
7777
| mmFetchTimeout | time in milliseconds for fetch timeout. default (30000) <br><br>this value can be used to adjust the nodejs fetch function timeout value (default 10 seconds) for all node_helper modules that use fetch() |
7878

79-
##### Examples of use:
79+
#### Examples of use
8080

8181
You have created two config files, named config.js and config2.js
8282

@@ -111,12 +111,12 @@ export MM_CONFIG_FILE=config/config2.js
111111
npm run config:check
112112
```
113113

114-
```
114+
```log
115115
[26.12.2023 18:13.12.972] [INFO] Checking file... /home/<user>/MagicMirror/config/config2.js
116116
[26.12.2023 18:13.13.062] [INFO] Your configuration file doesn't contain syntax errors :)
117117
```
118118

119-
#### Configuration Template system:
119+
### Configuration Template system
120120

121121
`config.js.template` can be used instead of `config.js`. This allows you to use
122122
variables to replace hardcoded options. When starting MagicMirror² a `config.js`
@@ -155,37 +155,37 @@ if (typeof module !== "undefined") {
155155
}
156156
```
157157

158-
##### Defining variables:
158+
#### Defining variables
159159

160160
There are 2 ways to define variables, you can mix as needed or desired. If a
161161
variable is defined in both ways the linux environment variable is used.
162162

163-
##### Using a `config.env` file
163+
#### Using a `config.env` file
164164

165165
This file must be in the same folder as the `config.js.template` and contains
166166
the variables, using the example from above:
167167

168168
File content of `config.env`:
169169

170-
```
170+
```log
171171
MY_ADDRESS=localhost
172-
MYPORT=8080
172+
MY_PORT=8080
173173
MY_HTTPS=false
174174
```
175175

176-
##### Using linux environment variables
176+
#### Using linux environment variables
177177

178178
define them before you start MagicMirror², in a bash script, for example:
179179

180180
```bash
181181
cd ~/MagicMirror
182182
export MY_ADDRESS=localhost
183-
export MYPORT=8080
183+
export MY_PORT=8080
184184
export MY_HTTPS=false
185185
npm start
186186
```
187187

188-
#### Using `electronOptions`:
188+
### Using `electronOptions`
189189

190190
The most common use for `electronOptions` is a dual monitor setup on a Raspberry
191191
Pi 4 or greater. To do so, you can launch a second MagicMirror and use
@@ -197,14 +197,14 @@ You have two 1920x1080 monitors set up in the Pi as sitting next to each other:
197197
To move the pi to the second monitor, use this:
198198

199199
```js
200-
var config = {
200+
let config = {
201201
electronOptions: { x: 1920 },
202202
...
203203
```
204204
205-
#### A Couple of Real World Examples:
205+
### A Couple of Real World Examples
206206
207-
##### Two Screens:
207+
#### Two Screens
208208
209209
A user has two monitors running on a Pi4B. User wants to show cameras on one
210210
monitor, and wants to show informational panels on the other. Monitors are set
@@ -231,7 +231,7 @@ npm start
231231
Configuration file 1 (config.js):
232232
233233
```js
234-
var config = {
234+
let config = {
235235
address: "0.0.0.0", // Can be whatever you set as your original.
236236
port: 8080, // Must be different than the other configuration file.
237237
ipWhitelist: [], // Can be whatever you set as your original.
@@ -252,7 +252,7 @@ if (typeof module !== "undefined") {
252252
Configuration file 2 (config2.js):
253253
254254
```js
255-
var config = {
255+
let config = {
256256
electronOptions: { x: 1920 },
257257
address: "0.0.0.0", // can be whatever you set as your original.
258258
port: 8081, // Must be different than the other configuration file.
@@ -271,7 +271,7 @@ if (typeof module !== "undefined") {
271271
}
272272
```
273273
274-
##### config.js.template example:
274+
#### config.js.template example
275275
276276
User likes to help German language users in the forums. As such, he wants to be
277277
able to paste bits of his config.js into the forums to show as an example, but

Diff for: cspell.config.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"words": [
5+
"anyfileorfolder",
6+
"apikey",
7+
"clientonly",
8+
"iconset",
9+
"infobars",
10+
"LXDE",
11+
"lxpanel",
12+
"lxsession",
13+
"magicmirror",
14+
"MAPBOX",
15+
"meteo",
16+
"modulename",
17+
"newsfeed",
18+
"nohup",
19+
"päästä",
20+
"Päättyy",
21+
"pcmanfm",
22+
"sdetweil",
23+
"serveronly",
24+
"Slutar",
25+
"STRAVA",
26+
"Subclassable",
27+
"subclassing",
28+
"Teeuw",
29+
"Termine",
30+
"weatherutils",
31+
"xscreensaver",
32+
"yourprovider"
33+
],
34+
"ignorePaths": [
35+
"node_modules/**",
36+
"modules/**",
37+
"vendor/node_modules/**",
38+
"translations/**",
39+
"tests/mocks/**",
40+
"tests/e2e/modules/clock_es_spec.js",
41+
"fonts/roboto.css"
42+
],
43+
"dictionaries": ["node"]
44+
}

Diff for: development/core-module-file.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Module.register("helloworld", {
2222

2323
// Override dom generator.
2424
getDom: function () {
25-
var wrapper = document.createElement("div");
25+
const wrapper = document.createElement("div");
2626
wrapper.innerHTML = this.config.text;
2727
return wrapper;
2828
},
@@ -136,7 +136,7 @@ getScripts: function() {
136136
return [
137137
'script.js', // will try to load it from the vendor folder, otherwise it will load is from the module folder.
138138
'moment.js', // this file is available in the vendor folder, so it doesn't need to be available in the module folder.
139-
this.file('anotherfile.js'), // this file will be loaded straight from the module folder.
139+
this.file('another_file.js'), // this file will be loaded straight from the module folder.
140140
'https://code.jquery.com/jquery-2.2.3.min.js', // this file will be loaded from the jquery servers.
141141
]
142142
}
@@ -163,8 +163,8 @@ getStyles: function() {
163163
return [
164164
'script.css', // will try to load it from the vendor folder, otherwise it will load is from the module folder.
165165
'font-awesome.css', // this file is available in the vendor folder, so it doesn't need to be available in the module folder.
166-
this.file('anotherfile.css'), // this file will be loaded straight from the module folder.
167-
'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', // this file will be loaded from the bootstrapcdn servers.
166+
this.file('another_file.css'), // this file will be loaded straight from the module folder.
167+
'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css', // this file will be loaded from the bootstrap cdn servers.
168168
]
169169
}
170170

@@ -209,7 +209,7 @@ object.
209209

210210
```javascript
211211
getDom: function() {
212-
var wrapper = document.createElement("div");
212+
const wrapper = document.createElement("div");
213213
wrapper.innerHTML = 'Hello world!';
214214
return wrapper;
215215
}
@@ -343,7 +343,7 @@ As an example: the clock modules calls this method every second:
343343
```javascript
344344
...
345345
start: function() {
346-
var self = this;
346+
let self = this;
347347
setInterval(function() {
348348
self.updateDom(); // no speed defined, so it updates instantly.
349349
}, 1000); //perform every 1000 milliseconds.
@@ -376,7 +376,7 @@ As an example:
376376
speed: 1000, // animation duration
377377
animate: {
378378
in: "backInDown", // animation when module shown (after update)
379-
out: "backOutUp" // animatation when module will hide (before update)
379+
out: "backOutUp" // animation when module will hide (before update)
380380
}
381381
}
382382
})
@@ -398,7 +398,7 @@ the sendNotification method.
398398
**Example:**
399399

400400
```javascript
401-
this.sendNotification("MYMODULE_READY_FOR_ACTION", { foo: bar });
401+
this.sendNotification("MY_MODULE_READY_FOR_ACTION", { foo: bar });
402402
```
403403

404404
### `this.sendSocketNotification(notification, payload)`
@@ -434,7 +434,7 @@ you can also hide another module using `anOtherModule.hide()`.
434434
Possible configurable options:
435435

436436
- `lockString` - String - When setting lock string, the module can not be shown
437-
without passing the correct lockstring. This way (multiple) modules can
437+
without passing the correct lock string. This way (multiple) modules can
438438
prevent a module from showing. It's considered best practice to use your
439439
modules identifier as the locksString: `this.identifier`. See _visibility
440440
locking_ below.
@@ -473,7 +473,7 @@ you can also show another module using `anOtherModule.show()`.
473473
Possible configurable options:
474474

475475
- `lockString` - String - When setting lock string, the module can not be shown
476-
without passing the correct lockstring. This way (multiple) modules can
476+
without passing the correct lock string. This way (multiple) modules can
477477
prevent a module from showing. See _visibility locking_ below.
478478
- `force` - Boolean - When setting the force tag to `true`, the locking
479479
mechanism will be overwritten. Use this option with caution. It's considered
@@ -568,7 +568,7 @@ moduleA.hidden == false;
568568
moduleA.show(0, { force: true });
569569
```
570570

571-
This will reset the lockstring array, and will show the module.
571+
This will reset the lockStrings array, and will show the module.
572572

573573
```javascript
574574
moduleA.lockStrings == [];
@@ -635,7 +635,7 @@ translator to change the word order in the sentence to be translated.
635635
**Example:**
636636

637637
```javascript
638-
var timeUntilEnd = moment(event.endDate, "x").fromNow(true);
638+
const timeUntilEnd = moment(event.endDate, "x").fromNow(true);
639639
this.translate("RUNNING", { "timeUntilEnd": timeUntilEnd) }); // Will return a translated string for the identifier RUNNING, replacing `{timeUntilEnd}` with the contents of the variable `timeUntilEnd` in the order that translator intended.
640640
```
641641

@@ -663,7 +663,7 @@ did not support the word order, it is recommended to have the fallback layout.
663663
**Example:**
664664

665665
```javascript
666-
var timeUntilEnd = moment(event.endDate, "x").fromNow(true);
666+
const timeUntilEnd = moment(event.endDate, "x").fromNow(true);
667667
this.translate("RUNNING", {
668668
"fallback": this.translate("RUNNING") + " {timeUntilEnd}"
669669
"timeUntilEnd": timeUntilEnd

Diff for: development/helper-methods.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ the `withClass(classname)` method can be an array, or space separated string.
3434
**Examples:**
3535

3636
```javascript
37-
var modules = MM.getModules().withClass("classname");
38-
var modules = MM.getModules().withClass("classname1 classname2");
39-
var modules = MM.getModules().withClass(["classname1", "classname2"]);
37+
let modules = MM.getModules().withClass("classname");
38+
let modules = MM.getModules().withClass("classname1 classname2");
39+
let modules = MM.getModules().withClass(["classname1", "classname2"]);
4040
```
4141

4242
#### `.exceptWithClass(classnames)`
@@ -52,9 +52,9 @@ string.
5252
**Examples:**
5353

5454
```javascript
55-
var modules = MM.getModules().exceptWithClass("classname");
56-
var modules = MM.getModules().exceptWithClass("classname1 classname2");
57-
var modules = MM.getModules().exceptWithClass(["classname1", "classname2"]);
55+
let modules = MM.getModules().exceptWithClass("classname");
56+
let modules = MM.getModules().exceptWithClass("classname1 classname2");
57+
let modules = MM.getModules().exceptWithClass(["classname1", "classname2"]);
5858
```
5959

6060
#### `.exceptModule(module)`
@@ -70,17 +70,17 @@ the instance of your module.
7070
**Examples:**
7171

7272
```javascript
73-
var modules = MM.getModules().exceptModule(this);
73+
let modules = MM.getModules().exceptModule(this);
7474
```
7575

7676
Of course, you can combine all of the above filters:
7777

7878
**Example:**
7979

8080
```javascript
81-
var modules = MM.getModules()
81+
let modules = MM.getModules()
8282
.withClass("classname1")
83-
.exceptwithClass("classname2")
83+
.exceptWithClass("classname2")
8484
.exceptModule(aModule);
8585
```
8686

Diff for: development/node-helper.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ this.sendSocketNotification("SET_CONFIG", this.config);
164164
```
165165

166166
::: warning Reminder
167-
`sendSocketNotification` sends a notification from the helper to all the instances of your module.
167+
168+
`sendSocketNotification` sends a notification from the helper to all the
169+
instances of your module.
170+
168171
:::
169172

170173
## Using native node modules in your node_helper

Diff for: development/notifications.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ These notifications are sent by the default modules:
3737
| `ARTICLE_PREVIOUS` | _none_ | Shows the previous news title in [newsfeed module](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/modules/default/newsfeed). |
3838
| `ARTICLE_MORE_DETAILS` | _none_ | Shows more details in [newsfeed module](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/modules/default/newsfeed). |
3939
| `ARTICLE_LESS_DETAILS` | _none_ | Hides the summary or full news article and only displays the news title of the currently viewed news item in [newsfeed module](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/modules/default/newsfeed). |
40-
| `ARTICLE_TOGGLE_FULL` | _none_ | Toogles article in fullscreen in [newsfeed module](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/modules/default/newsfeed). |
40+
| `ARTICLE_TOGGLE_FULL` | _none_ | Toggles article in fullscreen in [newsfeed module](https://github.com/MagicMirrorOrg/MagicMirror/tree/master/modules/default/newsfeed). |
4141

4242
# 3rd Party Module notifications
4343

0 commit comments

Comments
 (0)