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

requirePaddingNewlinesBeforeKeywords: allow returning functions on same line #1997

Closed

Conversation

adambullmer
Copy link
Contributor

When returning functions when not on the first line in the current scope, the style checker fails.
with the following config:

  "requirePaddingNewlinesBeforeKeywords": true
// Invalid
function func() {
    var a = 0;

    return function() {}
}

This adds an exception in the logic of the rule to allow returning an anonymous function.

// valid
function func() {
    var a = 0;

    return function() {/*...*/}
}

@adambullmer adambullmer changed the title requirePaddingNewlineBefore: allow returning functions on same line requirePaddingNewlineBeforeKeyword: allow returning functions on same line Nov 30, 2015
…same line

This adds an exception in the logic of the rule to allow returning an anonymous function.

```js
// valid
function func() {
    var a = 0;

    return function() {/*...*/}
}
```
@adambullmer adambullmer changed the title requirePaddingNewlineBeforeKeyword: allow returning functions on same line requirePaddingNewlinesBeforeKeywords: allow returning functions on same line Nov 30, 2015
@markelog markelog closed this in 6194dbe Dec 2, 2015
hzoo pushed a commit to hzoo/node-jscs that referenced this pull request Jan 27, 2016
This adds an exception in the logic of the rule to
allow returning an anonymous function

```js
// valid
function func() {
    var a = 0;

    return function() {/*...*/}
}
```

Closes jscs-devgh-1997
hzoo pushed a commit to hzoo/node-jscs that referenced this pull request Jan 27, 2016
This adds an exception in the logic of the rule to
allow returning an anonymous function

```js
// valid
function func() {
    var a = 0;

    return function() {/*...*/}
}
```

Closes jscs-devgh-1997
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant