javascript - Prevent old style function declaration -
i want forbid old style function declarations , non-binding method declarations:
function f1() { ... } const f2 = function() { ... } class c { f3() { ... } }
instead arrow-style constants , fields must used:
const f1 = () => { ... }; class c { f3 = () => { ... }; }
is possible eslint or plugin?
check this out, there prefer-arrow-callback
rule.
Comments
Post a Comment