From dbfa14cf53224271f85115e7514f4f9ef4f954ea Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 3 Jul 2017 16:07:21 +0200 Subject: [PATCH 1/2] benchmark,test,tools: use consistent quote-props --- benchmark/querystring/querystring-stringify.js | 2 +- test/doctool/test-doctool-json.js | 4 ++-- test/parallel/test-http-raw-headers.js | 10 +++++----- test/parallel/test-querystring.js | 4 ++-- tools/eslint-rules/no-unescaped-regexp-dot.js | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index 7e31a49e99e54c..fd9b0f866bd06b 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -20,7 +20,7 @@ function main(conf) { encodemany: { '\u0080\u0083\u0089': 'bar', '\u008C\u008E\u0099': 'quux', - xyzzy: '\u00A5q\u00A3r' + 'xyzzy': '\u00A5q\u00A3r' }, encodelast: { foo: 'bar', diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 346a7f331e9d7f..f4f0b670861d87 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -103,9 +103,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.' } ] diff --git a/test/parallel/test-http-raw-headers.js b/test/parallel/test-http-raw-headers.js index eb3f7280f89100..8ce20db351302c 100644 --- a/test/parallel/test-http-raw-headers.js +++ b/test/parallel/test-http-raw-headers.js @@ -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', @@ -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; diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 10f166562ba6c1..4935caf95ead39 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -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' }], ['&&&&', '', {}], ['&=&', '=', { '': '' }], diff --git a/tools/eslint-rules/no-unescaped-regexp-dot.js b/tools/eslint-rules/no-unescaped-regexp-dot.js index cf542a3d7021ff..0a1a67539862d8 100644 --- a/tools/eslint-rules/no-unescaped-regexp-dot.js +++ b/tools/eslint-rules/no-unescaped-regexp-dot.js @@ -147,10 +147,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 }; From 6ae9c44ac4873d60373c07e79b3350c4edea88e9 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 3 Jul 2017 16:07:50 +0200 Subject: [PATCH 2/2] eslint: add quote-props rule --- .eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index d8442ff3a18c44..21cf1a98226d7a 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -135,6 +135,7 @@ rules: one-var-declaration-per-line: 2 operator-linebreak: [2, after] quotes: [2, single, avoid-escape] + quote-props: [2, consistent] semi: 2 semi-spacing: 2 space-before-blocks: [2, always]