13880 Commits

Author SHA1 Message Date
Yuku Kotani
00b974298b
Move some @babel/traverse from deps to devDeps (#11937) 2020-08-10 11:36:09 -05:00
Huáng Jùnliàng
4bb1e164da
Refactor [In] production parameter tracking (#11930)
* refactor: track [In] parameter in prodParam

* Apply suggestions from code review
2020-08-10 07:32:38 -04:00
Huáng Jùnliàng
fccf31aca6
chore: do not push version commit on lerna version (#11936) 2020-08-10 07:29:52 -04:00
Babel Bot
199ee60571 Add v7.11.3 to CHANGELOG.md [skip ci] 2020-08-08 20:09:53 +00:00
Huáng Jùnliàng
57b658c4d8 v7.11.3 2020-08-08 15:59:38 -04:00
Huáng Jùnliàng
48e793e964
fix: add ImportExpression visitorKeys (#11932) 2020-08-08 15:44:22 -04:00
Алексей
32744b2346
fixed the names of the rules (#11933) 2020-08-08 13:34:11 -04:00
Huáng Jùnliàng
a827ca41f3
refactor: simplify smart pipeline parsing (#11919) 2020-08-05 21:15:42 -04:00
Huáng Jùnliàng
76f033f8c7
simplify isLookaheadRelational method (#11922)
* refactor: move isLookaheadRelational to flow plugins

* refactor: simplify isLookaheadRelational to isLookaheadToken_lt
2020-08-05 20:21:35 -04:00
Huáng Jùnliàng
cd577eedfd
refactor: add recoverable error on accessorIsGenerator (#11921)
* refactor: add recoverable error on accessorIsGenerator

* Update packages/babel-parser/src/parser/error-message.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* Apply suggestions from code review

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-08-05 17:52:13 -04:00
Brian Ng
c0f6f0394d
Support ConditionalExpressions in dry-error-messages rule (#11917)
* Support ConditionalExpressions in dry-error-messages rule

* tests
2020-08-05 16:28:35 -04:00
Huáng Jùnliàng
50b3262063
refactor: avoid unnecessary property access (#11918)
* refactor: avoid unnecessary property access

* refactor: `else` is redundant because keyName is const
2020-08-05 15:39:45 -04:00
Babel Bot
acf2b144a4 Add v7.11.2 to CHANGELOG.md [skip ci] 2020-08-05 14:31:08 +00:00
Huáng Jùnliàng
bc7a811fce v7.11.2 2020-08-05 10:15:43 -04:00
Huáng Jùnliàng
92434269af
fix: do not eat get/set after async is parsed (#11916) 2020-08-05 08:19:59 -05:00
Babel Bot
de75d4f081 Add v7.11.1 to CHANGELOG.md [skip ci] 2020-08-04 22:13:36 +00:00
Huáng Jùnliàng
953ae82159 v7.11.1 2020-08-04 17:58:35 -04:00
Huáng Jùnliàng
a1eabb84ea
rescan gt/lt token after TsAsExpression is parsed (#11912)
* refactor: move inType checks to flow plugin

* polish: replace hardcoded char codes

* fix: rescan greater/less token after asExpression is parsed
2020-08-04 17:00:21 -04:00
Devon Govett
c29138fd72
Do not cache non-existent files forever (#11906) 2020-08-04 16:07:25 -04:00
Huáng Jùnliàng
a4ebe29b3f
Parser refactoring (#11871)
* refactor: parseMaybeUnary => parseUnary

* refactor: extract shouldExitDescending method

* refactor: add parseUpdate

* refactor: avoid comparing with hardcoded token value

* refactor: add ParseNewOrNewTarget

* refactor: add parseCoverCallAndAsyncArrowHead

* add parseBind

* refactor: polish parseTaggedTemplateExpression interface

* refactor: add parseMember method

* refactor: add parseSuper method

* refactor: add parseAsyncArrowUnaryFunction method

* fix: disallow line break before async binding arrow

* refactor: simplify tt.name logic

* refactor: add parseDo method

* refactor: misc

* refactor: rename parseObjectMember by parsePropertyDefinition

* refactor: unify set/get/async keyword parsing in ObjectMethod

* refactor: misc

* refactor: add parseArrayLike method

* refactor: move fsharp epilogure and prologue inside parseObjectLike

* fixup

* refactor: rename parseFunctionExpression to parseFunctionOrFunctionSent

* refactor: remove redundant logic

* refactor: rename parseClassPropertyName by parseClassElementName

* refactor: avoid unecessary lookahead when parsing tt._export

* fix: export-default-from should support escaped async as export binding

* address review comments

* parseUnary -> parseMaybeUnary
2020-07-31 20:36:04 -04:00
Huáng Jùnliàng
ad60153a98
Update @babel/* deps (#11899)
* chore: remove extra install step for eslint packages

* chore: update babel deps
2020-07-31 20:35:19 -04:00
Huáng Jùnliàng
c41dcd045b
fix: ensure […map.keys] can be correctly transformed in loose mode (#11901) 2020-07-31 14:26:22 -05:00
Huáng Jùnliàng
08054181c3
docs: remove experimental warning on README (#11900) 2020-07-31 13:13:30 -04:00
Babel Bot
231328aafc Add v7.11.0 to CHANGELOG.md [skip ci] 2020-07-30 21:31:37 +00:00
Huáng Jùnliàng
45fdb87747 v7.11.0 2020-07-30 17:12:07 -04:00
Kai Cataldo
f7ec170ba3
update: hardcode @babel/eslint-parser min supported version check (#11896)
* update: change babel-eslint-parser version mismatch error to log

* Bump @babel/core version

* Change to 7.2.0

* Add period to error message
2020-07-30 15:45:43 -04:00
Oliver Dunk
db56261414
Skip TSAsExpression when transforming spread in CallExpression (#11404)
* Skip TSAsExpression when transforming spread in CallExpression

* Create @babel/helper-get-call-context package

* Support OptionalCallExpressions

* Use helper in optional chaining plugin, and move tests

* Update package.json files

* Use dot notation to access property

* Remove private method tests until future MR

* Update packages/babel-plugin-transform-spread/package.json

* Rename @babel/helper-get-call-context to @babel/helper-skip-transparent-expr-wrappers

* Handle typed OptionalMemberExpressions

* Make @babel/helper-skip-transparent-expr-wrappers a dependency

* Support TSNonNullExpressions

* Use named import instead of default

* Add test for call context when parenthesized call expression has type

* Improve handling of member expressions inside transparent expression wrappers

* Add comment explaining what a transparent expression wrapper is

* Add newlines to test fixtures

* Pass correct parameter type to skipTransparentExprWrappers

* Rename to babel-helper-skip-transparent-expression-wrappers

* Remove getCallContext helper

* Fixed exports key

* Preserve types in babel-plugin-transform-spread tests

* Use external-helpers to avoid inlining helper functions in tests

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-30 14:17:37 -04:00
Bogdan Savluk
32e7bb4027
fix build config to work the same when running on windows (#11688) 2020-07-30 14:11:58 -04:00
Ujjwal Sharma
2ac49ba7c4
add support for logical assignments with private properties (#11702)
* add support for logical assignments with private properties

Patches the logic for handling assignment operators and adds support for
handling the logical assignment operators appropriately.

Fixes: https://github.com/babel/babel/issues/11646

* replace hardcoded logical assignment operators with constant

Replace a hardcoded check for logical assignment operators with the
LOGICAL_OPERATORS constant in
plugin-proposal-logical-assignment-operators.

Refs: https://github.com/babel/babel/pull/11702#discussion_r438554423
2020-07-30 14:10:16 -04:00
James C. Davis
aa82ab6358
Typescript: always strip declare from class fields (#11747)
* test: add failing test for decorated declare

* fix: always strip declare from class fields

* test: add decorated-declare-properties test
2020-07-30 14:06:45 -04:00
Huáng Jùnliàng
4c9929ca28
Prepare to publish @babel/eslint-* packages (#11894)
* remove private flag, bump node and babel versions

* disallow submodule imports

* Revert "Do not automatically publish eslint packages (#10722)"

This reverts commit 5ca8acdb38bc7a9a4669ad3249c219531f8f6579.

# Conflicts:
#	Makefile
#	eslint/babel-eslint-parser/package.json
#	eslint/babel-eslint-plugin-development/package.json
#	lerna.json
#	scripts/integration-tests/publish-local.sh

* disable submodule imports for babel-eslint-config-internal

* chore: push back a bit to make tests happy
2020-07-30 13:32:38 -04:00
Huáng Jùnliàng
0e4cf1e6a2
chore: build standalone once in prepublish step (#11777) 2020-07-30 12:54:56 -04:00
SZ-Coder
4ce1b70ade
Fix incorrect module path when absoluteRuntime is specified (#11893)
* - Added failing tests for issue #11885.

* - Fix issue #11885: absoluteRuntime does not work as expected with corejs3.

* - Removed helper code from test output files (tests for issue #11885).

* chore: add @babel/runtime-corejs3 to dev deps

* chore: update test fixtures

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-30 10:35:37 -04:00
Huáng Jùnliàng
164a93945d
add showConfig support (#11588)
* draft: showConfig support

* feat: pass through showConfig command options

* update test file

* refactor: add createLogger to makeChainWalker

* serializing dynamic plugin instance

* fix flow errors

* chore: add tests on extended config

* fix: do not print empty presets

* add more test cases

* add windows testcases

* address review comments

* throw error when showConfigPath does not exist

* print reason when showConfig is targetting an ignored file

* remove showConfig: boolean

* refactor: simplify environment flag name

* rename test fixtures

* fix: throw when SHOW_CONFIG_FOR is not a regular file

* cleanup test fixtures

* add test on only

* Update packages/babel-core/src/config/files/configuration.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* address review comments

* update test fixtures

* feat: sort config items in ascending priority

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-30 09:24:19 -04:00
dependabot[bot]
374a253d0c
chore(deps): bump elliptic from 6.5.2 to 6.5.3 (#11891)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-29 20:26:38 -05:00
Huáng Jùnliàng
01d4625412
Correctly check reserved word for PropertyDefinition: IdentifierReference (#11862)
* fix: check IdentifierReference in PropertyDefinition

* chore: add more test cases

* fix: incorrect test title
2020-07-29 19:40:52 -04:00
Kai Cataldo
4ac9c7afe2
Upgrade to ESLint v7 (#11857)
* Upgrade to ESLint v7

* Upgrade eslint-plugin-import

* Update peer deps

* Remove max-len from ESLint config

* Update tests

* Only test babel-eslint-* packages in Node >=10

* Remove babel-eslint

* Fix linking in dev

* Add comment to Makefile

* Fix e2e tests

* Add --ignore-engines flag when installing in ESLint packages

* fix: convert tt.questionDot to Punctuator

* chore: update lockfile

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-29 19:11:48 -04:00
Huáng Jùnliàng
95fcb3e16c Update compat-table (#11890)
* chore: update compat-table

* chore: friendly to node < 14 contributors

Co-Authored-By: Brian Ng <bng412@gmail.com>

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-29 18:32:12 -04:00
morrme
2f89e72321 enable logical assignment in babel preset env (#11876)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-29 18:32:12 -04:00
Vahagn Aharonian
b651a6f6ab Enable logical assignment by default in @babel/parser (#11860) (#11869) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
0e985fb287 feat: enable numericSeparator parsing support (#11863) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
ccd98f042c Add numeric-separator to preset-env (#11865) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
cdb81d7703 Add export-namespace-from to preset-env (#11849)
* feat: add compat-data of proposal-export-namespace-from

* feat: add export-namespace-from to preset-env

* chore: update test fixtures

* address review comments
2020-07-29 18:32:12 -04:00
Nicolò Ribaudo
eba4c3b6ed TypeScript 4.0: Support labeled tuple elements (#11754)
* TypeScript 4.0: Support labeled tuple elements

* More tests

* Disallow mixing labeled and unlabeled elements

* Update AST shape

* Enable test after rebase

* Allow labeled spread types

* Fix flow

* Add types and generator suport

* Update packages/babel-parser/src/plugins/typescript/index.js

* Prettier
2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
9e6663f125 Follow-up on initial TS4 catch param support (#11767)
* refactor: align with AST shape convention

* feat: print catch param type annotations

* test: add test case on transform
2020-07-29 16:51:48 -04:00
Brian Ng
8a1d7e41f2 Allow unknown/any in TS catch clause param (#11755) 2020-07-29 16:51:48 -04:00
Nicolò Ribaudo
5b4b3a3e4a TypeScript 4.0: Allow spread in the middle of tuples (#11753) 2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
d7347fb8bd
eslint-parser: ES2020 features (#11815)
* chore: update espree test on nullish coalescing

* feat: add optional chaining support

* fix: adapt to estree AST shape

* chore: update lockfile

* add estree optional-chaining test fixtures

* address review comments

* chore: simplify smoke test

* export * support

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-29 16:46:29 -04:00
Huáng Jùnliàng
059e9124ff
Add decimal parsing support (#11640)
* docs: add DecimalLiteral to AST spec

* add decimal support

* fix: throw invalid decimal on start

* add DecimalLiteral type definitions

* update parser typings

* add generator support

* add syntax-decimal plugin

* Add syntax-decimal to babel-standalone

* add syntax-decimal to missing plugin helpers

* fix incorrect test macro
2020-07-29 16:43:15 -04:00
James Addison
9daa50e005
babel-traverse: prefer clearer, reduced-bias option naming (#11791)
* babel-traverse: prefer clearer, reduced-bias option naming

* Apply suggestions from code review

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-29 16:41:20 -04:00