From 77353b3b5ac3d6e57d95bc82c7466cea22ce0410 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 16 Mar 2017 22:47:05 -0700 Subject: [PATCH] tools: ignore URLs in line length linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Where inclusion of a lengthy URL causes a line to exceed 80 characters in our code base, do not report the line length as a linting error. PR-URL: https://github.com/nodejs/node/pull/11890 Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- .eslintrc.yaml | 2 +- lib/_http_server.js | 2 -- test/parallel/test-process-env.js | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index ba6334b0346985..1362c9cb29e387 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -97,7 +97,7 @@ rules: key-spacing: [2, {mode: minimum}] keyword-spacing: 2 linebreak-style: [2, unix] - max-len: [2, 80, 2] + max-len: [2, {code: 80, ignoreUrls: true, tabWidth: 2}] new-parens: 2 no-mixed-spaces-and-tabs: 2 no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}] diff --git a/lib/_http_server.js b/lib/_http_server.js index 1d1d7ba7c6912b..46d0dbcee20fdb 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -236,11 +236,9 @@ function Server(requestListener) { this.on('request', requestListener); } - /* eslint-disable max-len */ // Similar option to this. Too lazy to write my own docs. // http://www.squid-cache.org/Doc/config/half_closed_clients/ // http://wiki.squid-cache.org/SquidFaq/InnerWorkings#What_is_a_half-closed_filedescriptor.3F - /* eslint-enable max-len */ this.httpAllowHalfOpen = false; this.on('connection', connectionListener); diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index 5ea0a4a57efc68..cc173e2e3147e0 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -49,7 +49,6 @@ if (process.argv[2] === 'you-are-the-child') { delete process.env.NON_EXISTING_VARIABLE; assert.strictEqual(true, delete process.env.NON_EXISTING_VARIABLE); -/* eslint-disable max-len */ /* For the moment we are not going to support setting the timezone via the * environment variables. The problem is that various V8 platform backends * deal with timezone in different ways. The windows platform backend caches @@ -66,7 +65,6 @@ date = new Date('Fri, 10 Sep 1982 03:15:00 GMT'); assert.strictEqual(3, date.getUTCHours()); assert.strictEqual(5, date.getHours()); */ -/* eslint-enable max-len */ // Environment variables should be case-insensitive on Windows, and // case-sensitive on other platforms.