Skip to content

Commit 1adde79

Browse files
chore: optimize markdownlint and stylelint config and handle issues
1 parent 6a91390 commit 1adde79

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"line_length": false,
3+
"no-duplicate-heading": false,
34
"no-inline-html": false
45
}

guides/readme_bestpractices.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
This file contains suggested best practices for creating a README file for your MagicMirror² module.
1+
# Best Practices for README Files
22

3-
# Installation Instructions
3+
This file contains suggested best practices for creating a README file for your MagicMirror² module.
4+
5+
## Installation Instructions
46

57
Your README file should have an "Installation" section that includes a code block that can be pasted into a user's terminal to fully install your module. Here is a good example of an install code block:
68

7-
## Example if your module has no dependencies
9+
### Example if your module has no dependencies
810

9-
````
11+
````markdown
1012
```bash
1113
cd ~/MagicMirror/modules
1214
git clone https://github.com/MyUsername/MMM-MyModule
1315
```
1416
````
1517

16-
## Example if your module has dependencies
18+
### Example if your module has dependencies
1719

18-
````
20+
````markdown
1921
```bash
2022
cd ~/MagicMirror/modules
2123
git clone https://github.com/MyUsername/MMM-MyModule
@@ -24,22 +26,22 @@ npm ci --omit=dev
2426
```
2527
````
2628

27-
## Tips
29+
### Tips
2830

29-
* The code block should not be broken up into multiple separate blocks for each line of code so that users can copy and paste the entire block into their terminal and execute the install with one click.
30-
* The opening `` ``` `` of your code block should be followed by "`sh`" or "`bash`" so that the code block is styled as shell script.
31-
* If your module has required dependencies, `npm ci` is preferable to `npm install` in many circumstances because it will repeatably instruct users' machines not to recreate the `package-lock.json` file.
32-
* Adding `--omit=dev` to the `npm ci` or `npm install` command will instruct users' machines not to install developer dependencies that are unneeded by most users, which will save on install time and disk space.
31+
- The code block should not be broken up into multiple separate blocks for each line of code so that users can copy and paste the entire block into their terminal and execute the install with one click.
32+
- The opening ` ``` ` of your code block should be followed by "`sh`" or "`bash`" so that the code block is styled as shell script.
33+
- If your module has required dependencies, `npm ci` is preferable to `npm install` in many circumstances because it will repeatably instruct users' machines not to recreate the `package-lock.json` file.
34+
- Adding `--omit=dev` to the `npm ci` or `npm install` command will instruct users' machines not to install developer dependencies that are unneeded by most users, which will save on install time and disk space.
3335

34-
# Update Instructions
36+
## Update Instructions
3537

3638
Your README file should have an "Update" section that includes a code block that can be pasted into a user's terminal to update your module.
3739

38-
# Config Instructions
40+
## Config Instructions
3941

40-
Your README file should have a "Config" or "Configuration" section that includes an example config block that can be pasted into user's `config.js` files. Here is a good example of a config code block:
42+
Your README file should have a "Config" or "Configuration" section that includes an example config block that can be pasted into user's `config.js` files. Here is a good example of a config code block:
4143

42-
````
44+
````markdown
4345
```js
4446
{
4547
module: MMM-MyModule,
@@ -52,8 +54,8 @@ Your README file should have a "Config" or "Configuration" section that includes
5254
```
5355
````
5456

55-
## Tips
57+
### Tips
5658

57-
* The opening `` ``` `` of your code block should be followed by "`js`" or "`javascript`" so that the code block is styled as javasript.
58-
* The final `}` should be followed by a `,` so that the block can be copied and pasted straight into users' `config.js` files without throwing errors.
59-
* The example config should provide a minimal demo configuration that will get your module working if pasted directly into a user's `config.js` file.
59+
- The opening ` ``` ` of your code block should be followed by "`js`" or "`javascript`" so that the code block is styled as JavaScript.
60+
- The final `}` should be followed by a `,` so that the block can be copied and pasted straight into users' `config.js` files without throwing errors.
61+
- The example config should provide a minimal demo configuration that will get your module working if pasted directly into a user's `config.js` file.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"checkModulesJs": "node scripts/check_modules_js.js",
3535
"checkModules": "python3 scripts/check_modules.py",
3636
"ownList": "node create_own_module_list.js && npm run updateGitHubData && npm run getModules && npm run expandModuleList && npm run checkModulesJs && npm run checkModules",
37-
"lint": "eslint && stylelint **/docs/*.css && markdownlint-cli2 README.md && prettier --check . && cspell .",
38-
"lint:fix": "eslint --fix && stylelint **/docs/*.css --fix && markdownlint-cli2 README.md --fix && prettier . --write . && cspell .",
37+
"lint": "eslint && stylelint **/docs/*.css && markdownlint-cli2 . && prettier --check . && cspell .",
38+
"lint:fix": "eslint --fix && stylelint **/docs/*.css --fix && markdownlint-cli2 . --fix && prettier . --write . && cspell .",
3939
"prepare": "husky",
4040
"test": "npm run lint",
4141
"leaveMenu": "",
@@ -47,11 +47,11 @@
4747
"prettier --write --ignore-unknown"
4848
],
4949
"*.css": [
50-
"stylelint **/docs/*.css --ignore-pattern **/docs/fonts/ --fix",
50+
"stylelint --ignore-pattern **/docs/fonts/ --fix",
5151
"prettier --write"
5252
],
5353
"*.md": [
54-
"markdownlint --ignore node_modules --fix",
54+
"markdownlint-cli2 --fix",
5555
"prettier --write"
5656
]
5757
},

0 commit comments

Comments
 (0)