Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Add option to make one-line exception for getters #5

Closed
devinivy opened this issue Mar 11, 2017 · 4 comments
Closed

Add option to make one-line exception for getters #5

devinivy opened this issue Mar 11, 2017 · 4 comments
Assignees

Comments

@devinivy
Copy link
Member

The impetus for this rule is to have a blank line to denote that an asynchronous function call might occur. One case in which it's guaranteed that there's no async business is in a getter. It would be very convenient, in particular for static class getters, to have an option to allow one-liners there.

Here's an example,

// Allowed
const MyClass = class {
    static get name() {
        return 'MySpecialClass';
    }
};

// Allowed
const MyClass = class {
    static get name() { return 'MySpecialClass'; }
};

// Still not allowed
const fn = function () {
    return 'someValue';
};
@cjihrig
Copy link
Contributor

cjihrig commented Mar 13, 2017

I don't have a problem with this personally. Can you raise this on the hapi style guide though to make sure Eran and everyone else is fine with it.

@devinivy
Copy link
Member Author

Can do! Wouldn't necessarily have to change the hapi style guide if we make this an additional one-liner option, but I wouldn't mind it in the official hapi style guide either.

@hueniverse
Copy link
Contributor

Closing due to lack of progress.

@hueniverse hueniverse self-assigned this Aug 7, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants