Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ module.exports = {
'dot-location': ['error', 'property'],
'dot-notation': 'error',
'eol-last': 'error',
eqeqeq: ['error', 'smart'],
'eqeqeq': ['error', 'smart'],
'for-direction': 'error',
'func-call-spacing': 'error',
'func-name-matching': 'error',
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
indent: ['error', 2, {
'indent': ['error', 2, {
ArrayExpression: 'first',
CallExpression: { arguments: 'first' },
FunctionDeclaration: { parameters: 'first' },
Expand Down Expand Up @@ -209,9 +209,10 @@ module.exports = {
'one-var-declaration-per-line': 'error',
'operator-linebreak': ['error', 'after'],
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
quotes: ['error', 'single', { avoidEscape: true }],
'quotes': ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'consistent'],
'rest-spread-spacing': 'error',
semi: 'error',
'semi': 'error',
'semi-spacing': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', {
Expand All @@ -222,7 +223,7 @@ module.exports = {
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
strict: ['error', 'global'],
'strict': ['error', 'global'],
'symbol-description': 'error',
'template-curly-spacing': 'error',
'unicode-bom': 'error',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/querystring/querystring-stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function main({ type, n }) {
encodemany: {
'\u0080\u0083\u0089': 'bar',
'\u008C\u008E\u0099': 'quux',
xyzzy: '\u00A5q\u00A3r'
'xyzzy': '\u00A5q\u00A3r'
},
encodelast: {
foo: 'bar',
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/loader/DefaultResolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function search(target, base) {
}

const extensionFormatMap = {
__proto__: null,
'__proto__': null,
'.mjs': 'esm',
'.json': 'json',
'.node': 'addon',
Expand Down
4 changes: 2 additions & 2 deletions test/doctool/test-doctool-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ const testData = [
meta: {
added: ['v5.3.0', 'v4.2.0'],
changes: [
{ version: 'v4.2.0',
{ 'version': 'v4.2.0',
'pr-url': 'https://github.com/nodejs/node/pull/3276',
description: 'The `error` parameter can now be ' +
'description': 'The `error` parameter can now be ' +
'an arrow function.'
}
]
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-client-headers-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function execute(options) {
http.createServer(function(req, res) {
const expectHeaders = {
'x-foo': 'boom',
cookie: 'a=1; b=2; c=3',
connection: 'close'
'cookie': 'a=1; b=2; c=3',
'connection': 'close'
};

// no Host header when you set headers an array
Expand Down
10 changes: 5 additions & 5 deletions test/parallel/test-http-raw-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ http.createServer(function(req, res) {
'close'
];
const expectHeaders = {
host: `localhost:${this.address().port}`,
'host': `localhost:${this.address().port}`,
'transfer-encoding': 'CHUNKED',
'x-bar': 'yoyoyo',
connection: 'close'
'connection': 'close'
};
const expectRawTrailers = [
'x-bAr',
Expand Down Expand Up @@ -96,9 +96,9 @@ http.createServer(function(req, res) {
'chunked'
];
const expectHeaders = {
trailer: 'x-foo',
date: null,
connection: 'close',
'trailer': 'x-foo',
'date': null,
'connection': 'close',
'transfer-encoding': 'chunked'
};
res.rawHeaders[3] = null;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-expect-continue-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ server.listen(0, common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);
const req = client.request({
':method': 'POST',
expect: '100-continue'
'expect': '100-continue'
});

let gotContinue = false;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-expect-continue.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ server.on('listening', common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);
const req = client.request({
':method': 'POST',
expect: '100-continue'
'expect': '100-continue'
});

let gotContinue = false;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-expect-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function nextTest(testsToRun) {
':method': 'GET',
':scheme': 'http',
':authority': `localhost:${port}`,
expect: expectValue
'expect': expectValue
});

req.on('response', common.mustCall((headers) => {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http2-cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ server.on('listening', common.mustCall(() => {

const req = client.request({
':path': '/',
abc: [1, 2, 3],
cookie: ['a=b', 'c=d', 'e=f'],
'abc': [1, 2, 3],
'cookie': ['a=b', 'c=d', 'e=f'],
});
req.resume();

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-server-rst-before-respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function onStream(stream, headers, flags) {
common.expectsError(() => {
stream.additionalHeaders({
':status': 123,
abc: 123
'abc': 123
});
}, { code: 'ERR_HTTP2_INVALID_STREAM' });
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-server-rst-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ server.listen(0, common.mustCall(() => {
tests.forEach((test) => {
const req = client.request({
':method': 'POST',
rstcode: test[0]
'rstcode': test[0]
});
req.on('close', common.mustCall((code) => {
assert.strictEqual(code, test[0]);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const qsTestCases = [
['foo&bar=baz', 'foo=&bar=baz', { foo: '', bar: 'baz' }],
['a=b&c&d=e', 'a=b&c=&d=e', { a: 'b', c: '', d: 'e' }],
['a=b&c=&d=e', 'a=b&c=&d=e', { a: 'b', c: '', d: 'e' }],
['a=b&=c&d=e', 'a=b&=c&d=e', { a: 'b', '': 'c', d: 'e' }],
['a=b&=&c=d', 'a=b&=&c=d', { a: 'b', '': '', c: 'd' }],
['a=b&=c&d=e', 'a=b&=c&d=e', { 'a': 'b', '': 'c', 'd': 'e' }],
['a=b&=&c=d', 'a=b&=&c=d', { 'a': 'b', '': '', 'c': 'd' }],
['&&foo=bar&&', 'foo=bar', { foo: 'bar' }],
['&', '', {}],
['&&&&', '', {}],
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-vm-module-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function circular() {

async function circular2() {
const sourceMap = {
root: `
'root': `
import * as a from './a.mjs';
import * as b from './b.mjs';
if (!('fromA' in a))
Expand Down
8 changes: 4 additions & 4 deletions tools/eslint-rules/no-unescaped-regexp-dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ module.exports = function(context) {
}

return {
TemplateLiteral: checkLiteral,
Literal: checkLiteral,
CallExpression: checkRegExpStart,
NewExpression: checkRegExpStart,
'TemplateLiteral': checkLiteral,
'Literal': checkLiteral,
'CallExpression': checkRegExpStart,
'NewExpression': checkRegExpStart,
'CallExpression:exit': checkRegExpEnd,
'NewExpression:exit': checkRegExpEnd
};
Expand Down