13442 Commits

Author SHA1 Message Date
Babel Bot
9647560dd6 Add v7.8.0 to CHANGELOG.md [skip ci] 2020-01-12 00:27:36 +00:00
Nicolò Ribaudo
2486615a74 v7.8.0 2020-01-12 01:09:29 +01:00
Kai Cataldo
d8e6219ad9 @babel/eslint-plugin: Update rules/tests to use @babel/eslint-parser (#10977)
* Use @babel/eslint-parser for tests

* Update rules/tests

* Update docs

* add @babel/eslint-shared-fixtures to package.json

* remove bug fix

* convert RuleTester to ESM

* Update devDep versions
2020-01-11 20:42:21 +01:00
Huáng Jùnliàng
81c5f1f22d
Disallow private name in object elements and TS type elements (#10980)
* fix: disallow private name in object member and TS type elements

* chore: update test262 whitelist

* chore: make flow happy

* Update packages/babel-parser/src/parser/expression.js

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* chore: update test fixtures

* Update packages/babel-parser/src/parser/expression.js

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

* chore: update test fixtures

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-01-11 11:26:10 -05:00
Nicolò Ribaudo
e7b80a2cb9
Improve @babel/types with env.BABEL_TYPES_8_BREAKING (#10917)
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2020-01-11 10:34:30 +01:00
Huáng Jùnliàng
405c1aaad8 Merge env-standalone to babel-standalone (#10821)
* feat: add babel-preset-env to babel-standalone

* chore: copy preset-env-standalone test

* polish: tune warning message when babel-preset-env-standalone is loaded
2020-01-11 10:31:29 +01:00
Huáng Jùnliàng
a1310333f7 chore: update corejs fixtures (#10983) 2020-01-11 09:23:58 +01:00
Huáng Jùnliàng
903ad6160d
Filename detection should respect short flags (#10763)
* chore: add test files

# Conflicts:
#	packages/babel-node/package.json

* fix: respect short flags when finding filename index

* fix: use attributeName for kebab-case
2020-01-10 20:46:19 -05:00
Anders Kaseorg
5a3e97073e CONTRIBUTING: Update link to plugin-features.js [skip ci] (#10982)
It was moved in #10899.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-01-10 20:43:10 -05:00
Yordis Prieto
4c28f54152 Add babelrc.json support (#10783)
* Add babelrc.json support

* Add tests

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-01-10 23:41:42 +01:00
Nicolò Ribaudo
ae06baf22f
Add support for babel.config.mjs and .babelrc.mjs (#10903)
* Add support for babel.config.mjs and .babelrc.mjs

* Use path.extname
2020-01-10 23:14:29 +01:00
Nicolò Ribaudo
282f81bd67
Prepare @babel/core for asynchronicity (#10507)
* Prepare @babel/core for asynchronicity

* Include regenerator-runtime in standalone build

* Fix rollup build
2020-01-10 22:44:13 +01:00
Huáng Jùnliàng
9fec528016 Reduce false negative cases of typescript parser tests (#10979)
* tests: read baesline errors for typescript parsing error

* chore: add error codes

* chore: tune the regex
2020-01-10 22:11:10 +01:00
James Beavers
80aa7dc3c6 Add optional-chaining and nullish-coalescing to preset-env (#10811)
* Add support for optional-chaining (stage 4) in present-env

* revert babel-preset-env built-in-modules.json

* add shipped proposal syntax map entry, optional chaining

* update remaining syntax plugin references, proposal description

* Add support for nullish coalescing operator in preset-env

* selectively enable sort-keys rule

* enforce sort-keys on shipped-proposals

* don't use Object.entries()

* Update fixtures
2020-01-10 22:07:43 +01:00
Kai Cataldo
4cb2148273 @babel/eslint-plugin: remove deprecated rules (#10975) 2020-01-10 20:22:39 +01:00
Siddhant N Trivedi
3dcb8ca99e Added instructions to fork the repo in order to setup. (#10973)
* Added instructions to fork the repo to setup

* Capitalized Github and Indented the guidelines

[skip ci]
2020-01-10 20:05:58 +01:00
Nicolò Ribaudo
bfc56ebbab Update Test262, Flow and TS parser tests (#10976)
* Update Test262, Flow and TS parser tests

* Updates
2020-01-10 09:50:11 -05:00
Huáng Jùnliàng
e8dac621de
chore: specify package type (#10849) 2020-01-09 21:40:15 -05:00
Huáng Jùnliàng
44f9d85904 add allowTopLevelThis option to transform-modules-systemjs (#10780)
* feat: expose rewriteThis method

* feat: add allowTopLevelThis option to transform-modules-systemjs
2020-01-10 03:16:26 +01:00
Nicolò Ribaudo
04354d1556
Extract targets parser and compat data from preset-env (#10899)
* Extract targets parser and compat data from preset-env

* Review by Jùnliàng

* isItemRequired -> targetsSupported

* Export isRequired
2020-01-10 03:15:20 +01:00
jack
5f807ae45b Enable optional chaining by default in @babel/parser (#10817) 2020-01-10 03:09:39 +01:00
ZYSzys
646409b23e Use babel > as prompt in babel-node (#9695) 2020-01-10 03:04:02 +01:00
Raja Sekar
8415065d99 --copy-ignored flag added to CLI (#10887)
* prevent ignored files in out dir

* added includeIgnore cli option

* Help text change

* Update packages/babel-cli/src/babel/options.js

Copy review.

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

* review comments

* throw error if copyIgnored is used without ignore flag

* check for ignored files

* duplicate pathToPattern fn in babel/cli

* change implementation

* removed ignore option from cliOption

* added test case with ignore in config

* added test case with ignore in config

* review

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-01-10 03:03:37 +01:00
Sebastian Silbermann
3af02f63de Add --out-file-extension option to babel-cli (#9144)
* Add --use-file-extension option to babel-cli

* refactor file extension logic

use existing methods from path module

* Rename use-file-extension -> out-file-extension

* add error message if bot keep- and out-file-extension is used

* add test for error when mixing --keep- and --out-file-extension

* poke travis
2020-01-10 03:02:52 +01:00
Oleksandr Fediashov
c3388ea42f Enable nullish coalescing by default in @babel/parser (#10819)
* move files, remove hasPlugin() & expectPlugin()

* restore permissions
2020-01-10 02:52:53 +01:00
Abdul Ali
5b907e9bb7 [parser] enable dynamic import by default (#10843)
* [parser] enable dynamic import by default

* chore: add back babel-core api test
2020-01-10 02:28:52 +01:00
Huáng Jùnliàng
7bc22e42f5 StringNumericLiteral does not include NumericLiteralSeparator (#10938) 2020-01-10 02:28:16 +01:00
Nicolò Ribaudo
771c730fda
[parser] Disallow duplicate and undeclared private names (#10456)
* [parser] Add private names tracking to Scope

- Disallow duplicate private names
- Disallow undeclared private names

* Update tests

* Test all possible duplications

* Test undeclared private names

* Better error message for top-level private names

* Fix flow

* Update test262 whitelist

* Update fixtures

* Update flow whitelist

* Remove old output.json

* Move ClassScopeHandler to a separate class

* Make the code readable
2020-01-10 02:22:05 +01:00
Huáng Jùnliàng
9f148a1603 chore: update caniuse-usage fixtures (#10974) 2020-01-10 00:38:21 +01:00
Huáng Jùnliàng
09cb4273bc update corejs-compat fixtures (#10967)
* update corejs-compat fixtures

* chore: bump core-js-compat to 3.6.2
2020-01-07 18:43:14 +01:00
Huáng Jùnliàng
8fd532db39
LiteralPropertyName should allow BigIntLiteral (#10955)
* fix: property name should allow BigIntLiteral

* test: add non decimal test case

* add bigintIndex to whitelist
2020-01-07 10:23:50 -05:00
Nicolò Ribaudo
3fa37d2da3 Bump coverage target from 80% to 90% (#10964) 2020-01-05 18:08:50 -05:00
Nicolò Ribaudo
4636321f06
Make @babel/transform-runtime's absoluteRuntime/relative test meaningful (#10963) 2020-01-05 17:28:44 +01:00
Huáng Jùnliàng
a7dac49518 chore: workaround yarn issue (#10958) 2020-01-04 11:35:24 +01:00
Huáng Jùnliàng
03d163a0d9
Use chrome data when android is absent (#10790)
* chore: rename test folder

* chore: add test case

* fix: use chrome support data when android is absent

* chore: add type annotation

* chore: add testcases last 2 versions not ie

* chore: bump browerslist to v4.8.2

* chore: update test fixtures

* chore: update test fixtures
2020-01-03 18:26:27 -05:00
Huáng Jùnliàng
455d782ef0 test: add invalid-lone-import test (#10950)
* test: add lone import test

* polish: raise recoverable error
2020-01-03 23:08:59 +01:00
Huáng Jùnliàng
a28353703f fix: check await when parsing AsyncArrowBindingIdentifier (#10953) 2020-01-03 23:08:28 +01:00
Huáng Jùnliàng
467667af88 When reading a new string, U+2028/2029 should correctly set th… (#10944)
* test: add test on template

* fix: update lineStart when string contains U+2028/U+2029
2020-01-03 23:07:54 +01:00
Huáng Jùnliàng
6ee8c97e6a Fix: TopLevelAwait should respect await identifiers defined in… (#10947) 2020-01-03 23:07:11 +01:00
Huáng Jùnliàng
e5048053aa Add integration test: e2e-vue-cli (#10919)
* chore: add e2e-vue-cli test

* chore: add node-browsers-executor

* chore: state why node-browsers-executor is required
2020-01-03 23:06:13 +01:00
Kai Cataldo
9f832c2716
@babel/eslint-parser: Fix ClassPrivateMethods (#10913) 2020-01-02 18:36:58 -05:00
Jayen Ashar
daaa2063bb Override toString in case this function is printed (#10949)
* Override toString in case this function is printed

Related to https://stackoverflow.com/questions/59543968/unexpected-return-value-from-visitor-method

* Don't override `toString` if `wrapper` is true

Override `toString` immediately before returning a newFn, otherwise it will be overridden if wrapper is true

https://github.com/babel/babel/pull/10949#discussion_r362302625

* prettier
2020-01-01 15:36:20 +01:00
Huáng Jùnliàng
26eb891870
fix: Class Field Initializer should not allow await expression as immediate child (#10946)
* fix: scope.inAsync should exclude reference in class property initializers

* chore: add test on await in computed class property

* fix flow error :(
2019-12-31 09:36:03 -05:00
Huáng Jùnliàng
0238244268
refactor: remove unecessary checkYieldAwaitInDefaultParams (#10936) 2019-12-30 16:12:09 -05:00
Huáng Jùnliàng
2f3f77926d
refactor: remove unused invalidTemplateEscapePosition tokenizer state (#10935)
* refactor: remove unused invalidTemplateEscapePosition tokenizer state

* fix flow error
2019-12-30 16:11:56 -05:00
Huáng Jùnliàng
30449fe05d
Refactor parseSubscript (#10937)
* refactor: unify optionalMemberExpression generation

* test: add optional calls invalid typecasts

* fix: do not parse async arrow when call is optional

* test: update test fixtures
2019-12-30 16:11:39 -05:00
Huáng Jùnliàng
86245a83a2
TSTypeCastExpression should not be inside call parameters (#10939) 2019-12-30 16:10:19 -05:00
Huáng Jùnliàng
197a8da04d
Remove unused parser methods (#10942)
* chore: remove unused isStrictBody

* chore: remove unused eatRelational
2019-12-30 16:09:50 -05:00
Huáng Jùnliàng
314513374d
chore: update test262 (#10943)
* chore: update test262

* chore: ignore untoggleable features
2019-12-29 21:35:19 -05:00
Klaus Meinhardt
b91720c1cc helper-module-transforms: dereference imported template tag (#10934)
* Dereference imported template tag

* apply fix for OptionalCallExpression as well
2019-12-28 16:46:20 -05:00