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

feat(camelcase): allow for non-declaration object destructuring and named import when has no alias #1187

Conversation

dsherret
Copy link
Member

This ignores the camelcase rule for non-declaration object destructuring and named imports when the name has no local alias.

The rationale behind this change is when you are doing these actions, it indicates you have no control over the identifier.

For example:

// valid
import { op_something } from "something";
const {
  op_arraybuffer_was_detached,
  op_transfer_arraybuffer,
  op_readable_stream_resource_allocate,
  op_readable_stream_resource_get_sink,
  op_readable_stream_resource_write_error,
  op_readable_stream_resource_write_buf,
  op_readable_stream_resource_close,
  op_readable_stream_resource_await_close,
} = core.ensureFastOps();

// still invalid as this is a declaration
function myFunc({ camel_case }) {}

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

@dsherret dsherret merged commit 57c0efa into denoland:main Aug 31, 2023
3 checks passed
@dsherret dsherret deleted the feat_camelcase_allow_destructuring_and_named_import branch August 31, 2023 14:14
c-antin added a commit to c-antin/deno_lint that referenced this pull request Sep 15, 2024
c-antin added a commit to c-antin/deno_lint that referenced this pull request Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants