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

Bug: TS2729: Property is used before its initialization. #118

Open
2 tasks done
ElPrudi opened this issue Mar 26, 2024 · 0 comments
Open
2 tasks done

Bug: TS2729: Property is used before its initialization. #118

ElPrudi opened this issue Mar 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ElPrudi
Copy link

ElPrudi commented Mar 26, 2024

Describe the bug

Inside classes, if you reuse properties inside other properties, the ordering will lead to an error depending on how they are named.

Code example

class TheClass {
  x = new XProperty()

  // Create model from properties
  model = [this.x]
}

will lead to

class TheClass {
   // Create model from properties
   // Error TS2729: Property 'x' is used before its initialization.
  model = [this.x]
  x = new XProperty()
}

ESLint version

v8.57.0

ESLint Plugin Perfectionist version

v2.7.0

Additional comments

I don't know if this is a good programming standard as I'm just using a framework that generates this kind of code OOB.

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant