Skip to content
Permalink
Browse files

doc: add eslint-plugin-markdown

* install eslint-plugin-markdown
* add doc/.eslintrc.yaml
* add `<!-- eslint-disable rule -->` or `<!-- eslint-disable -->`
  for the rest of problematic code
* .js files in doc folder added to .eslintignore
* update Makefile and vcbuild.bat

PR-URL: #12563
Refs: #12557 (comment)
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
  • Loading branch information...
vsemozhetbyt committed Apr 21, 2017
1 parent e2c3e47 commit b4fea2a3d62da5e2e3f90d7f2109f02f927f7174
Showing with 34,509 additions and 33 deletions.
  1. +1 −0 .eslintignore
  2. +3 −0 .eslintrc.yaml
  3. +2 −2 Makefile
  4. +5 −0 doc/.eslintrc.yaml
  5. +1 −0 doc/api/assert.md
  6. +5 −8 doc/api/cluster.md
  7. +3 −2 doc/api/console.md
  8. +2 −2 doc/api/crypto.md
  9. +1 −0 doc/api/debugger.md
  10. +3 −0 doc/api/dns.md
  11. +1 −1 doc/api/fs.md
  12. +3 −0 doc/api/http.md
  13. +2 −5 doc/api/modules.md
  14. +2 −0 doc/api/os.md
  15. +9 −1 doc/api/process.md
  16. +1 −0 doc/api/querystring.md
  17. +1 −1 doc/api/readline.md
  18. +7 −0 doc/api/repl.md
  19. +1 −1 doc/api/stream.md
  20. +1 −0 doc/api/v8.md
  21. +3 −7 doc/api/zlib.md
  22. +1 −0 test/README.md
  23. +15 −0 tools/eslint/node_modules/.bin/remark
  24. +7 −0 tools/eslint/node_modules/.bin/remark.cmd
  25. +22 −0 tools/eslint/node_modules/bail/LICENSE
  26. +12 −0 tools/eslint/node_modules/bail/history.md
  27. +34 −0 tools/eslint/node_modules/bail/index.js
  28. +138 −0 tools/eslint/node_modules/bail/package.json
  29. +73 −0 tools/eslint/node_modules/bail/readme.md
  30. +22 −0 tools/eslint/node_modules/ccount/LICENSE
  31. +11 −0 tools/eslint/node_modules/ccount/history.md
  32. +46 −0 tools/eslint/node_modules/ccount/index.js
  33. +136 −0 tools/eslint/node_modules/ccount/package.json
  34. +57 −0 tools/eslint/node_modules/ccount/readme.md
  35. +22 −0 tools/eslint/node_modules/character-entities-html4/LICENSE
  36. +254 −0 tools/eslint/node_modules/character-entities-html4/index.json
  37. +133 −0 tools/eslint/node_modules/character-entities-html4/package.json
  38. +52 −0 tools/eslint/node_modules/character-entities-html4/readme.md
  39. +22 −0 tools/eslint/node_modules/character-entities-legacy/LICENSE
  40. +108 −0 tools/eslint/node_modules/character-entities-legacy/index.json
  41. +133 −0 tools/eslint/node_modules/character-entities-legacy/package.json
  42. +54 −0 tools/eslint/node_modules/character-entities-legacy/readme.md
  43. +22 −0 tools/eslint/node_modules/character-entities/LICENSE
  44. +2,224 −0 tools/eslint/node_modules/character-entities/index.json
  45. +132 −0 tools/eslint/node_modules/character-entities/package.json
  46. +53 −0 tools/eslint/node_modules/character-entities/readme.md
  47. +22 −0 tools/eslint/node_modules/character-reference-invalid/LICENSE
  48. +30 −0 tools/eslint/node_modules/character-reference-invalid/index.json
  49. +136 −0 tools/eslint/node_modules/character-reference-invalid/package.json
  50. +51 −0 tools/eslint/node_modules/character-reference-invalid/readme.md
  51. +22 −0 tools/eslint/node_modules/collapse-white-space/LICENSE
  52. +16 −0 tools/eslint/node_modules/collapse-white-space/history.md
  53. +27 −0 tools/eslint/node_modules/collapse-white-space/index.js
  54. +136 −0 tools/eslint/node_modules/collapse-white-space/package.json
  55. +67 −0 tools/eslint/node_modules/collapse-white-space/readme.md
  56. +21 −0 tools/eslint/node_modules/eslint-plugin-markdown/LICENSE
  57. +121 −0 tools/eslint/node_modules/eslint-plugin-markdown/README.md
  58. +8 −0 tools/eslint/node_modules/eslint-plugin-markdown/index.js
  59. +17 −0 tools/eslint/node_modules/eslint-plugin-markdown/lib/index.js
  60. +151 −0 tools/eslint/node_modules/eslint-plugin-markdown/lib/processor.js
  61. +106 −0 tools/eslint/node_modules/eslint-plugin-markdown/package.json
  62. +192 −0 tools/eslint/node_modules/extend/.eslintrc
  63. +103 −0 tools/eslint/node_modules/extend/.jscs.json
  64. +1 −0 tools/eslint/node_modules/extend/.npmignore
  65. +44 −0 tools/eslint/node_modules/extend/.travis.yml
  66. +68 −0 tools/eslint/node_modules/extend/CHANGELOG.md
  67. +22 −0 tools/eslint/node_modules/extend/LICENSE
  68. +61 −0 tools/eslint/node_modules/extend/README.md
  69. +31 −0 tools/eslint/node_modules/extend/component.json
  70. +85 −0 tools/eslint/node_modules/extend/index.js
  71. +108 −0 tools/eslint/node_modules/extend/package.json
  72. +13 −0 tools/eslint/node_modules/function-bind/.eslintrc
  73. +158 −0 tools/eslint/node_modules/function-bind/.jscs.json
  74. +16 −0 tools/eslint/node_modules/function-bind/.npmignore
  75. +77 −0 tools/eslint/node_modules/function-bind/.travis.yml
  76. +19 −0 tools/eslint/node_modules/function-bind/LICENSE
  77. +48 −0 tools/eslint/node_modules/function-bind/README.md
  78. +48 −0 tools/eslint/node_modules/function-bind/implementation.js
  79. +3 −0 tools/eslint/node_modules/function-bind/index.js
  80. +137 −0 tools/eslint/node_modules/function-bind/package.json
  81. +250 −0 tools/eslint/node_modules/function-bind/test/index.js
  82. +14 −0 tools/eslint/node_modules/has/.jshintrc
  83. +3 −0 tools/eslint/node_modules/has/.npmignore
  84. +22 −0 tools/eslint/node_modules/has/LICENSE-MIT
  85. +18 −0 tools/eslint/node_modules/has/README.mkd
  86. +95 −0 tools/eslint/node_modules/has/package.json
  87. +3 −0 tools/eslint/node_modules/has/src/index.js
  88. +7 −0 tools/eslint/node_modules/has/test/.jshintrc
  89. +10 −0 tools/eslint/node_modules/has/test/index.js
  90. +22 −0 tools/eslint/node_modules/is-alphabetical/LICENSE
  91. +6 −0 tools/eslint/node_modules/is-alphabetical/history.md
  92. +29 −0 tools/eslint/node_modules/is-alphabetical/index.js
  93. +144 −0 tools/eslint/node_modules/is-alphabetical/package.json
  94. +58 −0 tools/eslint/node_modules/is-alphabetical/readme.md
  95. +22 −0 tools/eslint/node_modules/is-alphanumerical/LICENSE
  96. +6 −0 tools/eslint/node_modules/is-alphanumerical/history.md
  97. +29 −0 tools/eslint/node_modules/is-alphanumerical/index.js
  98. +150 −0 tools/eslint/node_modules/is-alphanumerical/package.json
  99. +60 −0 tools/eslint/node_modules/is-alphanumerical/readme.md
  100. +22 −0 tools/eslint/node_modules/is-decimal/LICENSE
  101. +6 −0 tools/eslint/node_modules/is-decimal/history.md
  102. +28 −0 tools/eslint/node_modules/is-decimal/index.js
  103. +145 −0 tools/eslint/node_modules/is-decimal/package.json
  104. +58 −0 tools/eslint/node_modules/is-decimal/readme.md
  105. +22 −0 tools/eslint/node_modules/is-hexadecimal/LICENSE
  106. +6 −0 tools/eslint/node_modules/is-hexadecimal/history.md
  107. +30 −0 tools/eslint/node_modules/is-hexadecimal/index.js
  108. +145 −0 tools/eslint/node_modules/is-hexadecimal/package.json
  109. +58 −0 tools/eslint/node_modules/is-hexadecimal/readme.md
  110. +22 −0 tools/eslint/node_modules/longest-streak/LICENSE
  111. +9 −0 tools/eslint/node_modules/longest-streak/history.md
  112. +51 −0 tools/eslint/node_modules/longest-streak/index.js
  113. +115 −0 tools/eslint/node_modules/longest-streak/package.json
  114. +52 −0 tools/eslint/node_modules/longest-streak/readme.md
  115. +63 −0 tools/eslint/node_modules/markdown-table/History.md
  116. +22 −0 tools/eslint/node_modules/markdown-table/LICENSE
  117. +132 −0 tools/eslint/node_modules/markdown-table/Readme.md
  118. +284 −0 tools/eslint/node_modules/markdown-table/index.js
  119. +104 −0 tools/eslint/node_modules/markdown-table/package.json
  120. +22 −0 tools/eslint/node_modules/parse-entities/LICENSE
  121. +23 −0 tools/eslint/node_modules/parse-entities/history.md
  122. +519 −0 tools/eslint/node_modules/parse-entities/index.js
  123. +167 −0 tools/eslint/node_modules/parse-entities/package.json
  124. +157 −0 tools/eslint/node_modules/parse-entities/readme.md
  125. +19 −0 tools/eslint/node_modules/parse5/LICENSE
  126. +40 −0 tools/eslint/node_modules/parse5/README.md
  127. +137 −0 tools/eslint/node_modules/parse5/lib/common/doctype.js
  128. +260 −0 tools/eslint/node_modules/parse5/lib/common/foreign_content.js
  129. +266 −0 tools/eslint/node_modules/parse5/lib/common/html.js
  130. +13 −0 tools/eslint/node_modules/parse5/lib/common/merge_options.js
  131. +47 −0 tools/eslint/node_modules/parse5/lib/common/unicode.js
  132. +108 −0 tools/eslint/node_modules/parse5/lib/index.js
  133. +216 −0 tools/eslint/node_modules/parse5/lib/location_info/parser_mixin.js
  134. +169 −0 tools/eslint/node_modules/parse5/lib/location_info/tokenizer_mixin.js
  135. +167 −0 tools/eslint/node_modules/parse5/lib/parser/formatting_element_list.js
  136. +2,817 −0 tools/eslint/node_modules/parse5/lib/parser/index.js
  137. +395 −0 tools/eslint/node_modules/parse5/lib/parser/open_element_stack.js
  138. +139 −0 tools/eslint/node_modules/parse5/lib/parser/stream.js
  139. +14 −0 tools/eslint/node_modules/parse5/lib/sax/dev_null_stream.js
  140. +230 −0 tools/eslint/node_modules/parse5/lib/sax/index.js
  141. +153 −0 tools/eslint/node_modules/parse5/lib/sax/parser_feedback_simulator.js
  142. +180 −0 tools/eslint/node_modules/parse5/lib/serializer/index.js
  143. +49 −0 tools/eslint/node_modules/parse5/lib/serializer/stream.js
  144. +2,101 −0 tools/eslint/node_modules/parse5/lib/tokenizer/index.js
  145. +6 −0 tools/eslint/node_modules/parse5/lib/tokenizer/named_entity_trie.js
  146. +154 −0 tools/eslint/node_modules/parse5/lib/tokenizer/preprocessor.js
  147. +578 −0 tools/eslint/node_modules/parse5/lib/tree_adapters/default.js
  148. +327 −0 tools/eslint/node_modules/parse5/lib/tree_adapters/htmlparser2.js
  149. +149 −0 tools/eslint/node_modules/parse5/package.json
  150. +30 −0 tools/eslint/node_modules/remark-parse/index.js
  151. +52 −0 tools/eslint/node_modules/remark-parse/lib/block-elements.json
  152. +21 −0 tools/eslint/node_modules/remark-parse/lib/defaults.js
  153. +75 −0 tools/eslint/node_modules/remark-parse/lib/escapes.json
  154. +6,318 −0 tools/eslint/node_modules/remark-parse/lib/parser.js
  155. +117 −0 tools/eslint/node_modules/remark-parse/package.json
  156. +436 −0 tools/eslint/node_modules/remark-parse/readme.md
  157. +30 −0 tools/eslint/node_modules/remark-stringify/index.js
  158. +2,629 −0 tools/eslint/node_modules/remark-stringify/lib/compiler.js
  159. +32 −0 tools/eslint/node_modules/remark-stringify/lib/defaults.js
  160. +116 −0 tools/eslint/node_modules/remark-stringify/package.json
  161. +209 −0 tools/eslint/node_modules/remark-stringify/readme.md
  162. +11 −0 tools/eslint/node_modules/remark/cli.js
  163. +19 −0 tools/eslint/node_modules/remark/index.js
  164. +112 −0 tools/eslint/node_modules/remark/package.json
  165. +84 −0 tools/eslint/node_modules/remark/readme.md
  166. +21 −0 tools/eslint/node_modules/repeat-string/LICENSE
  167. +136 −0 tools/eslint/node_modules/repeat-string/README.md
  168. +70 −0 tools/eslint/node_modules/repeat-string/index.js
  169. +169 −0 tools/eslint/node_modules/repeat-string/package.json
  170. +22 −0 tools/eslint/node_modules/stringify-entities/LICENSE
  171. +10 −0 tools/eslint/node_modules/stringify-entities/dangerous.json
  172. +131 −0 tools/eslint/node_modules/stringify-entities/index.js
  173. +151 −0 tools/eslint/node_modules/stringify-entities/package.json
  174. +118 −0 tools/eslint/node_modules/stringify-entities/readme.md
  175. +22 −0 tools/eslint/node_modules/trim-trailing-lines/LICENSE
  176. +15 −0 tools/eslint/node_modules/trim-trailing-lines/index.js
  177. +131 −0 tools/eslint/node_modules/trim-trailing-lines/package.json
  178. +55 −0 tools/eslint/node_modules/trim-trailing-lines/readme.md
  179. +4 −0 tools/eslint/node_modules/trim/.npmignore
  180. +5 −0 tools/eslint/node_modules/trim/History.md
  181. +7 −0 tools/eslint/node_modules/trim/Makefile
  182. +69 −0 tools/eslint/node_modules/trim/Readme.md
  183. +7 −0 tools/eslint/node_modules/trim/component.json
  184. +14 −0 tools/eslint/node_modules/trim/index.js
  185. +79 −0 tools/eslint/node_modules/trim/package.json
  186. +21 −0 tools/eslint/node_modules/trough/LICENSE
  187. +6 −0 tools/eslint/node_modules/trough/history.md
  188. +176 −0 tools/eslint/node_modules/trough/index.js
  189. +157 −0 tools/eslint/node_modules/trough/package.json
  190. +281 −0 tools/eslint/node_modules/trough/readme.md
  191. +21 −0 tools/eslint/node_modules/unherit/LICENSE
  192. +67 −0 tools/eslint/node_modules/unherit/index.js
  193. +145 −0 tools/eslint/node_modules/unherit/package.json
  194. +66 −0 tools/eslint/node_modules/unherit/readme.md
  195. +21 −0 tools/eslint/node_modules/unified/LICENSE
  196. +85 −0 tools/eslint/node_modules/unified/history.md
  197. +637 −0 tools/eslint/node_modules/unified/index.js
  198. +173 −0 tools/eslint/node_modules/unified/package.json
  199. +708 −0 tools/eslint/node_modules/unified/readme.md
  200. +22 −0 tools/eslint/node_modules/unist-util-remove-position/LICENSE
  201. +11 −0 tools/eslint/node_modules/unist-util-remove-position/history.md
  202. +42 −0 tools/eslint/node_modules/unist-util-remove-position/index.js
  203. +150 −0 tools/eslint/node_modules/unist-util-remove-position/package.json
  204. +169 −0 tools/eslint/node_modules/unist-util-remove-position/readme.md
  205. +22 −0 tools/eslint/node_modules/unist-util-visit/LICENSE
  206. +55 −0 tools/eslint/node_modules/unist-util-visit/index.js
  207. +138 −0 tools/eslint/node_modules/unist-util-visit/package.json
  208. +108 −0 tools/eslint/node_modules/unist-util-visit/readme.md
  209. +22 −0 tools/eslint/node_modules/vfile-location/LICENSE
  210. +123 −0 tools/eslint/node_modules/vfile-location/index.js
  211. +144 −0 tools/eslint/node_modules/vfile-location/package.json
  212. +83 −0 tools/eslint/node_modules/vfile-location/readme.md
  213. +21 −0 tools/eslint/node_modules/vfile/LICENSE
  214. +56 −0 tools/eslint/node_modules/vfile/history.md
  215. +628 −0 tools/eslint/node_modules/vfile/index.js
  216. +130 −0 tools/eslint/node_modules/vfile/package.json
  217. +538 −0 tools/eslint/node_modules/vfile/readme.md
  218. +6 −2 tools/icu/README.md
  219. +1 −1 vcbuild.bat
@@ -7,3 +7,4 @@ test/tmp*/
tools/eslint
node_modules
benchmark/tmp/
doc/**/*.js
@@ -1,5 +1,8 @@
root: true

plugins:
- markdown

env:
node: true
es6: true
@@ -855,8 +855,8 @@ bench-ci: bench

jslint:
@echo "Running JS linter..."
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules \
benchmark lib test tools
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.md \
benchmark doc lib test tools

jslint-ci:
@echo "Running JS linter..."
@@ -0,0 +1,5 @@
rules:
strict: 0
no-restricted-properties: 0
no-undef: 0
no-unused-vars: 0
@@ -554,6 +554,7 @@ Note that `error` can not be a string. If a string is provided as the second
argument, then `error` is assumed to be omitted and the string will be used for
`message` instead. This can lead to easy-to-miss mistakes:

<!-- eslint-disable assert-throws-arguments -->
```js
// THIS IS A MISTAKE! DO NOT DO THIS!
assert.throws(myFunction, 'missing foo', 'did not throw with expected message');
@@ -523,14 +523,11 @@ When any of the workers die the cluster module will emit the `'exit'` event.
This can be used to restart the worker by calling `.fork()` again.

```js
cluster.on(
'exit',
(worker, code, signal) => {
console.log('worker %d died (%s). restarting...',
worker.process.pid, signal || code);
cluster.fork();
}
);
cluster.on('exit', (worker, code, signal) => {
console.log('worker %d died (%s). restarting...',
worker.process.pid, signal || code);
cluster.fork();
});
```

See [child_process event: 'exit'][].
@@ -135,14 +135,15 @@ by extending Node.js' `console` and overriding the `console.assert()` method.
In the following example, a simple module is created that extends and overrides
the default behavior of `console` in Node.js.

<!-- eslint-disable func-name-matching -->
```js
'use strict';
// Creates a simple extension of console with a
// new impl for assert without monkey-patching.
const myConsole = Object.create(console, {
assert: {
value(assertion, message, ...args) {
value: function assert(assertion, message, ...args) {
try {
console.assert(assertion, message, ...args);
} catch (err) {
@@ -276,7 +277,7 @@ prints the result to `stdout`:

```js
console.time('100-elements');
for (let i = 0; i < 100; i++) ;
for (let i = 0; i < 100; i++) {}
console.timeEnd('100-elements');
// prints 100-elements: 225.438ms
```
@@ -289,7 +289,7 @@ decipher.on('end', () => {
});
const encrypted =
'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504';
'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504';
decipher.write(encrypted, 'hex');
decipher.end();
```
@@ -314,7 +314,7 @@ const crypto = require('crypto');
const decipher = crypto.createDecipher('aes192', 'a password');
const encrypted =
'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504';
'ca981be48e90867604588e75d04feabb63cc007a8f8ad89b10616ed84d815504';
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
decrypted += decipher.final('utf8');
console.log(decrypted);
@@ -26,6 +26,7 @@ inspection are possible.
Inserting the statement `debugger;` into the source code of a script will
enable a breakpoint at that position in the code:

<!-- eslint-disable no-debugger -->
```js
// myscript.js
global.x = 5;
@@ -293,6 +293,7 @@ function will contain an array of objects with the following properties:

For example:

<!-- eslint-disable -->
```js
{
flags: 's',
@@ -352,6 +353,7 @@ be an object with the following properties:
* `expire`
* `minttl`

<!-- eslint-disable -->
```js
{
nsname: 'ns.example.com',
@@ -382,6 +384,7 @@ be an array of objects with the following properties:
* `port`
* `name`

<!-- eslint-disable -->
```js
{
priority: 10,
@@ -217,7 +217,7 @@ synchronous counterparts are of this type.
For a regular file [`util.inspect(stats)`][] would return a string very
similar to this:

```txt
```
Stats {
dev: 2114,
ino: 48064969,
@@ -12,6 +12,7 @@ user is able to stream data.

HTTP message headers are represented by an object like this:

<!-- eslint-disable -->
```js
{ 'content-length': '123',
'content-type': 'text/plain',
@@ -34,6 +35,7 @@ property, which is an array of `[key, value, key2, value2, ...]`. For
example, the previous message header object might have a `rawHeaders`
list like the following:

<!-- eslint-disable semi -->
```js
[ 'ConTent-Length', '123456',
'content-LENGTH', '123',
@@ -1460,6 +1462,7 @@ Accept: text/plain\r\n

Then `request.url` will be:

<!-- eslint-disable semi -->
```js
'/status?name=ryan'
```
@@ -67,11 +67,7 @@ The module system is implemented in the `require('module')` module.

When a file is run directly from Node.js, `require.main` is set to its
`module`. That means that you can determine whether a file has been run
directly by testing

```js
require.main === module;
```
directly by testing `require.main === module`.

For a file `foo.js`, this will be `true` if run via `node foo.js`, but
`false` if run by `require('./foo')`.
@@ -556,6 +552,7 @@ exports = { hello: false }; // Not exported, only available in the module
When the `module.exports` property is being completely replaced by a new
object, it is common to also reassign `exports`, for example:

<!-- eslint-disable func-name-matching -->
```js
module.exports = exports = function Constructor() {
// ... etc.
@@ -71,6 +71,7 @@ The properties included on each object include:

For example:

<!-- eslint-disable semi -->
```js
[
{
@@ -253,6 +254,7 @@ The properties available on the assigned network address object include:
* `scopeid` {number} The numeric IPv6 scope ID (only specified when `family`
is `IPv6`)

<!-- eslint-disable -->
```js
{
lo: [
@@ -528,7 +528,8 @@ running the `./configure` script.

An example of the possible output looks like:

```txt
<!-- eslint-disable -->
```js
{
target_defaults:
{ cflags: [],
@@ -745,6 +746,7 @@ See environ(7).

An example of this object looks like:

<!-- eslint-disable -->
```js
{
TERM: 'xterm-256color',
@@ -832,12 +834,14 @@ $ node --harmony script.js --version

Results in `process.execArgv`:

<!-- eslint-disable semi -->
```js
['--harmony']
```

And `process.argv`:

<!-- eslint-disable semi -->
```js
['/usr/local/bin/node', 'script.js', '--version']
```
@@ -854,6 +858,7 @@ that started the Node.js process.

For example:

<!-- eslint-disable semi -->
```js
'/usr/local/bin/node'
```
@@ -1173,6 +1178,7 @@ console.log(process.memoryUsage());

Will generate:

<!-- eslint-disable -->
```js
{
rss: 4935680,
@@ -1344,6 +1350,7 @@ tarball.

For example:

<!-- eslint-disable -->
```js
{
name: 'node',
@@ -1705,6 +1712,7 @@ console.log(process.versions);

Will generate an object similar to:

<!-- eslint-disable -->
```js
{
http_parser: '2.3.0',
@@ -59,6 +59,7 @@ collection of key and value pairs.

For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into:

<!-- eslint-disable -->
```js
{
foo: 'bar',
@@ -414,7 +414,7 @@ For instance: `[[substr1, substr2, ...], originalsubstring]`.
```js
function completer(line) {
const completions = '.help .error .exit .quit .q'.split(' ');
const hits = completions.filter((c) => { return c.indexOf(line) === 0; });
const hits = completions.filter((c) => c.indexOf(line) === 0);
// show all completions if none found
return [hits.length ? hits : completions, line];
}
@@ -40,6 +40,7 @@ The following special commands are supported by all REPL instances:
`> .load ./file/to/load.js`
* `.editor` - Enter editor mode (`<ctrl>-D` to finish, `<ctrl>-C` to cancel)

<!-- eslint-disable -->
```js
> .editor
// Entering editor mode (^D to finish, ^C to cancel)
@@ -75,6 +76,7 @@ evaluation function when the `repl.REPLServer` instance is created.

The default evaluator supports direct evaluation of JavaScript expressions:

<!-- eslint-disable -->
```js
> 1 + 1
2
@@ -103,6 +105,7 @@ repl.start('> ').context.m = msg;

Properties in the `context` object appear as local within the REPL:

<!-- eslint-disable -->
```js
$ node repl_test.js
> m
@@ -132,6 +135,7 @@ REPL environment when used. For instance, unless otherwise declared as a
global or scoped variable, the input `fs` will be evaluated on-demand as
`global.fs = require('fs')`.

<!-- eslint-disable -->
```js
> fs.createReadStream('./some/file');
```
@@ -142,6 +146,7 @@ The default evaluator will, by default, assign the result of the most recently
evaluated expression to the special variable `_` (underscore).
Explicitly setting `_` to a value will disable this behavior.

<!-- eslint-disable -->
```js
> [ 'a', 'b', 'c' ]
[ 'a', 'b', 'c' ]
@@ -288,6 +293,7 @@ r.on('reset', initializeContext);
When this code is executed, the global `'m'` variable can be modified but then
reset to its initial value using the `.clear` command:

<!-- eslint-disable -->
```js
$ ./node example.js
> m
@@ -438,6 +444,7 @@ Node.js itself uses the `repl` module to provide its own interactive interface
for executing JavaScript. This can be used by executing the Node.js binary
without passing any arguments (or by passing the `-i` argument):

<!-- eslint-disable -->
```js
$ node
> const a = [1, 2, 3];
@@ -280,7 +280,7 @@ has been called, and all data has been flushed to the underlying system.

```js
const writer = getWritableStreamSomehow();
for (var i = 0; i < 100; i++) {
for (let i = 0; i < 100; i++) {
writer.write(`hello, #${i}!\n`);
}
writer.end('This is the end\n');
@@ -116,6 +116,7 @@ swapped out by the operating system.

For example:

<!-- eslint-disable -->
```js
{
total_heap_size: 7326976,
@@ -151,8 +151,9 @@ From `zlib/zconf.h`, modified to node.js's usage:

The memory requirements for deflate are (in bytes):

<!-- eslint-disable semi -->
```js
(1 << (windowBits + 2)) + (1 << (memLevel + 9));
(1 << (windowBits + 2)) + (1 << (memLevel + 9))
```

That is: 128K for windowBits=15 + 128K for memLevel = 8
@@ -167,12 +168,7 @@ const options = { windowBits: 14, memLevel: 7 };

This will, however, generally degrade compression.

The memory requirements for inflate are (in bytes)

```js
1 << windowBits;
```

The memory requirements for inflate are (in bytes) `1 << windowBits`.
That is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.

@@ -352,6 +352,7 @@ A non-op `Function` that can be used for a variety of scenarios.

For instance,

<!-- eslint-disable strict, no-undef -->
```js
const common = require('../common');

0 comments on commit b4fea2a

Please sign in to comment.
You can’t perform that action at this time.