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

Enforce blank line between variable declaration and usage #15

Closed
wincent opened this issue Mar 16, 2020 · 1 comment
Closed

Enforce blank line between variable declaration and usage #15

wincent opened this issue Mar 16, 2020 · 1 comment

Comments

@wincent
Copy link
Contributor

wincent commented Mar 16, 2020

As per request here.

In short, if you declare a var, add a line break before using it. This shows order of requirements better.

Some (contrived) examples of correct code:

const thing = getThing();

thing.publish();
const items = getItems();

const reversedItems = items.reverse();

print(reversedItems);
const firstName = 'Jane';
const secondName = 'Smith';

const full name = [firstName, secondName].join(' ');
@wincent
Copy link
Contributor Author

wincent commented Mar 17, 2020

wincent referenced this issue in julien/liferay-portal Apr 24, 2020
-   Correct a bad description (says "doesn't throw" but supposed to be
    "throws").
-   Replace the sample "broken input" with something that describes why
    it is broken (eg. "not a relative or absolute URL").
-   Hard-code "http://localhost/" to explicitly confirm the invariant
    that `location.href` is always going to be a URL that ends with a
    trailing slash.
-   Add a blank line for consistency with style used elsewhere. At some
    point, this kind of thing will be autoformatted; see:

    https://github.com/liferay/eslint-config-liferay/issues/160
brianchandotcom referenced this issue in brianchandotcom/liferay-portal Apr 24, 2020
-   Correct a bad description (says "doesn't throw" but supposed to be
    "throws").
-   Replace the sample "broken input" with something that describes why
    it is broken (eg. "not a relative or absolute URL").
-   Hard-code "http://localhost/" to explicitly confirm the invariant
    that `location.href` is always going to be a URL that ends with a
    trailing slash.
-   Add a blank line for consistency with style used elsewhere. At some
    point, this kind of thing will be autoformatted; see:

    https://github.com/liferay/eslint-config-liferay/issues/160
@wincent wincent transferred this issue from liferay/eslint-config-liferay Sep 24, 2020
wincent added a commit that referenced this issue Dec 18, 2020
docs: word-smith some awkward phrasing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants