Skip to content

Commit

Permalink
doc: enable eslint prefer-template rule
Browse files Browse the repository at this point in the history
Backport-PR-URL: #19244
PR-URL: #18831
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
BridgeAR authored and MylesBorins committed Mar 21, 2018
1 parent b04dd7b commit cb732ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/.eslintrc.yaml
Expand Up @@ -12,6 +12,7 @@ rules:
no-var: error
prefer-const: error
prefer-rest-params: error
prefer-template: error

# Stylistic Issues
no-multiple-empty-lines: [error, {max: 1, maxEOF: 0, maxBOF: 0}]
4 changes: 2 additions & 2 deletions doc/api/esm.md
Expand Up @@ -114,7 +114,7 @@ given module specifier and parent file URL:

```js
const baseURL = new URL('file://');
baseURL.pathname = process.cwd() + '/';
baseURL.pathname = `${process.cwd()}/`;

export async function resolve(specifier,
parentModuleURL = baseURL,
Expand Down Expand Up @@ -158,7 +158,7 @@ const builtins = Module.builtinModules;
const JS_EXTENSIONS = new Set(['.js', '.mjs']);

const baseURL = new URL('file://');
baseURL.pathname = process.cwd() + '/';
baseURL.pathname = `${process.cwd()}/`;

export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) {
if (builtins.includes(specifier)) {
Expand Down
2 changes: 1 addition & 1 deletion doc/api/stream.md
Expand Up @@ -1801,7 +1801,7 @@ class Counter extends Readable {
if (i > this._max)
this.push(null);
else {
const str = '' + i;
const str = String(i);
const buf = Buffer.from(str, 'ascii');
this.push(buf);
}
Expand Down

0 comments on commit cb732ae

Please sign in to comment.