xabikos / vscode-javascript

Contains the code snippets for JavaScript (ES6) development in VS Code editor
MIT License
332 stars 137 forks source link

edf encourages bad code #62

Closed dantman closed 4 years ago

dantman commented 5 years ago

Documentation says that edf outputs export default (parameter) => { console.log(parameter);};.

This isn't a very good snippet since no-one should ever write code like this. enf is ok because anonymous/arrow functions get names from variable declarations. But an anonymous function does not get any name.

As a result the default exported function from this snippet will have no name in logs/debugging and will not be smart-imported by vscode.

export default function ${1:${TM_FILENAME_BASE}}(parameter) { ... would work better.

xabikos commented 4 years ago

Closed as implemented