Skip to content

Commit

Permalink
Make sure all property types extend NodeProps
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Dec 19, 2024
1 parent 6f4584c commit 3ed48c7
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/argument-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Argument, ArgumentProps} from './argument';
import {Container} from './container';
import {convertExpression} from './expression/convert';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import * as sassInternal from './sass-internal';
import * as utils from './utils';

Expand All @@ -30,7 +30,7 @@ export type NewArguments =
*
* @category Expression
*/
export interface ArgumentListObjectProps {
export interface ArgumentListObjectProps extends NodeProps {
nodes?: ReadonlyArray<NewArguments>;
raws?: ArgumentListRaws;
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/argument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as postcss from 'postcss';

import {Expression, ExpressionProps} from './expression';
import {fromProps} from './expression/from-props';
import {Node} from './node';
import {Node, NodeProps} from './node';
import {ArgumentList} from './argument-list';
import * as sassInternal from './sass-internal';
import {RawWithValue} from './raw-with-value';
Expand Down Expand Up @@ -58,7 +58,7 @@ export interface ArgumentRaws {
*
* @category Expression
*/
export type ArgumentObjectProps = {
export type ArgumentObjectProps = NodeProps & {
raws?: ArgumentRaws;
value: Expression | ExpressionProps;
} & ({name?: string; rest?: never} | {name?: never; rest?: boolean});
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ConfiguredVariableProps,
} from './configured-variable';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import type * as sassInternal from './sass-internal';
import * as utils from './utils';
import {ForwardRule} from './statement/forward-rule';
Expand All @@ -37,7 +37,7 @@ export interface ConfigurationRaws {
*
* @category Statement
*/
export interface ConfigurationProps {
export interface ConfigurationProps extends NodeProps {
raws?: ConfigurationRaws;
variables:
| Record<string, ConfiguredVariableExpressionProps>
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/configured-variable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {convertExpression} from './expression/convert';
import {Expression, ExpressionProps} from './expression';
import {fromProps} from './expression/from-props';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import * as sassInternal from './sass-internal';
import {RawWithValue} from './raw-with-value';
import * as utils from './utils';
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface ConfiguredVariableRaws {
*
* @category Statement
*/
export interface ConfiguredVariableObjectProps {
export interface ConfiguredVariableObjectProps extends NodeProps {
raws?: ConfiguredVariableRaws;
name: string;
expression: Expression | ExpressionProps;
Expand Down
3 changes: 2 additions & 1 deletion pkg/sass-parser/lib/src/expression/binary-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as postcss from 'postcss';

import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import type * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {Expression, ExpressionProps} from '.';
Expand Down Expand Up @@ -33,7 +34,7 @@ export type BinaryOperator =
*
* @category Expression
*/
export interface BinaryOperationExpressionProps {
export interface BinaryOperationExpressionProps extends NodeProps {
operator: BinaryOperator;
left: Expression | ExpressionProps;
right: Expression | ExpressionProps;
Expand Down
3 changes: 2 additions & 1 deletion pkg/sass-parser/lib/src/expression/boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as postcss from 'postcss';

import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import type * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {Expression} from '.';
Expand All @@ -14,7 +15,7 @@ import {Expression} from '.';
*
* @category Expression
*/
export interface BooleanExpressionProps {
export interface BooleanExpressionProps extends NodeProps {
value: boolean;
raws?: BooleanExpressionRaws;
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/sass-parser/lib/src/expression/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as postcss from 'postcss';

import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import type * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {Expression} from '.';
Expand All @@ -14,7 +15,7 @@ import {Expression} from '.';
*
* @category Expression
*/
export interface NumberExpressionProps {
export interface NumberExpressionProps extends NodeProps {
value: number;
unit?: string;
raws?: NumberExpressionRaws;
Expand Down
3 changes: 2 additions & 1 deletion pkg/sass-parser/lib/src/expression/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as postcss from 'postcss';

import {Interpolation, InterpolationProps} from '../interpolation';
import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import type * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {Expression} from '.';
Expand All @@ -15,7 +16,7 @@ import {Expression} from '.';
*
* @category Expression
*/
export interface StringExpressionProps {
export interface StringExpressionProps extends NodeProps {
text: Interpolation | InterpolationProps;
quotes?: boolean;
raws?: StringExpressionRaws;
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/interpolation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {convertExpression} from './expression/convert';
import {fromProps} from './expression/from-props';
import {Expression, ExpressionProps} from './expression';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import {RawWithValue} from './raw-with-value';
import type * as sassInternal from './sass-internal';
import * as utils from './utils';
Expand Down Expand Up @@ -39,7 +39,7 @@ export type NewNodeForInterpolation =
*
* @category Expression
*/
export interface InterpolationObjectProps {
export interface InterpolationObjectProps extends NodeProps {
nodes: ReadonlyArray<NewNodeForInterpolation>;
raws?: InterpolationRaws;
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/parameter-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as postcss from 'postcss';
import {Container} from './container';
import {Parameter, ParameterProps} from './parameter';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import * as sassInternal from './sass-internal';
import * as utils from './utils';

Expand All @@ -29,7 +29,7 @@ export type NewParameters =
*
* @category Statement
*/
export interface ParameterListObjectProps {
export interface ParameterListObjectProps extends NodeProps {
nodes?: ReadonlyArray<NewParameters>;
raws?: ParameterListRaws;
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass-parser/lib/src/parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {convertExpression} from './expression/convert';
import {Expression, ExpressionProps} from './expression';
import {fromProps} from './expression/from-props';
import {LazySource} from './lazy-source';
import {Node} from './node';
import {Node, NodeProps} from './node';
import {ParameterList} from './parameter-list';
import * as sassInternal from './sass-internal';
import {RawWithValue} from './raw-with-value';
Expand Down Expand Up @@ -57,7 +57,7 @@ export interface ParameterRaws {
*
* @category Statement
*/
export type ParameterObjectProps = {
export type ParameterObjectProps = NodeProps & {
raws?: ParameterRaws;
name: string;
} & (
Expand Down
5 changes: 3 additions & 2 deletions pkg/sass-parser/lib/src/statement/forward-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import type {AtRuleRaws} from 'postcss/lib/at-rule';
import {Configuration, ConfigurationProps} from '../configuration';
import {StringExpression} from '../expression/string';
import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import {RawWithValue} from '../raw-with-value';
import * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {ContainerProps, Statement, StatementWithChildren} from '.';
import {Statement, StatementWithChildren} from '.';
import {_AtRule} from './at-rule-internal';
import {interceptIsClean} from './intercept-is-clean';
import * as sassParser from '../..';
Expand Down Expand Up @@ -89,7 +90,7 @@ export interface ForwardMemberProps {
*
* @category Statement
*/
export type ForwardRuleProps = ContainerProps & {
export type ForwardRuleProps = NodeProps & {
raws?: ForwardRuleRaws;
forwardUrl: string;
prefix?: string;
Expand Down
5 changes: 3 additions & 2 deletions pkg/sass-parser/lib/src/statement/use-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import type {AtRuleRaws} from 'postcss/lib/at-rule';
import {Configuration, ConfigurationProps} from '../configuration';
import {StringExpression} from '../expression/string';
import {LazySource} from '../lazy-source';
import {NodeProps} from '../node';
import {RawWithValue} from '../raw-with-value';
import * as sassInternal from '../sass-internal';
import * as utils from '../utils';
import {ContainerProps, Statement, StatementWithChildren} from '.';
import {Statement, StatementWithChildren} from '.';
import {_AtRule} from './at-rule-internal';
import {interceptIsClean} from './intercept-is-clean';
import * as sassParser from '../..';
Expand Down Expand Up @@ -53,7 +54,7 @@ export interface UseRuleRaws extends Omit<AtRuleRaws, 'params'> {
*
* @category Statement
*/
export type UseRuleProps = ContainerProps & {
export type UseRuleProps = NodeProps & {
raws?: UseRuleRaws;
useUrl: string;
namespace?: string | null;
Expand Down
2 changes: 1 addition & 1 deletion pkg/sass-parser/lib/src/statement/variable-declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface VariableDeclarationRaws
*
* @category Statement
*/
export type VariableDeclarationProps = {
export type VariableDeclarationProps = NodeProps & {
raws?: VariableDeclarationRaws;
namespace?: string;
variableName: string;
Expand Down

0 comments on commit 3ed48c7

Please sign in to comment.