From db8c67e2813608ab9d1cfab07f085414270ed0ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:26:00 +0800 Subject: [PATCH] chore(deps): update dependency eslint-plugin-unicorn to v56 (#16736) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker --- eslint.config.js | 1 + package.json | 2 +- src/common/end-of-line.js | 2 +- src/language-markdown/printer-markdown.js | 2 +- yarn.lock | 53 +++++++++++++---------- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 25473fb4b..4801524e0 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -272,6 +272,7 @@ export default [ ignoreUsedVariables: true, }, ], + "unicorn/prefer-global-this": "off", "unicorn/prefer-query-selector": "off", "unicorn/prefer-ternary": "off", "unicorn/prevent-abbreviations": "off", diff --git a/package.json b/package.json index 54b749d35..ceacbe900 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "eslint-plugin-react": "7.37.1", "eslint-plugin-regexp": "2.6.0", "eslint-plugin-simple-import-sort": "12.1.1", - "eslint-plugin-unicorn": "55.0.0", + "eslint-plugin-unicorn": "56.0.0", "esm-utils": "4.3.0", "execa": "7.2.0", "globals": "15.9.0", diff --git a/src/common/end-of-line.js b/src/common/end-of-line.js index 28b77db27..54bc688d0 100644 --- a/src/common/end-of-line.js +++ b/src/common/end-of-line.js @@ -1,6 +1,6 @@ function guessEndOfLine(text) { const index = text.indexOf("\r"); - if (index >= 0) { + if (index !== -1) { return text.charAt(index + 1) === "\n" ? "crlf" : "cr"; } return "lf"; diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index 811287825..931b934c2 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -761,7 +761,7 @@ function printTitle(title, options, printSpace = true) { } function clamp(value, min, max) { - return value < min ? min : value > max ? max : value; + return Math.max(min, Math.min(value, max)); } function hasPrettierIgnore(path) { diff --git a/yarn.lock b/yarn.lock index 43a27ff64..6678d6b55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -189,7 +189,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.24.5, @babel/helper-validator-identifier@npm:^7.24.7, @babel/helper-validator-identifier@npm:^7.25.7": +"@babel/helper-validator-identifier@npm:^7.24.7, @babel/helper-validator-identifier@npm:^7.25.7": version: 7.25.7 resolution: "@babel/helper-validator-identifier@npm:7.25.7" checksum: 10/ec6934cc47fc35baaeb968414a372b064f14f7b130cf6489a014c9486b0fd2549b3c6c682cc1fc35080075e8e38d96aeb40342d63d09fc1a62510c8ce25cde1e @@ -2556,7 +2556,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:4.24.0, browserslist@npm:^4.22.2, browserslist@npm:^4.23.0, browserslist@npm:^4.23.1": +"browserslist@npm:4.24.0, browserslist@npm:^4.22.2, browserslist@npm:^4.23.1, browserslist@npm:^4.23.3": version: 4.24.0 resolution: "browserslist@npm:4.24.0" dependencies: @@ -2977,12 +2977,12 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.37.0": - version: 3.37.1 - resolution: "core-js-compat@npm:3.37.1" +"core-js-compat@npm:^3.38.1": + version: 3.38.1 + resolution: "core-js-compat@npm:3.38.1" dependencies: - browserslist: "npm:^4.23.0" - checksum: 10/30c6fdbd9ff179cc53951814689b8aabec106e5de6cddfa7a7feacc96b66d415b8eebcf5ec8f7c68ef35c552fe7d39edb8b15b1ce0f27379a272295b6e937061 + browserslist: "npm:^4.23.3" + checksum: 10/4e2f219354fd268895f79486461a12df96f24ed307321482fe2a43529c5a64e7c16bcba654980ba217d603444f5141d43a79058aeac77511085f065c5da72207 languageName: node linkType: hard @@ -3887,17 +3887,17 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-unicorn@npm:55.0.0": - version: 55.0.0 - resolution: "eslint-plugin-unicorn@npm:55.0.0" +"eslint-plugin-unicorn@npm:56.0.0": + version: 56.0.0 + resolution: "eslint-plugin-unicorn@npm:56.0.0" dependencies: - "@babel/helper-validator-identifier": "npm:^7.24.5" + "@babel/helper-validator-identifier": "npm:^7.24.7" "@eslint-community/eslint-utils": "npm:^4.4.0" ci-info: "npm:^4.0.0" clean-regexp: "npm:^1.0.0" - core-js-compat: "npm:^3.37.0" - esquery: "npm:^1.5.0" - globals: "npm:^15.7.0" + core-js-compat: "npm:^3.38.1" + esquery: "npm:^1.6.0" + globals: "npm:^15.9.0" indent-string: "npm:^4.0.0" is-builtin-module: "npm:^3.2.1" jsesc: "npm:^3.0.2" @@ -3905,11 +3905,11 @@ __metadata: read-pkg-up: "npm:^7.0.1" regexp-tree: "npm:^0.1.27" regjsparser: "npm:^0.10.0" - semver: "npm:^7.6.1" + semver: "npm:^7.6.3" strip-indent: "npm:^3.0.0" peerDependencies: eslint: ">=8.56.0" - checksum: 10/ea2fe55c517e18a8abedee125492ba09b11695fe41a3f42bf7b6789e9c937c89e8692735b07dcd41e25aff849950da2cca76ac6b727996e6bd2a978c8dc2685f + checksum: 10/142c66c65b2fd53136727a434b0fc77e9a9f9614aebe09330aeab83b021c842c3a5f9dafe3130c0f39fbd3562e91aadcc55a9de4312639e70fe7efb475cd358e languageName: node linkType: hard @@ -4018,12 +4018,12 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.5.0": - version: 1.5.0 - resolution: "esquery@npm:1.5.0" +"esquery@npm:^1.5.0, esquery@npm:^1.6.0": + version: 1.6.0 + resolution: "esquery@npm:1.6.0" dependencies: estraverse: "npm:^5.1.0" - checksum: 10/e65fcdfc1e0ff5effbf50fb4f31ea20143ae5df92bb2e4953653d8d40aa4bc148e0d06117a592ce4ea53eeab1dafdfded7ea7e22a5be87e82d73757329a1b01d + checksum: 10/c587fb8ec9ed83f2b1bc97cf2f6854cc30bf784a79d62ba08c6e358bf22280d69aee12827521cf38e69ae9761d23fb7fde593ce315610f85655c139d99b05e5a languageName: node linkType: hard @@ -4546,7 +4546,7 @@ __metadata: languageName: node linkType: hard -"globals@npm:15.9.0, globals@npm:^15.7.0, globals@npm:^15.8.0": +"globals@npm:15.9.0": version: 15.9.0 resolution: "globals@npm:15.9.0" checksum: 10/19bca70131c5d3e0d4171deed0f8ae16adda19f18d39b67421056f1eaa160b4433c3ffc8eb69b8b19adebbbdad4834d8a0494c5fe1ae295f0f769a5c0331d794 @@ -4567,6 +4567,13 @@ __metadata: languageName: node linkType: hard +"globals@npm:^15.7.0, globals@npm:^15.8.0, globals@npm:^15.9.0": + version: 15.10.0 + resolution: "globals@npm:15.10.0" + checksum: 10/d649208c62406fa71f131be643cb6d18703be5e612f8fa4da8a35bda56ce5a6a8caeb13a2f5a927e4d3324d73872e897067eb6f92ddd46a29876ffa5c4910cb8 + languageName: node + linkType: hard + "globalthis@npm:^1.0.3": version: 1.0.4 resolution: "globalthis@npm:1.0.4" @@ -7274,7 +7281,7 @@ __metadata: eslint-plugin-react: "npm:7.37.1" eslint-plugin-regexp: "npm:2.6.0" eslint-plugin-simple-import-sort: "npm:12.1.1" - eslint-plugin-unicorn: "npm:55.0.0" + eslint-plugin-unicorn: "npm:56.0.0" esm-utils: "npm:4.3.0" espree: "npm:10.2.0" execa: "npm:7.2.0" @@ -7834,7 +7841,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.6.3, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.1, semver@npm:^7.6.2, semver@npm:^7.6.3": +"semver@npm:7.6.3, semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.2, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: