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

"Expected consistent spacing" when chaining #299

Closed
reggi opened this issue Oct 20, 2015 · 1 comment

Comments

@reggi
Copy link
Contributor

commented Oct 20, 2015

I'm getting Expected consistent spacing warning and I'm not sure why, here's the code:

const filtered = (props, prefix) => {
  if (typeof prefix === 'string') prefix = new RegExp(`^${prefix}`)
  return Object.keys(props)
    .filter(key => prefix.test(key))
    .map(key => ({ [unprefixify(prefix, key)]: props[key]}))
    .reduce((props, prop) => ({ ...props, ...prop }), {})
}
@reggi

This comment has been minimized.

Copy link
Contributor Author

commented Oct 20, 2015

Ah, it wasn't leading space is was the space before [unprefixify

const filtered = (props, prefix) => {
  if (typeof prefix === 'string') prefix = new RegExp(`^${prefix}`)
  return Object.keys(props)
    .filter(key => prefix.test(key))
    .map(key => ({[unprefixify(prefix, key)]: props[key]}))
    .reduce((props, prop) => ({ ...props, ...prop }), {})
}

@reggi reggi closed this Oct 20, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
1 participant
You can’t perform that action at this time.