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

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -