Skip to content

Commit b221391

Browse files
authored
Docs: Dogfood plugin by linting readme (#145)
1 parent 7423610 commit b221391

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Diff for: .eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ module.exports = {
2222
PACKAGE_NAME
2323
],
2424

25+
"overrides": [
26+
{
27+
"files": ["*.md"],
28+
"processor": "markdown/markdown"
29+
}
30+
],
31+
2532
"env": {
2633
"node": true
2734
},

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ for code snippets. It also points to the fact that some rules
172172
one may wish for documentation to be more liberal in providing padding for
173173
readability.
174174

175+
<!-- This is actually JSON, but using JS lets it include comments. -->
176+
<!-- eslint-skip -->
177+
175178
```js
176179
// .eslintrc.json
177180
{
@@ -192,6 +195,9 @@ readability.
192195

193196
The `strict` rule is technically satisfiable inside of Markdown code blocks, but writing a `"use strict"` directive at the top of every code block is tedious and distracting. We recommend a glob pattern for `.md` files to disable `strict` and enable the `impliedStrict` [parser option](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) so the code blocks still parse in strict mode:
194197

198+
<!-- This is actually JSON, but using JS lets it include comments. -->
199+
<!-- eslint-skip -->
200+
195201
```js
196202
// .eslintrc.json
197203
{

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"linter"
2121
],
2222
"scripts": {
23-
"lint": "eslint .",
23+
"lint": "eslint --ext js,md .",
2424
"test": "npm run lint && npm run test-cov",
2525
"test-cov": "nyc _mocha -- -c tests/lib/**/*.js",
2626
"generate-release": "eslint-generate-release",

0 commit comments

Comments
 (0)