Skip to content

Commit

Permalink
fix(js): ignore formatting empty statement example with code comment (#…
Browse files Browse the repository at this point in the history
…2696)

* Update statement-empty.js

moved the comment to a new position which (i) makes more sense and (ii) is where the identical comment is located in the other code snippet on the same MDN page (see: https://github.com/mdn/content/blob/63a26b042a4d27c1038060c4ea8b605e188a5787/files/en-us/web/javascript/reference/statements/empty/index.md?plain=1#L41C17-L41C17 )

* chore: add ignore rule to prevent formatting empty statements

---------

Co-authored-by: Brian Thomas Smith <brian@smith.berlin>
  • Loading branch information
yg-i and bsmth authored Feb 29, 2024
1 parent f5a8492 commit 0b33754
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CHANGELOG.md
docs/
live-examples/html-examples/inline-text-semantics/rtc.html
live-examples/js-examples/statement/statement-empty.js
2 changes: 1 addition & 1 deletion live-examples/js-examples/statement/statement-empty.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const array1 = [1, 2, 3];

// Assign all array values to 0
for (let i = 0; i < array1.length; array1[i++] = 0 /* empty statement */);
for (let i = 0; i < array1.length; array1[i++] = 0) /* empty statement */ ;

console.log(array1);
// Expected output: Array [0, 0, 0]

0 comments on commit 0b33754

Please sign in to comment.