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

Misaligned indentation for wrapped object parameter #1050

Closed
pgraham opened this issue Jan 26, 2018 · 2 comments

Comments

@pgraham
Copy link

commented Jan 26, 2018

I'm seeing a function call that requires multiple parameters, one of which is an object literal, with unexpected indentation for the object literal:

const { argv } = require('yargs')
  .command(
    ['status', '$0'],
    'The status command, very useful.',
  {
    builder: {},
    handler: argv => {
      console.log('Status:')
    }
  }
  )
  .help().argv

I'm expecting the braces of the object literal to be aligned with previous string arguments. Is this expected? If so, what's the reason for using a different indentation level for the object literal parameter?

@stale

This comment has been minimized.

Copy link

commented May 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 10, 2018

@feross

This comment has been minimized.

Copy link
Member

commented May 11, 2018

@pgraham Thanks for opening this issue. Sorry that you never got a timely response.

I just double-checked and it looks like this issue was fixed in standard v12. Running standard --fix on the code you pasted formats the code as you expected:

const { argv } = require('yargs')
  .command(
    ['status', '$0'],
    'The status command, very useful.',
    {
      builder: {},
      handler: argv => {
        console.log('Status:')
      }
    }
  )
  .help().argv

🎉

@stale stale bot removed the stale label May 11, 2018

@feross feross closed this May 11, 2018

@feross feross added the question label May 11, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2018

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