diff --git a/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 8dd6d1d1f11fa8..22847019626b1b 100644 --- a/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/fr/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ L'en-tête d'une boucle [`for...in`](/fr/docs/Web/JavaScript/Reference/Instructi Cet exemple déclenchera une exception `SyntaxError` : -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 6113092cba08d5..bb5334105aa4f0 100644 --- a/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/ja/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -27,12 +27,10 @@ SyntaxError: for-in loop variable declaration may not have an initializer. (Chro この例では `SyntaxError` が発生します。 -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md index a47c1de13b9339..d0b8d64df2b681 100644 --- a/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/ko/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ slug: Web/JavaScript/Reference/Errors/Invalid_for-in_initializer 이 예제는 `SyntaxError`를 발생시킵니다. -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/files/ko/web/javascript/reference/global_objects/math/atan2/index.md b/files/ko/web/javascript/reference/global_objects/math/atan2/index.md index 4923314a6d0d47..12981a24db1641 100644 --- a/files/ko/web/javascript/reference/global_objects/math/atan2/index.md +++ b/files/ko/web/javascript/reference/global_objects/math/atan2/index.md @@ -88,7 +88,7 @@ function format(template, ...args) { ...args.map((num) => (Object.is(num, -0) ? "-0" - : formattedNumbers.get(num) ?? String(num) + : (formattedNumbers.get(num) ?? String(num)) ).padEnd(5), ), ); diff --git a/files/ko/web/javascript/reference/statements/for...in/index.md b/files/ko/web/javascript/reference/statements/for...in/index.md index b5ebc46dede323..9dff5aae36419f 100644 --- a/files/ko/web/javascript/reference/statements/for...in/index.md +++ b/files/ko/web/javascript/reference/statements/for...in/index.md @@ -117,7 +117,7 @@ alert(show_own_props(o, "o")); /* alerts: o.color = red */ Prior to Firefox 40, it was possible to use an initializer expression (`i=0`) in a `for...in` loop: -```js example-bad +```js-nolint example-bad const obj = { a: 1, b: 2, c: 3 }; for (var i = 0 in obj) { console.log(obj[i]); diff --git a/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 37d3a1845ca744..f2b6547fb5688c 100644 --- a/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/pt-br/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -35,7 +35,7 @@ No [modo estrito](/pt-BR/docs/Web/JavaScript/Reference/Strict_mode), contudo, é Esse exemplo lança um `SyntaxError`: -```js example-bad +```js-nolint example-bad const obj = { a: 1, b: 2, c: 3 }; for (const i = 0 in obj) { diff --git a/files/pt-br/web/javascript/reference/statements/for...in/index.md b/files/pt-br/web/javascript/reference/statements/for...in/index.md index 61aba948a21513..256f35b086aebe 100644 --- a/files/pt-br/web/javascript/reference/statements/for...in/index.md +++ b/files/pt-br/web/javascript/reference/statements/for...in/index.md @@ -92,9 +92,9 @@ for (var prop in obj) { Anterior ao SpiderMonkey 40, era possível usar uma expressão inicial com o laço for...in, conforme exemplo que se segue: -```js example-bad -var obj = {a:1, b:2, c:3}; -for(var i=0 in obj) { +```js-nolint example-bad +var obj = { a: 1, b: 2, c: 3 }; +for (var i = 0 in obj) { console.log(obj[i]); } // 1 diff --git a/files/ru/web/javascript/reference/statements/for...in/index.md b/files/ru/web/javascript/reference/statements/for...in/index.md index d03db49a9a1499..0fc61307dce0f9 100644 --- a/files/ru/web/javascript/reference/statements/for...in/index.md +++ b/files/ru/web/javascript/reference/statements/for...in/index.md @@ -89,11 +89,11 @@ for (var prop in obj) { ## Поддержка: инициализатор переменных -До SpiderMonkey 40, можно было инициализировать переменные (`i=0`) в цикле `for...in`: +До SpiderMonkey 40, можно было инициализировать переменные (`i = 0`) в цикле `for...in`: -```js example-bad -var obj = {a:1, b:2, c:3}; -for(var i=0 in obj) { +```js-nolint example-bad +var obj = { a: 1, b: 2, c: 3 }; +for (var i = 0 in obj) { console.log(obj[i]); } // 1 diff --git a/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md b/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md index 573ffd6e2f36be..9a804d0b3f631d 100644 --- a/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md +++ b/files/zh-cn/web/javascript/reference/errors/invalid_for-in_initializer/index.md @@ -25,12 +25,10 @@ SyntaxError: for-in loop variable declaration may not have an initializer. (Chro 下面这个示例会报语法错误(`SyntaxError`): -```js example-bad -"use strict"; - -var obj = {a: 1, b: 2, c: 3 }; +```js-nolint example-bad +const obj = { a: 1, b: 2, c: 3 }; -for (var i = 0 in obj) { +for (const i = 0 in obj) { console.log(obj[i]); } diff --git a/package.json b/package.json index 5117f2bf53c763..80ec5620b2b856 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "markdownlint-rule-search-replace": "1.2.0", "mdast-util-from-markdown": "^2.0.1", "ora": "^8.0.1", - "prettier": "3.3.2", + "prettier": "3.3.3", "unist-util-visit": "^5.0.0", "yargs": "^17.7.2" } diff --git a/yarn.lock b/yarn.lock index 503efc9aa116fe..3208a612a41a1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -983,10 +983,10 @@ pidtree@~0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== -prettier@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a" - integrity sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA== +prettier@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== punycode.js@^2.3.1: version "2.3.1"