💻
How are you using Babel?
Programmatic API (babel.transform, babel.parse)
Input code
export declare const enum Foo {
foo = 1,
bar
}
export declare enum Foo {
foo = 1,
bar
}
class AssertsFoo {
isBar(): asserts this is string {
return;
}
isBaz = (): asserts this is string => {
return;
}
}
Configuration file name
No response
Configuration
require('@babel/parser').parse(text, {
sourceType: 'unambiguous',
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
ranges: true,
plugins: [
[ 'estree', { classFeatures: true }, ],
'decorators-legacy',
'classStaticBlock',
'importAssertions',
'typescript',
],
});
Current and expected behavior
"index" property is added to loc.start of TSTypePredicate and TSEnumDeclaration
this property is present only on those 2 nodes and it's with us since version 7.17.x
{
"end": { "column": 1, "line": 4 },
- "start": { "column": 7, "index": 7, "line": 1 }
+ "start": { "column": 7, "line": 1 }
}
Environment
Possible solution
No response
Additional context
https://github.com/typescript-eslint/typescript-eslint/blob/1fb31a4b3e05734f801ade0450fea33494e4d5e6/packages/typescript-estree/tests/ast-alignment/utils.ts#L284-L297
💻
How are you using Babel?
Programmatic API (
babel.transform,babel.parse)Input code
Configuration file name
No response
Configuration
Current and expected behavior
"index" property is added to loc.start of
TSTypePredicateandTSEnumDeclarationthis property is present only on those 2 nodes and it's with us since version 7.17.x
{ "end": { "column": 1, "line": 4 }, - "start": { "column": 7, "index": 7, "line": 1 } + "start": { "column": 7, "line": 1 } }Environment
Possible solution
No response
Additional context
https://github.com/typescript-eslint/typescript-eslint/blob/1fb31a4b3e05734f801ade0450fea33494e4d5e6/packages/typescript-estree/tests/ast-alignment/utils.ts#L284-L297