denoland / deno_lint

Blazing fast linter for JavaScript and TypeScript written in Rust
https://lint.deno.land/
MIT License
1.51k stars 163 forks source link

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

Closed dsherret closed 10 months ago

dsherret commented 10 months ago

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 }) {}