Skip to content

Commit a74f9c3

Browse files
authored
Enable useDefineForClassFields and fix affected TS files. (#2447)
* Enable useDefineForClassFields and fix affected TS files. Fixes #2419 Turning off this TS compiler option is deprecated, and it will be removed "soon". It's annoying.. but oh well.
1 parent 5740eb5 commit a74f9c3

20 files changed

+29
-35
lines changed

pkg/sass-parser/lib/src/configured-variable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class ConfiguredVariable extends Node {
100100
* This is the parsed and normalized value, with underscores converted to
101101
* hyphens and escapes resolved to the characters they represent.
102102
*/
103-
name!: string;
103+
declare name: string;
104104

105105
/** The expresison whose value the variable is assigned. */
106106
get expression(): Expression {
@@ -112,10 +112,10 @@ export class ConfiguredVariable extends Node {
112112
if (value) value.parent = this;
113113
this._expression = value;
114114
}
115-
private _expression!: Expression;
115+
private declare _expression: Expression;
116116

117117
/** Whether this has a `!default` guard. */
118-
guarded!: boolean;
118+
declare guarded: boolean;
119119

120120
constructor(defaults: ConfiguredVariableProps);
121121
/** @hidden */

pkg/sass-parser/lib/src/expression/binary-operation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class BinaryOperationExpression extends Expression {
7676
// TODO - postcss/postcss#1957: Mark this as dirty
7777
this._operator = operator;
7878
}
79-
private _operator!: BinaryOperator;
79+
private declare _operator: BinaryOperator;
8080

8181
/** The expression on the left-hand side of this operation. */
8282
get left(): Expression {
@@ -89,7 +89,7 @@ export class BinaryOperationExpression extends Expression {
8989
left.parent = this;
9090
this._left = left;
9191
}
92-
private _left!: Expression;
92+
private declare _left: Expression;
9393

9494
/** The expression on the right-hand side of this operation. */
9595
get right(): Expression {
@@ -102,7 +102,7 @@ export class BinaryOperationExpression extends Expression {
102102
right.parent = this;
103103
this._right = right;
104104
}
105-
private _right!: Expression;
105+
private declare _right: Expression;
106106

107107
constructor(defaults: BinaryOperationExpressionProps);
108108
/** @hidden */

pkg/sass-parser/lib/src/expression/boolean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class BooleanExpression extends Expression {
4444
// TODO - postcss/postcss#1957: Mark this as dirty
4545
this._value = value;
4646
}
47-
private _value!: boolean;
47+
private declare _value: boolean;
4848

4949
constructor(defaults: BooleanExpressionProps);
5050
/** @hidden */

pkg/sass-parser/lib/src/expression/number.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class NumberExpression extends Expression {
5454
// TODO - postcss/postcss#1957: Mark this as dirty
5555
this._value = value;
5656
}
57-
private _value!: number;
57+
private declare _value: number;
5858

5959
/** The denominator units of this number. */
6060
get unit(): string | null {
@@ -64,7 +64,7 @@ export class NumberExpression extends Expression {
6464
// TODO - postcss/postcss#1957: Mark this as dirty
6565
this._unit = unit;
6666
}
67-
private _unit!: string | null;
67+
private declare _unit: string | null;
6868

6969
/** Whether the number is unitless. */
7070
isUnitless(): boolean {

pkg/sass-parser/lib/src/expression/string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class StringExpression extends Expression {
5555
text.parent = this;
5656
this._text = text;
5757
}
58-
private _text!: Interpolation;
58+
private declare _text: Interpolation;
5959

6060
// TODO: provide a utility asPlainIdentifier method that returns the value of
6161
// an identifier with any escapes resolved, if this is indeed a valid unquoted
@@ -75,7 +75,7 @@ export class StringExpression extends Expression {
7575
// TODO - postcss/postcss#1957: Mark this as dirty
7676
this._quotes = quotes;
7777
}
78-
private _quotes!: boolean;
78+
private declare _quotes: boolean;
7979

8080
constructor(defaults: StringExpressionProps);
8181
/** @hidden */

pkg/sass-parser/lib/src/interpolation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class Interpolation
104104
// This *should* only ever be called by the superclass constructor.
105105
this._nodes = nodes;
106106
}
107-
private _nodes?: Array<string | Expression>;
107+
private declare _nodes?: Array<string | Expression>;
108108

109109
/** Returns whether this contains no interpolated expressions. */
110110
get isPlain(): boolean {

pkg/sass-parser/lib/src/parameter-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class ParameterList
9797
// This *should* only ever be called by the superclass constructor.
9898
this._nodes = nodes;
9999
}
100-
private _nodes?: Array<Parameter>;
100+
private declare _nodes?: Array<Parameter>;
101101

102102
/**
103103
* The name of the rest parameter (such as `args` in `...$args`) in this

pkg/sass-parser/lib/src/statement/css-comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class CssComment
7878
textInterpolation.parent = this;
7979
this._textInterpolation = textInterpolation;
8080
}
81-
private _textInterpolation?: Interpolation;
81+
private declare _textInterpolation?: Interpolation;
8282

8383
constructor(defaults: CssCommentProps);
8484
/** @hidden */

pkg/sass-parser/lib/src/statement/debug-rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class DebugRule
7878
if (debugExpression) debugExpression.parent = this;
7979
this._debugExpression = debugExpression;
8080
}
81-
private _debugExpression?: Expression;
81+
private declare _debugExpression?: Expression;
8282

8383
constructor(defaults: DebugRuleProps);
8484
/** @hidden */

pkg/sass-parser/lib/src/statement/each-rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class EachRule
107107
if (eachExpression) eachExpression.parent = this;
108108
this._eachExpression = eachExpression;
109109
}
110-
private _eachExpression?: Expression;
110+
private declare _eachExpression?: Expression;
111111

112112
constructor(defaults: EachRuleProps);
113113
/** @hidden */

0 commit comments

Comments
 (0)