286 Commits

Author SHA1 Message Date
Simen Bekkhus
2d35f5a8f7
fix(code-frame): do not pad gutter of empty lines (#12567)
* fix(code-frame): do not pad gutter of empty lines

* Add workaround for expected Jest e2e test failure

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-12-29 15:26:13 +01:00
Nicolò Ribaudo
d9dfd29ce8
Archive @babel/polyfill (#12541)
babel/babel-archive@701775cd9f
2020-12-22 16:52:40 +01:00
Nicolò Ribaudo
17d62c3743
refactor: Move react-jsx-development implementation into react-jsx (#12524)
* Move react-jsx-development implementation into react-jsx

* Move helper-builder-jsx-experimental into transform-react-jsx

* Move JSX validation

* Move Program visitor

* introduce get/set utils

* pre -> getTag

* Dedupe code

* post -> getState

* Simplify logic

* Move final pieces

* Other simplifications

* Update lockfile

* Fix standalone bundling
2020-12-22 11:53:14 +01:00
Huáng Jùnliàng
0f866ed9d2
Add a workflow to update test262 tests weekly (#12523)
* chore: draft update parser tests workflow

* Build babel parser

* chore: use Babel bot as git user name

* use babel-bot token

* refactor: use actions/github-script

* rename
2020-12-21 10:04:57 -05:00
Bogdan Savluk
1290d215f1 Convert @babel/types to TS (#12431)
* babel-types flowts convert
* babel-types code generation updates
* babel-types add more generated types to src (copy logic from scripts/typescript)
* babel-types update generateBuilders to specify exact argument types
* babel-types fix deprecated types generation
* babel-types fixes
* babel-types fix potential bug
* babel-types update generateBuilders, to include proper return types
* babel-types backport types from generated index.d.ts to be included in sources
* babel-types fixes
* babel-types avoid export of builders starting with upper case in ts sources
* babel-types
* babel-types todo updates, small fixes
* babel-types generate helpers
* babel-types remove typescript definitions generation
* babel-types generate files
* babel-types copy d.ts file for deprecated ast node creators into lib folder
* babel-types use t as alias for ast node types namespace
* babel-types update generateBuilders script to use "t" as alias instead of "types"
* babel-types update deprecated builders generation to have more compact file
* babel-types publish the .d.ts file for `@babel/types`
* Publish the .d.ts file for `@babel/types`
* Fix flowcheck
* Prettier
* No need to lint generated .d.ts files (now they are generated by tsc)
* Run prepublish-prepare-dts from prepublish-build
* Fix Babel 8 tests
* Update codecov config
* babel-types more improvements
  - better type for gatherSequenceExpressions
  - mark createUnionTypeAnnotation as deprecated
  - fix createTSUnionType
  - babel-types better type for builder
  - other improvements from PR comments
* babel-types lint fix
* babel-types fix createTSUnionType
* Don't commit .d.ts file in lib, and rename "deprecated"->"uppercase" for builders
* Add back types for TS 3.7
* Update packages/babel-types/package.json
* Cleanup converters types

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-12-10 21:22:10 +01:00
Huáng Jùnliàng
e5b2680756
Move some build steps to gulp (#12127)
* chore: move generate-standalone to gulp tasks

* move build-flow-typings to gulp tasks

* chore: move build-typescript-typings to gulp tasks

* move generate-type-helpers to gulp tasks

* chore: include build-typings and generate-type-helpers in gulp build

* update generate-standalone comments

* address review comments

* chore: revert build-typings refactor

* fix: run build-typings in build-no-bundle
2020-12-10 12:25:16 -05:00
Bogdan Savluk
5067edfdd9
Updates for tsconfig generation (#12420)
* improve makefile to not remove tsconfigs already in git

* update tsconfig generation script to include packages in eslint and codemods folders

* use git clean
2020-12-09 10:27:55 -05:00
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