Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix tabs in rule examples #17653

Merged
merged 6 commits into from Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/src/rules/no-mixed-spaces-and-tabs.md
Expand Up @@ -23,10 +23,15 @@ Examples of **incorrect** code for this rule:
/*eslint no-mixed-spaces-and-tabs: "error"*/

function add(x, y) {
// --->..return x + y;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is very clear. I'm guessing that you're trying to show where the tabs and spaces are, but it's just confusing to me. I'd leave these out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments were already there before my changes. No problem to re-remove them if that's fine for @mdjermanovic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with removing these comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 12d2d94.


return x + y;
}

function main() {
// --->var x = 5,
// --->....y = 7;

var x = 5,
y = 7;
}
Expand All @@ -45,6 +50,8 @@ Examples of **correct** code for this rule:
/*eslint no-mixed-spaces-and-tabs: "error"*/

function add(x, y) {
// --->return x + y;

return x + y;
}
```
Expand All @@ -70,6 +77,9 @@ Examples of **correct** code for this rule with the `"smart-tabs"` option:
/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/

function main() {
// --->var x = 5,
// --->....y = 7;

var x = 5,
y = 7;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/rules/no-tabs.md
Expand Up @@ -14,7 +14,7 @@ Examples of **incorrect** code for this rule:

<!-- markdownlint-capture -->
<!-- markdownlint-disable MD010 -->
::: incorrect { "openInPlayground": false }
::: incorrect

```js
/* eslint no-tabs: "error" */
Expand Down Expand Up @@ -63,7 +63,7 @@ Examples of **correct** code for this rule with the `allowIndentationTabs: true`

<!-- markdownlint-capture -->
<!-- markdownlint-disable MD010 -->
::: correct { "openInPlayground": false }
::: correct

```js
/* eslint no-tabs: ["error", { allowIndentationTabs: true }] */
Expand Down