279 Commits

Author SHA1 Message Date
Sosuke Suzuki
94d116052f
[ts] Allow modifiers as names of methods with type parameters (#12356) 2020-11-18 15:29:02 +01:00
Huáng Jùnliàng
b564368d6e
refactor: reorder checkLVal parameters (#12346)
* refactor: reorder checkLVal parameters

* update allow list

* Apply suggestions from code review
2020-11-17 09:07:32 -05:00
Nicolò Ribaudo
3e0fa927c0
Final configuration changes in preparation for TS (#12351) 2020-11-12 16:09:29 +01:00
Nicolò Ribaudo
2984f0cb88
Use the correct context when re-using a cached NodePath (#12331) 2020-11-10 15:03:21 +01:00
Nicolò Ribaudo
f80478c06d Prepare repository for gradual flow->ts migration (#12317)
Co-authored-by: Bogdan Savluk <savluk.bogdan@gmail.com>
2020-11-09 23:17:24 +01:00
Álvaro Mondéjar
b649f8d192
Fix packages documentation README links. (#12289) 2020-10-30 21:19:21 +01:00
Huáng Jùnliàng
2782a549e9
Refactor yield await classification (#12230)
* fix: incomplete ParamKind declaration

* refactor: add expression scope handler

* test: update test262 allowlist

* chore: cleanup

* fix: push expression scope for function body

* fix: push new expression scope for initializer and static block

* test: add more test cases

* fix flow error

* refactor: remove unecessary expression scope

* fix: parameter initializer error should not cross expression scope boundary

* chore: cleanup outdated comments

* fix: do not record async arrow error on ParameterDeclaration

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

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

* polish: clear ancestry declaration error on validate

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-26 11:42:02 -04:00
Brian Ng
d51aa6d761
[ts] Allow optional binding pattern parameters within types/interfaces (#12227) 2020-10-21 08:16:43 -05:00
Nicolò Ribaudo
63567f0667
Run jest's tests in the e2e tests (#12202)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-10-16 23:19:39 +02:00
Huáng Jùnliàng
1964c961ae
chore: update test262 tests (#12204) 2020-10-16 16:55:10 -04:00
Nicolò Ribaudo
02975b9ae1
Use a yarn plugin to manage releases (#12138) 2020-10-14 21:43:53 +02:00
Nicolò Ribaudo
3fd963fdc8
[ts] Add support for template interpolations in types (#12131)
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:15:42 +02:00
Sosuke Suzuki
a4a14caee7
Throw a syntax error for empty type parameter/argument (#12088) 2020-09-22 08:26:30 -05:00
Sosuke Suzuki
7028a14c7f
fix: throw for constructors with type parameters (#12065)
* Throw a syntax error for a constructor with type parameters

* Modify to match error location with TypeScript

* Update typescript parser tests

Update allowlist.txt
2020-09-17 13:03:33 -04:00
Huáng Jùnliàng
3fad7eab9b
Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <merceyz@users.noreply.github.com>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-25 14:37:30 -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
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
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
Brian Ng
8a1d7e41f2 Allow unknown/any in TS catch clause param (#11755) 2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
e498bee10f
replace whitelist by allowlist in parser-tests (#11727) 2020-06-17 15:32:46 -04:00
Bogdan Savluk
4108524856
Update prettier to v2 (#11579)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-07 22:21:33 +02:00
Justin Ridgewell
bda759ac3d Handle private access chained on an optional chain (#11248)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-05-26 22:18:17 +02:00
fisker Cheung
a33f0d83be
Fix typo (#11603) 2020-05-24 13:28:55 -04:00
Huáng Jùnliàng
dcd23c7949
chore: update test262 (#11590) 2020-05-21 08:20:10 -05:00
Huáng Jùnliàng
2f31ecf85d
fix: allow bigInt in method name and TSLiteralType (#11547)
* refactor: add isLiteralPropertyName to parser utils

* address review comments [skip-ci]

* refactor: keyword is valid identifierName

* fix: allow bigint in TSLiteralType

* update typescript test whitelist
2020-05-14 18:40:52 -04:00
Brian Ng
1a2f67191c
Update flow test whitelist (#11459) 2020-04-21 16:39:40 -05:00
Nicolò Ribaudo
2c31587aa1
Fix createSuper in Babel <7.5.5 (#11341)
* Fix createSuper in Babel <7.5.5

In Babel <7.5.5, addHelper only throws when called for the first time.
This was fixed by babel/babel#10208, but since we are already adding
a workaround for <7.9.0, we may as well fix <7.5.5

* Use 7.0.0 in "babel-old-version" test
2020-04-02 17:52:50 +02:00
Nicolò Ribaudo
548cb3ee89
Fix e2e publish test when branching from an older version (#11347)
* Fix e2e publish test when branching from an older version

* Fix

* Fix

* Fix
2020-03-30 12:55:52 -04:00
Nicolò Ribaudo
9b976b2164
Test Babel compiled using an old version of @babel/core (#11319)
* Test Babel compiled using an old version of @babel/core

This should catch regressions where we use a new helper without a fallback
for older versions, or when we use a new @babel/traverse method.

* Enable the test
2020-03-23 22:42:40 +01:00
Huáng Jùnliàng
1a1454328b
chore: replace yarn-upgrade by bump-babel-dependencies in e2e tests (#11021)
* chore: pin yarn version in e2e vue tests

* fix: replace yarn-upgrade by bump-babel-dependencies

* chore: update e2e-cra test
2020-01-17 07:55:29 -05:00
Huáng Jùnliàng
a0a9c64a47
chore: test against babel-preset-app (#11004) 2020-01-13 18:30:37 -05:00
Nicolò Ribaudo
a677d59a63
Archive syntax plugins enabled by default (#10820)
* Remove syntax plugins enabled by default

Moved to babel-archive: babel/babel-archive@8f23ddce03

- `@babel/plugin-syntax-async-generators`
- `@babel/plugin-syntax-bigint`
- `@babel/plugin-syntax-dynamic-import`
- `@babel/plugin-syntax-json-strings`
- `@babel/plugin-syntax-nullish-coalescing-operator`
- `@babel/plugin-syntax-object-rest-spread`
- `@babel/plugin-syntax-optional-catch-binding`
- `@babel/plugin-syntax-optional-chaining`

* Fix build script

* Fix jest config

* Remove archived plugins from tests
2020-01-13 00:31:48 +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
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
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
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
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
Huáng Jùnliàng
a7dac49518 chore: workaround yarn issue (#10958) 2020-01-04 11:35:24 +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
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
Huáng Jùnliàng
875e9619b7
chore: refine e2e test scripts (#10918) 2019-12-24 12:25:23 -05:00
Nicolò Ribaudo
4f77a5aaad
e2e test: create-react-app (#10704)
* e2e test: create-react-app

* Fix

* Fix

* Fix

* Fix
2019-12-16 22:13:23 +01:00
Huáng Jùnliàng
a0bed42aec
Bundle standalone using rollup (#10779)
* chore: bundle babel-standalone via rollup

Co-authored-by: Daniel Tschinder <daniel.tschinder@researchgate.net>

* chore: build babel-preset-env-standalone via Rollup

# Conflicts:
#	yarn.lock

* chore: add babelEnvName

* chore: farewell webpack

* chore: add terser minification

* chore: dedupe some popular dependencies

* chore: remove unused devDependencies

* chore: move plugin-babel-source to scripts/

* make prettier happy

* fix: rewrite available-plugins into esm

* chore: add extra unambiguous sources when env is rollup/standalone
2019-12-04 23:09:52 -05:00
Huáng Jùnliàng
2b472912e4
Tune makefile scripts (#10781)
* chore: replace node by `yarn node`

* chore: fix tsc command

* chore: use `yarn` to wrap node

* chore: supress yarn run output

* chore: disable silent mode for builtin yarn command
2019-12-04 22:28:25 -05:00
Nicolò Ribaudo
e74efd2c0a Run parser tests from the official TypeScript parser (#10444) 2019-12-03 01:09:54 +01:00
Nicolò Ribaudo
7195f0d8cf Unify logic for running parser tests from external suites (#10444) 2019-12-03 01:09:54 +01:00
Huáng Jùnliàng
683adcbb70 Reduce standalone build size (#10668)
* infra: build standalone against src

* infra: add absoluteRuntime

# Conflicts:
#	babel.config.js

* chore: remove `process.env` replace

* add $ to signify exact match

credits to Nicolò
2019-11-21 14:31:38 +01:00
Raja Sekar
f087cf842f Mocha to jest migration for eslint packages (#10716)
* migrated mocha to jest

* migrated mocha to jest - 2

* migrated mocha to jest - removed preversion hook from script

* migrated mocha to jest - 3

* migrated mocha to jest - 4

* cleanup

* review

* review
2019-11-16 12:32:19 +01:00
Nicolò Ribaudo
5ca8acdb38
Do not automatically publish eslint packages (#10722)
* Do not automatically publish eslint packages

* Fix

* Fix

* Fix

* Fix

* Fix
2019-11-16 11:09:18 +01:00