diff --git a/package.json b/package.json index b2aaf701d..c7cf74d9a 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "eslint-plugin-prettier-internal-rules": "2.0.1", "eslint-plugin-react": "7.25.1", "eslint-plugin-regexp": "1.1.0", - "eslint-plugin-unicorn": "35.0.0", + "eslint-plugin-unicorn": "36.0.0", "esm-utils": "2.0.0", "execa": "5.1.1", "jest": "27.1.1", diff --git a/src/language-js/print/literal.js b/src/language-js/print/literal.js index 15cb41afa..a61a65eb3 100644 --- a/src/language-js/print/literal.js +++ b/src/language-js/print/literal.js @@ -53,7 +53,7 @@ function printBigInt(raw) { } function printRegex({ pattern, flags }) { - flags = flags.split("").sort().join(""); + flags = [...flags].sort().join(""); return `/${pattern}/${flags}`; } diff --git a/src/main/core.js b/src/main/core.js index 48035d355..63c40594a 100644 --- a/src/main/core.js +++ b/src/main/core.js @@ -109,14 +109,14 @@ function coreFormat(originalText, opts, addAlignmentSize = 0) { // diff old and new cursor node texts, with a special cursor // symbol inserted to find out where it moves to - const oldCursorNodeCharArray = oldCursorNodeText.split(""); + const oldCursorNodeCharArray = [...oldCursorNodeText]; oldCursorNodeCharArray.splice( cursorOffsetRelativeToOldCursorNode, 0, CURSOR ); - const newCursorNodeCharArray = newCursorNodeText.split(""); + const newCursorNodeCharArray = [...newCursorNodeText]; const cursorNodeDiff = diff.diffArrays( oldCursorNodeCharArray, diff --git a/yarn.lock b/yarn.lock index e001d40a9..61ebc6723 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3063,10 +3063,10 @@ eslint-plugin-regexp@1.1.0: regexpp "^3.2.0" scslre "^0.1.6" -eslint-plugin-unicorn@35.0.0: - version "35.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-35.0.0.tgz#40797793d4f645bafaaa7a1396b8f4ca7b2a7dbd" - integrity sha512-FHsaO68tDPQILfs/mGF8eSISJp8RswR4FpUuBDnueK2wyEHC6zmsc9WxjYyldXoIsBuVmru6jQyFCbCWPoW/KQ== +eslint-plugin-unicorn@36.0.0: + version "36.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-36.0.0.tgz#db50e1426839e401d33c5a279f49d4a5bbb640d8" + integrity sha512-xxN2vSctGWnDW6aLElm/LKIwcrmk6mdiEcW55Uv5krcrVcIFSWMmEgc/hwpemYfZacKZ5npFERGNz4aThsp1AA== dependencies: "@babel/helper-validator-identifier" "^7.14.9" ci-info "^3.2.0"