doc: enable eslint prefer-template rule

Backport-PR-URL: https://github.com/nodejs/node/pull/19244
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Ruben Bridgewater 2018-02-17 03:58:50 +01:00 committed by Myles Borins
parent b04dd7b351
commit cb732aeda4
No known key found for this signature in database
GPG Key ID: 933B01F40B5CA946
3 changed files with 4 additions and 3 deletions

View File

@ -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}]

View File

@ -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,
@ -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)) {

View File

@ -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);
}