Skip to content

Commit

Permalink
Docs: Dogfood plugin by linting readme (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
btmills authored Apr 5, 2020
1 parent 7423610 commit b221391
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ module.exports = {
PACKAGE_NAME
],

"overrides": [
{
"files": ["*.md"],
"processor": "markdown/markdown"
}
],

"env": {
"node": true
},
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ for code snippets. It also points to the fact that some rules
one may wish for documentation to be more liberal in providing padding for
readability.

<!-- This is actually JSON, but using JS lets it include comments. -->
<!-- eslint-skip -->

```js
// .eslintrc.json
{
Expand All @@ -192,6 +195,9 @@ readability.

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:

<!-- This is actually JSON, but using JS lets it include comments. -->
<!-- eslint-skip -->

```js
// .eslintrc.json
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"linter"
],
"scripts": {
"lint": "eslint .",
"lint": "eslint --ext js,md .",
"test": "npm run lint && npm run test-cov",
"test-cov": "nyc _mocha -- -c tests/lib/**/*.js",
"generate-release": "eslint-generate-release",
Expand Down

0 comments on commit b221391

Please sign in to comment.