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

Docs: add class fields in func-names documentation (refs #14857) #14908

Merged
merged 1 commit into from Aug 9, 2021

Conversation

mdjermanovic
Copy link
Member

@mdjermanovic mdjermanovic commented Aug 8, 2021

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

refs #14857, fixes #14591 (comment)

What changes did you make? (Give an overview)

Updated documentation for the func-names rule to clarify that as-needed logic isn't tied to ES6, and added examples with class fields and logical assignment operators.

Is there anything you'd like reviewers to focus on?

I believe the reason to specify ES6 was an expectation that future specifications might add more cases where the name is automatically assigned, e.g. a.b = function() {}, in which case the rule would become unpredictable for users and difficult to maintain (whether or not the name will be automatically assigned for the same syntax would depend on the targeted environment). However, that never happened, except for the cases with new syntax, so I think it's safe to say "per the ECMAScript specification" instead of "in an ES6 environment".

@mdjermanovic mdjermanovic added rule Relates to ESLint's core rules documentation Relates to ESLint's documentation accepted There is consensus among the team that this change meets the criteria for inclusion labels Aug 8, 2021
Copy link
Contributor

@snitin315 snitin315 left a comment

LGTM

nzakas
nzakas approved these changes Aug 9, 2021
@nzakas nzakas merged commit d234d89 into master Aug 9, 2021
13 checks passed
@nzakas nzakas deleted the funcnames-classfields branch Aug 9, 2021
bmish added a commit to bmish/eslint that referenced this pull request Aug 11, 2021
* master:
  Chore: Add rel/abs path tests in `no-restricted-{imports/modules}` rules (eslint#14910)
  Upgrade: Debug 4.0.1 > 4.3.2 (eslint#14892)
  Chore: add assertions on reporting location in `semi` (eslint#14899)
  Fix: no-useless-computed-key edge cases with class fields (refs eslint#14857) (eslint#14903)
  Upgrade: `js-yaml` to v4 (eslint#14890)
  Fix: prefer-destructuring PrivateIdentifier false positive (refs eslint#14857) (eslint#14897)
  Fix: dot-notation false positive with private identifier (refs eslint#14857) (eslint#14898)
  Sponsors: Sync README with website
  Sponsors: Sync README with website
  Docs: improve rule details for `no-console` (fixes eslint#14793) (eslint#14901)
  Update: check class fields in no-extra-parens (refs eslint#14857) (eslint#14906)
  Docs: add class fields in no-multi-assign documentation (refs eslint#14857) (eslint#14907)
  Docs: add class fields in func-names documentation (refs eslint#14857) (eslint#14908)
  Upgrade: `eslint-visitor-keys` to v3 (eslint#14902)
  Upgrade: `markdownlint` dev dependencies (eslint#14883)
  Upgrade: @humanwhocodes/config-array to 0.6 (eslint#14891)
  Chore: Specify Node 14.x for Verify Files CI job (eslint#14896)
@mdjermanovic mdjermanovic mentioned this pull request Oct 1, 2021
12 tasks
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Feb 6, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants