8000 test(typescript-estree): update babel alignment tests by armano2 · Pull Request #3024 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

test(typescript-estree): update babel alignment tests #3024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/typescript-estree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"tsutils": "^3.17.1"
},
"devDependencies": {
"@babel/code-frame": "^7.12.11",
"@babel/code-frame": "^7.12.13",
"@babel/parser": "^7.12.15",
"@babel/types": "^7.12.12",
"@babel/types": "^7.12.13",
"@types/babel__code-frame": "^7.0.2",
"@types/debug": "*",
"@types/glob": "*",
Expand Down
26 changes: 9 additions & 17 deletions packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ tester.addFixturePatternConfig('typescript/basics', {
*/
'interface-with-extends-member-expression',
/**
* Was expected to be fixed by PR into Babel: https://github.com/babel/babel/pull/9302
* But not fixed in Babel 7.3
* TODO: Investigate differences
* https://github.com/typescript-eslint/typescript-eslint/issues/2998
*/
'type-import-type',
'type-import-type-with-type-parameters-in-type-reference',
Expand All @@ -371,30 +369,24 @@ tester.addFixturePatternConfig('typescript/basics', {
*/
'export-named-enum-computed-string',
/**
* Babel: TSTypePredicate includes `:` statement in range
* ts-estree: TSTypePredicate does not include `:` statement in range
* https://github.com/babel/babel/issues/12676
* Babel: TSTypePredicate does not include `asserts` statement in range
* ts-estree: TSTypePredicate does include `asserts` statement in range
* https://github.com/babel/babel/pull/12763
*/
'type-assertion-in-arrow-function',
'type-assertion-in-function',
'type-assertion-in-interface',
'type-assertion-in-method',
'type-assertion-with-guard-in-arrow-function',
'type-assertion-with-guard-in-function',
'type-assertion-with-guard-in-interface',
'type-assertion-with-guard-in-method',
'type-guard-in-arrow-function',
'type-guard-in-function',
'type-guard-in-interface',
/**
* [BABEL ERRORED, BUT TS-ESTREE DID NOT]
* This is intentional; we don't error on semantic problems for these cases
*/
'class-with-constructor-and-type-parameters',
'class-with-two-methods-computed-constructor',
'catch-clause-with-invalid-annotation',
'export-type-star-from',
'import-type-error',
/**
* [TS-ESTREE ERRORED, BUT BABEL DID NOT]
* TODO: report this to babel
*/
'catch-clause-with-invalid-annotation',
/**
* babel does not take into account leading character into union and intersection
* https://github.com/babel/babel/pull/12758
Expand Down
5 changes: 5 additions & 0 deletions packages/typescript-estree/tests/ast-alignment/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ export function preprocessBabylonAST(ast: BabelTypes.File): any {
};
}
},
TSTypePredicate(node) {
if (!node.typeAnnotation) {
node.typeAnnotation = null;
}
},
MethodDefinition(node) {
/**
* Babel: MethodDefinition + abstract: true
Expand Down
Loading
0