Sosuke Suzuki
7f5b212322
babel-parser: Add new typescript plugin option dts: boolean ( #13113 )
2021-04-28 18:24:18 +02:00
Nicolò Ribaudo
22b0eb038f
[ts] Enforce order for the override modifier ( #13209 )
...
* [ts] Enforce order for the `override` modifier
* generator
* Add more checks
* Update TS tests
2021-04-28 18:21:31 +02:00
George Zahariev
8433cd0c05
Support parsing Flow's Optional Indexed Access Types ( #13224 )
2021-04-28 18:21:31 +02:00
Nicolò Ribaudo
57daba85aa
Parse string export names by default (moduleStringNames) ( #13195 )
...
* Parse string epxort names by default (`moduleStringNames`)
* Remove remaining references
2021-04-28 18:21:31 +02:00
Huáng Jùnliàng
ceaab0bae7
Parse class fields and private methods by default ( #13175 )
...
* feat: materialize class features
* chore: move testcases to es2022
* chore: update test fixtures
* chore: remove classPr\w+ from options.json
* chore: remove empty options.json
* update flow test allowlist
* update typescript allowlist
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
b116865077
Use this.isThisParam in typescript parser ( #13163 )
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
c949660b34
babel-parser: Deep freeze for makeErrorTemplates ( #13142 )
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
7484b51e56
Support TS 4.3 get/set type members ( #13089 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
2521c666f7
Add internal ESLint rule for consistent parser error messages ( #13130 )
2021-04-28 18:21:31 +02:00
Pig Fang
bf14a106ad
Support TS 4.3 override syntax in class ( #13097 )
...
* support TS 4.3 `override` syntax in class
* fix types
* fix types
* tweak error message
* update TypeScript commit
* split tests
* add more tests
* update allowlist
* disallow `override` with `declare`
* disallow `override` in non-sub class
* update TypeScript allowlist
* rename error message key
* add more tests
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
f8aa32f767
Support parsing Flow's Indexed Access Types ( #13053 )
2021-04-28 18:21:31 +02:00
Pig Fang
eac0259ce2
Support TS 4.3 static index signature in classes ( #13096 )
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
0ee98139a6
Introduce parser error codes ( #13033 )
2021-04-28 18:21:31 +02:00
Huáng Jùnliàng
10f4d08efb
refactor: avoid parsing logic on locations ( #13200 )
2021-04-25 09:15:48 -04:00
Federico Ciardi
368bf893fa
[ts] raise SyntaxError for declare before getter/setter ( #13143 )
...
* fix: raise `SyntaxError` for `declare` before getter/setter
* fix: allow `declare` when class property name is `get` or `set`
2021-04-17 23:00:24 +02:00
Federico Ciardi
42e630e8a2
Allow trailing comma after rest parameter in TSDeclareFunction ( #13101 )
...
* fix(ts): allow trailing comma after rest parameter in `TSDeclareFunction`
* Apply code review changes
Co-Authored-By: Nicolò Ribaudo <7000710+nicolo-ribaudo@users.noreply.github.com>
2021-04-06 18:36:17 +02:00
Federico Ciardi
7fe3ebf4db
fix: raise SyntaxError for unparenthesized assert and assign ( #13099 )
...
* fix: raise `SyntaxError` for unparenthesized assert and assign
* chore
2021-04-06 16:07:13 +02:00
Huáng Jùnliàng
8efbac4a5d
fix: the LHS in for-of loop should not start with let ( #13049 )
...
* fix: the LHS in for-of loop should not start with let
* Update packages/babel-parser/src/parser/statement.js
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-29 16:54:23 -04:00
Huáng Jùnliàng
0067fd9e02
Disallow await before exponential ( #12441 )
...
* refactor: move unary exponential check to parseMaybeUnary
* fix: disallow await before exponential
* add test cases
2021-03-25 11:20:47 -04:00
Federico Ciardi
4f727139ec
fix(ts): Allow parenthesized "assert and assign" ( #12933 )
...
Co-authored-by: Nicolò Ribaudo <7000710+nicolo-ribaudo@users.noreply.github.com>
2021-03-22 17:00:03 +01:00
Sosuke Suzuki
beb7cf8b24
Sort error keys with ESLint ( #13020 )
2021-03-18 21:01:57 +01:00
Huáng Jùnliàng
0988c471e9
Parse type imports in TSImportEqualsDeclaration ( #12962 )
2021-03-14 23:34:49 +01:00
Huáng Jùnliàng
1a05b81387
Support multiple static blocks ( #12738 )
2021-03-12 23:29:55 +01:00
Sosuke Suzuki
b416847b61
(ts) Raise syntax error for abstract methods with a body ( #12687 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-02 11:57:58 +01:00
Huáng Jùnliàng
efdca01409
fix: add tokens when tokens: true is passed to parseExpression ( #12939 )
2021-03-01 14:09:56 -05:00
Sosuke Suzuki
b62fc3d44f
babel-parser(flow): Set this property to null for FunctionTypeAnnotation without parens ( #12930 )
...
* Add null property to FunctionTypeAnnotation without parens
* Update tests
* Update tests
2021-03-01 09:15:43 -05:00
Nicolò Ribaudo
c30039029a
Don't enable class features by default in estree ( #12867 )
...
* Don't enable class features by default in `estree`
* Flow
* Reduce breakage
2021-02-23 11:30:01 +01:00
Huáng Jùnliàng
03d7911be6
Implement class features in estree ( #12370 )
...
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
2021-02-21 20:12:12 +01:00
Sosuke Suzuki
9c567baa9b
Parse JS Module Blocks proposal ( #12469 )
2021-02-21 20:08:20 +01:00
Sosuke Suzuki
e4588bed22
Support TypeScript 4.2 abstract constructor signatures ( #12628 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-21 20:07:55 +01:00
George Zahariev
5b99b8f221
Flow Enums with unknown members support ( #12193 )
...
* Flow Enums with unknown members parsing
* Updates after rebase
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-21 18:42:23 +01:00
Daniel Sainati
16e9f1c8e5
Support Flow this parameter annotations ( #12234 )
2021-02-21 17:44:27 +01:00
Federico Ciardi
8e9143f06f
fix(ts): parse multiline declarations correctly ( #12776 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-16 23:51:24 +01:00
Ikko Ashimine
4819ce70e4
refactor: fix typo in error.js ( #12808 )
...
postion -> position
2021-02-16 12:35:58 -05:00
Sosuke Suzuki
c22e72eb24
Raise recoverable error for type members with invalid modifiers ( #12785 )
2021-02-12 17:20:06 +01:00
Nicolò Ribaudo
c07185207c
[parser] Fix scope handling of Flow declared functions ( #12735 )
2021-02-10 21:07:14 +01:00
Sosuke Suzuki
f1a327506e
ts: Throw recoverable for duplicates access modifier ( #12775 )
...
* Support parsing for duplicates access modifiers
Support parsing for duplicates access modifiers
* Fix lint problems
* Address reviews
2021-02-09 09:59:06 +01:00
Sosuke Suzuki
d242ea04c8
babel-parser(ts): Raise recoverable error for abstract interface ( #12771 )
...
* Support parsing abstract interface
* Address review
Address reviews
Address reviews
* Fix types
* Add hasFollowingLineBreak
2021-02-09 09:56:18 +01:00
Nicolò Ribaudo
e735266dee
Avoid importing .json files ( #12759 )
...
* Avoid importing `.json` files
* Use ESold in babel.config.json
* Use `import/extensions` eslint plugin
2021-02-05 23:34:36 +01:00
Federico Ciardi
bf523da0b0
fix(ts): include asserts in TSTypePredicate location ( #12763 )
2021-02-05 20:02:41 +01:00
Federico Ciardi
eccbcca948
[TS] Create TSUnionType or TSIntersectionType when typealias has a leading operator ( #12758 )
...
* Create `TSUnionType` or `TSIntersectionType` when typealias has a leading operator
* Apply code review suggestions
* Test `TSIntersectionType`
2021-02-05 20:00:27 +01:00
Federico Ciardi
d1cf66e8c1
fix(ts): include leading operator in TSUnionType and TSIntersectionType locations ( #12757 )
2021-02-04 19:24:35 +01:00
Federico Ciardi
94ba66c89b
fix(ts): allow abstract methods with export default abstract class ( #12748 )
2021-02-03 09:48:41 -05:00
Stuart Cook
20664a430e
Permit %%placeholder%% in left-hand-side of a let declaration ( #12725 )
...
* Permit %%placeholder%% in left-hand-side of a let declaration
* Test that "let" followed by modulo is still treated as an identifier
* More tests for edge-case handling of "let" with placeholders enabled
2021-02-01 20:00:21 -05:00
Huáng Jùnliàng
ecfe20395b
spec: disable await binding identifier within static block ( #12661 )
2021-02-01 21:55:43 +01:00
Huáng Jùnliàng
108564fdad
refactor: raise AwaitNotInAsyncContext when an AwaitExpression will be parsed ( #12716 )
...
* refactor: raise AwaitNotInAsyncContext when an AwaitExpression will be parsed
* tweak logic
* early exit when errors are before thrown error position
* fix: always return true in assert.throws callback
See https://nodejs.org/api/assert.html#assert_assert_throws_fn_error_message
* update test fixtures
* fix flow error
2021-02-01 10:46:43 -05:00
Nicolò Ribaudo
8cf0a757d5
Recover from "missing semicolon" errors ( #12437 )
...
* Recover from "missing semicolon" errors
* Update other tests
* Fix flow
* Fix windows test
* Add back deleted test
2021-02-01 10:08:43 +01:00
Sosuke Suzuki
45fdde0ce2
(ts) Throw for abstract methods in a non-abstract class ( #12686 )
2021-01-27 18:56:55 +01:00
Federico Ciardi
fbfd1b2aa6
fix(parser): throw error with wrong typescript 'export declare' ( #12684 )
2021-01-26 22:51:12 -06:00
Sosuke Suzuki
8fcba6eb55
Raise recoverable error for await expressions in sync functions ( #12520 )
2021-01-24 01:45:27 +01:00