quote-props
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"quote-props": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
var object = {
foo: "bar",
baz: 42
};var object = {
"a": 0,
"0": 0,
"true": 0,
"null": 0
};var object1 = {
foo: "bar",
"baz": 42,
"qux-lorem": true
};
var object2 = {
'foo': 'bar',
baz: 42
};var object1 = {
"foo": "bar",
"baz": 42,
"qux-lorem": true
};
var object2 = {
'foo': 'bar',
'baz': 42,
'qux-lorem': true
};
var object3 = {
foo() {
return;
}
};var object1 = {
"a-b": 0,
"0x0": 0,
"1e2": 0
};
var object2 = {
foo: 'bar',
baz: 42,
true: 0,
0: 0,
'qux-lorem': true
};
var object3 = {
foo() {
return;
}
};var object1 = {
"foo": "bar",
"baz": 42,
"qux-lorem": true
};
var object2 = {
'foo': 'bar',
'baz': 42
};
var object3 = {
foo: 'bar',
baz: 42
};Examples from the ESLint documentation.
quote-props
eslint
export default [
{
rules: {
"quote-props": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require quotes around object literal property names in <template>
Enforce the use of variables within the scope they are defined
Require for-in loops to include an if statement
Disallow the use of alert, confirm, and prompt