summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2019-02-27 22:32:31 -0800
committerRich Trott <rtrott@gmail.com>2019-03-01 22:55:28 -0800
commitf11e8b959dce355bbb21fa2f95108732db464897 (patch)
treefbb6a56d2e138bfcf1531e0abf2d09166b87dcdd /tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md
parente0c39218d988acc3e9fdd61829118ae5aa33e9a0 (diff)
downloadandroid-node-v8-f11e8b959dce355bbb21fa2f95108732db464897.tar.gz
android-node-v8-f11e8b959dce355bbb21fa2f95108732db464897.tar.bz2
android-node-v8-f11e8b959dce355bbb21fa2f95108732db464897.zip
tools: update eslint-plugin-markdown to 1.0.0
For eslint-plugin-markdown, we had been using an RC but can now use the most recent stable release of 1.0.0, as it has the bugfix that caused us to start using the RC in the first place. There are a few other updates in this commit too because it was performed by running `update-eslint.sh`. This did not update ESLint itself but did update some dependencies. PR-URL: https://github.com/nodejs/node/pull/26345 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md')
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md53
1 files changed, 51 insertions, 2 deletions
diff --git a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md
index d096ef57a8..aa5e2b8ff7 100644
--- a/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md
+++ b/tools/node_modules/eslint/node_modules/eslint-plugin-markdown/README.md
@@ -137,9 +137,44 @@ Since code blocks are not files themselves but embedded inside a Markdown docume
- `eol-last`
- `unicode-bom`
-### Strict
+### Project or directory-wide overrides for code snippets
-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 using a [glob pattern override](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) 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:
+Given that code snippets often lack full context, and adding full context
+through configuration comments may be too cumbersome to apply for each snippet,
+one may wish to instead set defaults for all one's JavaScript snippets in a
+manner that applies to all Markdown files within your project (or a specific
+directory).
+
+ESLint allows a configuration property `overrides` which has a `files`
+property which accepts a
+[glob pattern](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns), allowing you to designate files (such as all `md` files) whose rules will
+be overridden.
+
+The following example shows the disabling of a few commonly problematic rules
+for code snippets. It also points to the fact that some rules
+(e.g., `padded-blocks`) may be more appealing for disabling given that
+one may wish for documentation to be more liberal in providing padding for
+readability.
+
+```js
+// .eslintrc.json
+{
+ // ...
+ "overrides": [{
+ "files": ["**/*.md"],
+ "rules": {
+ "no-undef": "off",
+ "no-unused-vars": "off",
+ "no-console": "off",
+ "padded-blocks": "off"
+ }
+ }]
+}
+```
+
+#### Overriding `strict`
+
+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
@@ -159,6 +194,20 @@ The `strict` rule is technically satisfiable inside of Markdown code blocks, but
}
```
+## Tips for use with Atom linter-eslint
+
+The [linter-eslint](https://atom.io/packages/linter-eslint) package allows for
+linting within the [Atom IDE](https://atom.io/).
+
+In order to see `eslint-plugin-markdown` work its magic within Markdown code
+blocks in your Atom editor, you can go to `linter-eslint`'s settings and
+within "List of scopes to run ESLint on...", add the cursor scope "source.gfm".
+
+However, this reports a problem when viewing Markdown which does not have
+configuration, so you may wish to use the cursor scope "source.embedded.js",
+but note that `eslint-plugin-markdown` configuration comments and skip
+directives won't work in this context.
+
## Contributing
```sh