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

Question about padding #242

Closed
carlbennettnz opened this issue Aug 31, 2015 · 2 comments

Comments

@carlbennettnz
Copy link

commented Aug 31, 2015

I'm just transitioning a codebase to standard style. Everything's gone fine, except for this part:

var resources = [
  { singular: 'account-map',  plural: 'account-maps',  model: 'AccountMap' },
  { singular: 'account',      plural: 'accounts',      model: 'Account' },
  { singular: 'balance',      plural: 'balances',      model: 'Balance' },
  { singular: 'branch',       plural: 'branches',      model: 'Branch' },
  { singular: 'group',        plural: 'groups',        model: 'Group' },
  { singular: 'import',       plural: 'imports',       model: 'Import' },
  { singular: 'kpi',          plural: 'kpis',          model: 'Kpi' },
  { singular: 'label',        plural: 'labels',        model: 'Label' },
  { singular: 'organisation', plural: 'organisations', model: 'Organisation' },
  { singular: 'registration', plural: 'registrations', model: 'Registration' },
  { singular: 'user',         plural: 'users',         model: 'User' }
]

Standard of course complains about the multiple spaces. Simply removing the spaces would make the entire block unreadable, so what's the recommended way of dealing with this?

@dcousens dcousens added the question label Aug 31, 2015

@dcousens

This comment has been minimized.

Copy link
Member

commented Aug 31, 2015

what's the recommended way of dealing with this?

Off the top of my head.

Option 1: Expand the JSON

[
  {
     singular: 'account-map',
     plural: 'account-maps',
     model: 'AccountMap'
  },
  ...
]

Option 2: Disable the rule in-line

/*eslint-disable no-multi-spaces */
var resources = [
  ...
]
/*eslint-enable no-multi-spaces */
@carlbennettnz

This comment has been minimized.

Copy link
Author

commented Aug 31, 2015

Ok, thanks for your help

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 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.