Skip to content

Conversation

@OnkarRuikar
Copy link
Contributor

Ellipsis in markdown code blocks are syntax errors.

In order to have smooth transition to Prettier and ESLint the PR comments out such bare ellipses. Refer the #18171 (comment) for more context.

@OnkarRuikar OnkarRuikar requested a review from a team as a code owner July 21, 2022 02:34
@OnkarRuikar OnkarRuikar requested review from Josh-Cena and removed request for a team July 21, 2022 02:34
@github-actions github-actions bot added the Content:JS JavaScript docs label Jul 21, 2022
@github-actions

This comment was marked as resolved.

@Josh-Cena
Copy link
Member

Josh-Cena commented Jul 21, 2022

@teoli2003 @OnkarRuikar Sorry I was not closely following this process before. I have a question about semantics.

The goal of this update is to make code blocks syntactically valid. However some changes don't really make the code any more or less valid. For example:

// Both invalid
- const a = ...;
+ const a = /* … */;

// Both valid
- console.log(foo); // { … }
+ console.log(foo); // { /* … */ }

Instead, I think it actually makes the point less clear. What about using without enclosing it in comments in places where we deliberately indicate "omission" instead of "optional content"? For example, "this object will be logged in console as { … } looks better than { /* … */ }, because there's indeed no comments logged!

@Josh-Cena
Copy link
Member

(Also, I'm skeptical about replacing ... with in code blocks, though I don't have strong opinions. It doesn't read great with a monospace font.)

@OnkarRuikar
Copy link
Contributor Author

const a = ...;

Are we going to lint inline code(e.g. `const a = 9` as well?

  • If no, then const a = ...; won't matter as long as it conveys the meaning.
  • If yes, and for code blocks ```js, what should be the replacement?

- console.log(foo); // { … }
+ console.log(foo); // { /* … */ }

I got these as review suggestions. You guys decide and, if needed, I'll correct it in all the pages.

@Josh-Cena
Copy link
Member

No—we don't lint inline code. It was more of a general question.

@teoli2003 teoli2003 merged commit c8a95ad into mdn:main Jul 23, 2022
@OnkarRuikar OnkarRuikar deleted the code-ellipsis2 branch July 23, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants