Skip to content

Commit 5b0ce68

Browse files
authored
Build: Add markdownlint for doc formatting (eslint-community#130)
* chore(dev-deps): add markdownlint for doc formatting * docs: fix header
1 parent 1368388 commit 5b0ce68

9 files changed

+20
-13
lines changed

.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"line-length": false
3+
}

.markdownlintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHANGELOG.md
2+
LICENSE.md
3+
node_modules

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ An ESLint plugin for linting ESLint plugins
66

77
You'll first need to install [ESLint](https://eslint.org):
88

9-
```
10-
$ npm i eslint --save-dev
9+
```sh
10+
npm i eslint --save-dev
1111
```
1212

1313
Next, install `eslint-plugin-eslint-plugin`:
1414

15-
```
16-
$ npm install eslint-plugin-eslint-plugin --save-dev
15+
```sh
16+
npm install eslint-plugin-eslint-plugin --save-dev
1717
```
1818

1919
## Usage
@@ -28,7 +28,6 @@ Add `eslint-plugin` to the plugins section of your `.eslintrc` configuration fil
2828
}
2929
```
3030

31-
3231
Then configure the rules you want to use under the rules section.
3332

3433
```json

docs/rules/no-deprecated-report-api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module.exports = {
3737
};
3838
```
3939

40-
4140
## Further Reading
4241

4342
* [Deprecated rule API](http://eslint.org/docs/developer-guide/working-with-rules-deprecated)

docs/rules/no-missing-placeholders.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ context.report({
1414

1515
However, if no `data` argument is provided, or no matching replacement key exists in the `data` argument, the raw curly brackets will end up in the report message. This is usually a mistake.
1616

17-
1817
## Rule Details
1918

2019
This rule aims to disallow missing placeholders in rule report messages.
@@ -67,7 +66,6 @@ module.exports = {
6766

6867
```
6968

70-
7169
## When Not To Use It
7270

7371
If you want to use rule messages that actually contain double-curly bracket text, you should turn off this rule.

docs/rules/require-meta-docs-description.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Defining a clear and consistent description for each rule helps developers understand what they're used for.
44

55
In particular, each rule description should begin with an allowed prefix:
6+
67
* `enforce`
78
* `require`
89
* `disallow`
@@ -40,7 +41,7 @@ module.exports = {
4041

4142
This rule takes an optional object containing:
4243

43-
- `String``pattern` — A regular expression that the description must match. Use `'.+'` to allow anything. Defaults to `^(enforce|require|disallow)`.
44+
* `String``pattern` — A regular expression that the description must match. Use `'.+'` to allow anything. Defaults to `^(enforce|require|disallow)`.
4445

4546
## Further Reading
4647

docs/rules/require-meta-docs-url.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Then `npm version <type>` command will update every rule to the new version's UR
142142

143143
> npm runs `preversion` script on the current version, runs `version` script on the new version, and commits and makes a tag.
144144
>
145-
> Further reading: https://docs.npmjs.com/cli/version
145+
> Further reading: <https://docs.npmjs.com/cli/version>
146146
147147
## When Not To Use It
148148

docs/rules/test-case-shorthand-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ ruleTester.run('example-rule', rule, {
169169
});
170170
```
171171

172-
#### `never`
172+
#### `consistent-as-needed`
173173

174174
Examples of **incorrect** code for this rule with the `consistent-as-needed` option:
175175

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"main": "lib/index.js",
77
"license": "MIT",
88
"scripts": {
9-
"lint": "eslint . --ignore-pattern \"!.*\"",
9+
"lint": "npm-run-all --continue-on-error --aggregate-output --parallel lint:*",
10+
"lint:docs": "markdownlint **/*.md",
11+
"lint:js": "eslint . --ignore-pattern \"!.*\"",
1012
"generate-readme-table": "node build/generate-readme-table.js",
1113
"generate-release": "node-release-script",
1214
"test": "mocha tests --recursive"
@@ -42,7 +44,9 @@
4244
"espree": "^7.3.0",
4345
"estraverse": "^5.0.0",
4446
"lodash": "^4.17.2",
45-
"mocha": "^7.1.1"
47+
"markdownlint-cli": "^0.27.1",
48+
"mocha": "^7.1.1",
49+
"npm-run-all": "^4.1.5"
4650
},
4751
"peerDependencies": {
4852
"eslint": "^7.0.0"

0 commit comments

Comments
 (0)