Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

object destructuring assignment should have a dedicated option for the [typedef] rule #1039

Closed
drywolf opened this issue Mar 16, 2016 · 2 comments

Comments

@drywolf
Copy link

drywolf commented Mar 16, 2016

Currently when using a object-destructuring statement, tslint handles it just as a regular variable declaration.

image

It would be a good feature to let this es2015 construct have it's own separate option in the "typedef" rule.
(the same also applies for array-destructuring expressions)

For example this would be a config with the new options:

    "typedef": [
        true,
        "call-signature",
        "parameter",
        "property-declaration",
        "variable-declaration",
        "member-variable-declaration",
        // those are new
        "object-destructuring",
        "array-destructuring"
    ],

Regards

@jkillian
Copy link
Contributor

Good idea! I think explicit types for this kind of construct is pretty rare. Nobody wants to be writing types like this:

const obj = { foo: "bar" };
const { foo }: { foo: string } = obj;

@adidahiya adidahiya added the P2 label Mar 16, 2016
shlomiassaf pushed a commit to shlomiassaf/tslint that referenced this issue Jan 27, 2017
shlomiassaf pushed a commit to shlomiassaf/tslint that referenced this issue Jan 27, 2017
shlomiassaf pushed a commit to shlomiassaf/tslint that referenced this issue Jan 28, 2017
@JoshuaKGoldberg
Copy link
Contributor

This was fixed by #2146 🙌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants