Sitelet https://web.archive.org/web/20200529214336/https://github.com/airbnb/javascript/issues/1813
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some code examples use function declarations even though guide says to only use expressions? #1813

Open
danielimmke opened this issue May 21, 2018 · 3 comments

Comments

@danielimmke
Copy link

@danielimmke danielimmke commented May 21, 2018

Section 7.1 says: "Use named function expressions instead of function declarations"

But I see a lot of code examples that are still using declarations. Ex: 12.2 and 13.4 as "Good" - is this just for simplicity sake?

@ljharb
Copy link
Collaborator

@ljharb ljharb commented May 21, 2018

It's more likely that when we switched from "use declarations" to "use expressions", we failed to clean up all the examples.

@danielimmke
Copy link
Author

@danielimmke danielimmke commented May 21, 2018

Would you like some help changing it? I am just getting into using this tool and could set aside some time to do it. I thought about running ESLint with this style guide on all of the "Good" portion of the examples.

@ljharb
Copy link
Collaborator

@ljharb ljharb commented May 22, 2018

Sure, that'd be great.

I've looked into linting the markdown - see https://github.com/ljharb/javascript/tree/lint_markdown - but ran into trouble with being able to skip, or "expect to fail", the "bad" examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.