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

Remove the tsconfig option useDefineForClassFields and fix relevant TS files #2419

Open
Goodwine opened this issue Oct 29, 2024 · 1 comment
Assignees

Comments

@Goodwine
Copy link
Member

The recent update on gts included new settings for tsconfig.json. Specifically, it turned on useDefineForClassFields. And this changes the Typescript behavior in how/when class properties get initialized.

Related: microsoft/TypeScript#45995 (comment)

The task for this Issue with regards to sass-parser is to find all properties initialized with !, and replace them with a declare statement, for example:

class X {
  // BAD:
  _foo!: string;
}
class X {
  // GOOD:
  declare _foo: string;
}

Otherwise, the observed behavior for our PostCSS subnode classes is that all the values get reset after they get initialized to their "default" values.

@Goodwine
Copy link
Member Author

some properties may be defined with ? instead of !. So I guess the thing to do here is to check everything thoroughly

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

No branches or pull requests

1 participant