Skip to content

Commit

Permalink
doc: enable eslint prefer-template rule
Browse files Browse the repository at this point in the history
PR-URL: nodejs#18831
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
BridgeAR authored and MayaLekova committed May 8, 2018
1 parent 8a30e36 commit 2c4caca
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/.eslintrc.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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 @@ -161,7 +161,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/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ const req = http.request(options);
req.end();

req.on('information', (res) => {
console.log('got information prior to main response: ' + res.statusCode);
console.log(`Got information prior to main response: ${res.statusCode}`);
});
```

Expand Down
2 changes: 1 addition & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,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 2c4caca

Please sign in to comment.