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
Update rules to support ES2022 class fields #14857
Comments
Working on |
Checked off rules that already look good: |
Working on |
working on |
Working on |
Working on |
Working on |
Working on |
@eslint/eslint-tsc thoughts about #14591 (comment) - should the Currently, as implemented in #14591, it applies to class fields by default. If that's the desired behavior, we should fix a bug (#14591 (comment)) and update the docs to complete the task since the documentation for this rule says that it targets variables. I'm leaning toward making a separate rule so that users can enable/disable them separately. The new rule would also emphasize the fact that class field definition always creates a property, even if the initial value is not specified. It wouldn't be a blocker for v8.0.0, the task for v8.0.0 would be just to revert the change made in #14591. |
@mdjermanovic I think |
I could make a case either way for |
Working on |
#14994 fixes #14591 (comment) as agreed ( |
Working on |
Prepared #15005 to update documentation for Regarding #14591 (comment), we discussed that question in #14979 and decided to not make any changes for now. |
Working on |
…#15018) * Update: update options in class-methods-use (refs #14857) * fix default option * fix review * fix * remove unnecessary listener * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/rules/class-methods-use-this.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * change example order Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
All planned tasks are done 🎉 I made a quick pass through all rules to check if anything should be additionally updated because of the new code path and new scope for class field initializers, and I didn't see any problems. If anyone finds more rules that need to be updated, please open new issues. |
What is the name of the syntax to implement?
Class fields
Please provide the TC39 URL for the syntax proposal:
Implementation Checklist
This issue tracks rules that need to be updated to support ES2022 class fields. Please add to this list if there are any additional rules that need to be updated. I've linked to any comments on the original PR for easier reference. Some rule updates may have been finished in #14591, in which case we can confirm the updates are sufficient and check off the rule here.
camelcase
Fix: camelcase ignoreGlobals shouldn't apply to undef vars (refs #14857) #14966class-methods-use-this
Update: enforceForClassFields in class-methods-use-this (refs #14857) #15018complexity
Update: support class fields in thecomplexity
rule (refs #14857) #14957computed-property-spacing
dot-notation
Fix: dot-notation false positive with private identifier (refs #14857) #14898func-name-matching
Update: support class fields in func-name-matching (refs #14857) #14964func-names
Docs: add class fields in func-names documentation (refs #14857) #14908id-denylist
: Breaking: upgrade espree and support new class features (refs #14343) #14591id-length
: Breaking: upgrade espree and support new class features (refs #14343) #14591id-match
: Breaking: upgrade espree and support new class features (refs #14343) #14591indent
keyword-spacing
Fix: keyword-spacing private name compat (refs #14857) #14946lines-between-class-members
Fix: semicolon-less style in lines-between-class-members (refs #14857) #15045no-dupe-class-members
Docs: add no-dupe-class-members examples with class fields (refs #14857) #15005Breaking: upgrade espree and support new class features (refs #14343) #14591 (comment)no-eval
no-extra-parens
Update: check class fields in no-extra-parens (refs #14857) #14906no-extra-semi
no-invalid-this
no-multi-assign
Docs: add class fields in no-multi-assign documentation (refs #14857) #14907no-self-assign
no-undef-init
Fix: no-undef-init should not apply to class fields (refs #14857) #14994Breaking: upgrade espree and support new class features (refs #14343) #14591 (comment)no-underscore-dangle
no-unreachable
Update: fix no-unreachable logic for class fields (refs #14857) #14920no-useless-computed-key
Fix: no-useless-computed-key edge cases with class fields (refs #14857) #14903operator-linebreak
Fix: handle computed class fields in operator-linebreak (refs #14857) #14915prefer-destructuring
Fix: prefer-destructuring PrivateIdentifier false positive (refs #14857) #14897prefer-exponentiation-operator
quotes
semi-spacing
semi-style
semi
Fix: Update semi for class-fields (refs #14857) #14945space-infix-ops
Are you willing to submit a pull request to implement this syntax?
We can work on these in parallel. To avoid redundant effort, please claim a rule when you start working on it.
The text was updated successfully, but these errors were encountered: