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

fix: Support using declarations in no-lone-blocks #18269

Merged
merged 1 commit into from Apr 5, 2024

Conversation

kirkwaiblinger
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Made a trivial change that future-proofs no-lone-block for declaration kinds other than var, let, and const. (namely, adds tests for using and await using, but should be compatible with any kind of VariableDeclaration cooked up in the future).

fixes #18204

@eslint-github-bot
Copy link

Hi @kirkwaiblinger!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@github-actions github-actions bot added the rule Relates to ESLint's core rules label Apr 4, 2024
Copy link

netlify bot commented Apr 4, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit b45740f
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/660f2409cce61200080b7419

@eslint-github-bot
Copy link

Hi @kirkwaiblinger!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@eslint-github-bot
Copy link

Hi @kirkwaiblinger!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

This commit adds support for explicit resource
management keywords inside a block for the
`no-lone-blocks` rule.

Fixes eslint#18204
@eslint-github-bot
Copy link

Hi @kirkwaiblinger!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@kirkwaiblinger kirkwaiblinger changed the title [no-lone-blocks] support explicit resource management fix: [no-lone-blocks] Support using declarations Apr 4, 2024
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Apr 4, 2024
@kirkwaiblinger kirkwaiblinger marked this pull request as ready for review April 4, 2024 22:08
@kirkwaiblinger kirkwaiblinger requested a review from a team as a code owner April 4, 2024 22:08
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Leaving open so others can review.

@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion contributor pool labels Apr 5, 2024
@mdjermanovic mdjermanovic changed the title fix: [no-lone-blocks] Support using declarations fix: Support using declarations in no-lone-blocks Apr 5, 2024
@mdjermanovic mdjermanovic added the experimental syntax This change is related to experimental syntax (stage 3 or below) label Apr 5, 2024
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly contributor pool experimental syntax This change is related to experimental syntax (stage 3 or below) rule Relates to ESLint's core rules
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Bug: no-lone-blocks emits an error with using keyword
3 participants