diff --git a/.eslintrc.js b/.eslintrc.js index c94813be..c4997b83 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,13 @@ module.exports = { PACKAGE_NAME ], + "overrides": [ + { + "files": ["*.md"], + "processor": "markdown/markdown" + } + ], + "env": { "node": true }, diff --git a/README.md b/README.md index 3ff9b3dc..f29f8ce7 100644 --- a/README.md +++ b/README.md @@ -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. + + + ```js // .eslintrc.json { @@ -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: + + + ```js // .eslintrc.json { diff --git a/package.json b/package.json index 9dd64767..6ac980f5 100644 --- a/package.json +++ b/package.json @@ -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",