mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
tools: update to ESLint 4.3.0
PR-URL: https://github.com/nodejs/node/pull/14417 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
1 parent
a7b3e06e9b
commit
5e952182e7
124 files changed
+8669
-1840
No files matched your search
+9
-8
@@ -7,10 +7,10 @@ module.exports = str => {
|
||||
return 0;
|
||||
}
|
||||
|
||||
let width = 0;
|
||||
|
||||
str = stripAnsi(str);
|
||||
|
||||
let width = 0;
|
||||
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const code = str.codePointAt(i);
|
||||
|
||||
@@ -19,16 +19,17 @@ module.exports = str => {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ignore combining characters
|
||||
if (code >= 0x300 && code <= 0x36F) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Surrogates
|
||||
if (code >= 0x10000) {
|
||||
if (code > 0xFFFF) {
|
||||
i++;
|
||||
}
|
||||
|
||||
if (isFullwidthCodePoint(code)) {
|
||||
width += 2;
|
||||
} else {
|
||||
width++;
|
||||
}
|
||||
width += isFullwidthCodePoint(code) ? 2 : 1;
|
||||
}
|
||||
|
||||
return width;
|
||||
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "string-width@^2.1.0",
|
||||
"_id": "string-width@2.1.0",
|
||||
"_id": "string-width@2.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-AwZkVh/BRslCPsfZeP4kV0N/5tA=",
|
||||
"_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||
"_location": "/eslint/string-width",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -19,8 +19,8 @@
|
||||
"/eslint/inquirer",
|
||||
"/eslint/table"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.0.tgz",
|
||||
"_shasum": "030664561fc146c9423ec7d978fe2457437fe6d0",
|
||||
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||
"_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e",
|
||||
"_spec": "string-width@^2.1.0",
|
||||
"_where": "/Users/trott/io.js/tools/eslint-tmp/node_modules/eslint/node_modules/inquirer",
|
||||
"author": {
|
||||
@@ -84,5 +84,5 @@
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
"version": "2.1.1"
|
||||
}
|
||||
Reference in new issue
Block a user