sonarjs/arrow-function-convention
eslint-plugin-sonarjs
No autofix
eslint.config.js
export default [
{
rules: {
"sonarjs/arrow-function-convention": "error",
},
},
];Braces and parentheses should be used consistently with arrow functions
var foo = (a) => { /* ... */ }; // Noncompliant; remove parens from arg
var bar = (a, b) => { return 0; }; // Noncompliant; remove curly braces from bodyvar foo = a => { /* ... */ };
var bar = (a, b) => 0;Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sonarjs/arrow-function-convention
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/arrow-function-convention": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
IAM policies should not grant access to all account resources
Optional boolean parameters should have default value
Class methods should be used instead of "prototype" assignments