We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fdb8fb commit bc1f768Copy full SHA for bc1f768
1 file changed
src/parse/index.ts
@@ -38,10 +38,14 @@ function convertAst(ast: File, templates: Template[]): void {
38
case 'BlockStatement':
39
case 'ObjectExpression':
40
case 'StaticBlock': {
41
- if (!node.range) {
42
- // prettier 3.7.0 onwards removed `node.range`
43
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44
- node.range = [node.start!, node.end!];
+ if (
+ !node.range &&
+ typeof node.start === 'number' &&
+ typeof node.end === 'number'
45
+ ) {
46
+ // prettier 3.6.0 onwards doesn't have `node.range`
47
+ // as it was removed in babel
48
+ node.range = [node.start, node.end];
49
}
50
assert('expected range', node.range);
51
const [start, end] = node.range;
0 commit comments