javascript icon indicating copy to clipboard operation
javascript copied to clipboard

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

Open cseas opened this issue 3 years ago • 7 comments

The rule is set to error in the config: https://github.com/airbnb/javascript/blob/1eadb93e377da1e56c3f91f26610e5d0a00738a9/packages/eslint-config-airbnb-base/rules/variables.js#L54

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.

cseas avatar Jan 08 '23 03:01 cseas

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

ljharb avatar Jan 08 '23 05:01 ljharb

@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

MohitBansal321 avatar Feb 22 '23 09:02 MohitBansal321

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

ljharb avatar Feb 22 '23 17:02 ljharb

no-use-before-define

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

MohitBansal321 avatar Feb 23 '23 05:02 MohitBansal321

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

ljharb avatar Feb 23 '23 06:02 ljharb

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!

Vivek-04022001 avatar Mar 24 '23 18:03 Vivek-04022001

@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.

ljharb avatar Mar 24 '23 18:03 ljharb