newer versions of eslint added the "consistent-as-needed" style to quote-props, which basically means we can enforce that an entire object is quoted if any 1 property requires quotes:
// quotes everywhere because of ".NET"
var langs = {
'Android': 'android',
'curl': 'curl',
'Go': 'go',
'iOS': 'ios',
'Java': 'java',
'JavaScript': 'js',
'Node': 'node',
'PHP': 'php',
'Python': 'python',
'Ruby': 'ruby',
'Xamarin': 'Xamarin',
'.NET': 'NET',
};
// current style
var langs = {
Android: 'android',
curl: 'curl',
Go: 'go',
iOS: 'ios',
Java: 'java',
JavaScript: 'js',
Node: 'node',
PHP: 'php',
Python: 'python',
Ruby: 'ruby',
Xamarin: 'Xamarin',
'.NET': 'NET',
};
I think it's easier to just keep the entire object consistent, rather than quoting some but not others. You can read more about this rule here.
newer versions of eslint added the "consistent-as-needed" style to
quote-props
, which basically means we can enforce that an entire object is quoted if any 1 property requires quotes:I think it's easier to just keep the entire object consistent, rather than quoting some but not others. You can read more about this rule here.