Skip to content

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

Closed
@Goodwine

Description

@Goodwine

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions