dot-notation
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"dot-notation": "error",
},
},
];const x = foo["bar"];const x = foo.bar;
const y = foo[bar]; // Property name is a variable, square-bracket notation requiredExamples from the ESLint documentation.
dot-notation
eslint
export default [
{
rules: {
"dot-notation": "error",
},
},
];Oxlint does not have this rule.
complexity/useLiteralKeys
complexity · since 1.0.0
{
"linter": {
"rules": {
"complexity": {
"useLiteralKeys": "error"
}
}
}
}Enforce dot notation whenever possible
Enforce dot notation whenever possible in <template>
Require constructor names to begin with a capital letter
Disallow labels that share a name with a variable
Enforce default clauses in switch statements to be last