Skip to content

Commit 03e1c1a

Browse files
committed
Add markdown linting rules
1 parent 82f52d4 commit 03e1c1a

File tree

4 files changed

+143
-11
lines changed

4 files changed

+143
-11
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ Add this to the ESLint configuration file:
2020
}
2121
```
2222

23-
Additional rule sets are available: `bloq/node`, `bloq/next` and `bloq/mocha`.
23+
Additional rule sets are available:
2424

25-
## Note on code formatting
25+
- `bloq/jsdoc`
26+
- `bloq/markdown`
27+
- `bloq/mocha`
28+
- `bloq/next`
29+
- `bloq/node`
2630

27-
This package is focused on identifying code patterns that are or lead to common errors.
28-
It is not intended to deal with code formatting and coding styles (even when a few rules may still be enabled).
31+
## Note on code formatting
2932

30-
## License
33+
The base rules are focused in identifying code patterns that are or could lead to common errors.
34+
Enforcing code styles should be mainly done with tools like [Prettier](https://prettier.io), adding it to the end of any `extends` array to ensure the conflicting rules are deactivated:
3135

32-
MIT
36+
```json
37+
{
38+
"extends": ["bloq", "bloq/node", "prettier"]
39+
}
40+
```

markdown.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict'
2+
3+
module.exports = {
4+
extends: ['plugin:markdownlint/recommended'],
5+
parser: 'eslint-plugin-markdownlint/parser',
6+
rules: {
7+
'markdownlint/md013': 'off',
8+
'markdownlint/md034': 'warn'
9+
}
10+
}

package-lock.json

Lines changed: 97 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"eslint",
99
"eslintconfig",
1010
"lint",
11+
"markdown",
1112
"mocha",
12-
"next.js",
1313
"next",
14+
"next.js",
1415
"node"
1516
],
1617
"license": "MIT",
@@ -30,6 +31,7 @@
3031
"eslint-config-prettier": "^8.0.0",
3132
"eslint-plugin-import": "^2.0.0",
3233
"eslint-plugin-jsdoc": "^43.0.0",
34+
"eslint-plugin-markdownlint": "^0.6.0",
3335
"eslint-plugin-mocha": "^10.0.0",
3436
"eslint-plugin-node": "^11.0.0",
3537
"eslint-plugin-prefer-arrow": "^1.0.0",
@@ -41,12 +43,22 @@
4143
"lint-staged": "^13.0.0",
4244
"prettier": "^2.0.0"
4345
},
44-
"preferGlobal": false,
46+
"peerDependencies": {
47+
"eslint": "^8.0.0"
48+
},
4549
"private": false,
4650
"eslintConfig": {
4751
"extends": [
4852
"./index.js",
4953
"./node.js"
54+
],
55+
"overrides": [
56+
{
57+
"files": "*.md",
58+
"extends": [
59+
"./markdown.js"
60+
]
61+
}
5062
]
5163
},
5264
"husky": {
@@ -55,14 +67,19 @@
5567
}
5668
},
5769
"lint-staged": {
58-
"*.js": "eslint --cache --fix",
59-
"*.{css,js,json,md}": "prettier --write"
70+
"!*.{js,md}": [
71+
"prettier --ignore-unknown --write"
72+
],
73+
"*.{js,md}": [
74+
"eslint --cache --fix",
75+
"prettier --write"
76+
]
6077
},
78+
"preferGlobal": false,
6179
"prettier": {
6280
"quoteProps": "consistent",
6381
"semi": false,
6482
"singleQuote": true,
65-
"tabWidth": 2,
6683
"trailingComma": "none"
6784
}
6885
}

0 commit comments

Comments
 (0)