Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Dogfood plugin by linting readme #145

Merged
merged 1 commit into from
Apr 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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