Skip to content

Forced quoted/non-quoted object keys #8

@miklschmidt

Description

@miklschmidt

I think this might be a little aggressive, it was such a pain in the ass that i found myself writing my glamor styles differently (slightly hacky), just to avoid the extra work. What does this add to code consistency? Isn't it just an aesthetical preference? I'd much rather be forced to not quote my object keys and only have them quoted when it's necessary. I think a rule is bad if it makes people write worse code, as is the case here.

i am now doing this:

css({
	'&': {
		background: Styles.colors.grayLight,
		border: `1px solid ${Styles.colors.grayDark}`,
		borderRadius: 15,
		color: Styles.colors.buttonColor,
		cursor: 'pointer',
		display: 'flex',
		flex: '0 0 auto',
		fontSize: 12,
		margin: '20px 20px',
		padding: '2px 5px',
	},
	'& .fav': {
		borderLeft: `1px solid white`,
		flex: '0 0 auto',
		fontSize: 16,
		padding: '1px 4px 0px 7px',
	},
});

instead of this:

css({
	'background': Styles.colors.grayLight,
	'border': `1px solid ${Styles.colors.grayDark}`,
	'borderRadius': 15,
	'color': Styles.colors.buttonColor,
	'cursor': 'pointer',
	'display': 'flex',
	'flex': '0 0 auto',
	'fontSize': 12,
	'margin': '20px 20px',
	'padding': '2px 5px',
	'& .fav': {
		borderLeft: `1px solid white`,
		flex: '0 0 auto',
		fontSize: 16,
		padding: '1px 4px 0px 7px',
	},
});

Please don't tell me to disable the rule on a case by case basis, i'm already doing it for one rule in all my components because @autobind isn't supported, and another because alphabetic key sorting rarely makes sense in css (or ever, but that's another discussion), if i have to disable this too it's gonna add a lot of boilerplate comments, and i suspect it won't be the last.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions