💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
Comes from the brace style section in Distributive's JavaScript Style Guide.
Examples of incorrect code for this rule:
function helloWorld() {
console.log('hello, world');
}
var foo = function foo()
{
var a = [1, 2, 3];
};
Examples of correct code for this rule:
function helloWorld()
{
console.log('hello, world');
}
try
{
for (let i=0; i < 10; i++)
{
console.log(i);
}
}
catch(error) {}
var foo = function foo() {
var a = [1, 2, 3];
};
var bar = () => {
var b = [4, 5, 6];
};
module.exports.foo2 = function foo2() {
var a = [1, 2, 3];
};
If you don't plan on following this brace style.