Skip to content

Consistently add quotes to object keys #838

@vjeux

Description

@vjeux

While running through the codebase, prettier happens to conflict with the eslint quote props "consistent-as-needed" ( http://eslint.org/docs/rules/quote-props ):

image

const request = {
  method: 'GET',
  headers: {
    'Accept': 'application/json', // Accept isn't quoted right now
    'Content-Type': 'application/json',
  },
}

Apparently we are now doing "as-needed". The difference is that if one element in an object has quotes, then all of them must.

Given those two examples, it sounds like this is a better way to add quotes, but I wanted to get some feedback before implementing it.

Metadata

Metadata

Assignees

Labels

locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!type:option requestIssues requesting a new option. We generally don’t accept these unless there is technical necessity.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions