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

Documentation for 'no-use-before-define' is missing #2708

Closed
cseas opened this issue Jan 8, 2023 · 7 comments · Fixed by #2773
Closed

Documentation for 'no-use-before-define' is missing #2708

cseas opened this issue Jan 8, 2023 · 7 comments · Fixed by #2773

Comments

@cseas
Copy link

cseas commented Jan 8, 2023

The rule is set to error in the config:

'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],

But there's no mention of it in the guide:
https://github.com/airbnb/javascript/blob/master/README.md

This rule should be mentioned under the Variables section.

@ljharb
Copy link
Collaborator

ljharb commented Jan 8, 2023

I’d probably expect it in https://github.com/airbnb/javascript#hoisting.

@MohitBansal321
Copy link

MohitBansal321 commented Feb 22, 2023

@ljharb let me know where you should want to put it in
maybe we need to add on 14.1, 14.2, and 14.3 of hoisting

@ljharb
Copy link
Collaborator

ljharb commented Feb 22, 2023

@MohitBansal321 I think we actually need a new 14.5 talking about why relying on hoisting should be avoided.

@MohitBansal321
Copy link

MohitBansal321 commented Feb 23, 2023

no-use-before-define

so this rule is only applicable to the new 14.5? @ljharb

@ljharb
Copy link
Collaborator

ljharb commented Feb 23, 2023

Yes, because the guide doesn't actually discuss not relying on hoisting, but the config has been enforcing that for a very long time.

@Vivek-04022001
Copy link

Could you please let me know if this issue is still open for contributions? If so, I would be very interested in working on it. Thank you!

@ljharb
Copy link
Collaborator

ljharb commented Mar 24, 2023

@Vivek-04022001 please stop commenting that; if it's open, has the PR wanted label, and has no linked PR, then it's always open for contributions, and the way to "claim" it is to put up a PR that links to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment