Commit Graph
8 Commits
Author SHA1 Message Date
fisker CheungandGitHub 434b21e9e9 Enable unicorn/prefer-set-has rule (#16822)
* Enable `unicorn/prefer-set-has` rule

* Run `--fix`

* `yarn dedupe`

* Fix

* fix
2024-09-10 13:19:44 -04:00
Nicolò RibaudoandGitHub 8feed887a3 Replace chalk with picocolors (#16359) 2024-03-19 10:23:42 +01:00
liuxingbaoyuandGitHub 336cd34ecd chore: Improve external parser tests (#14911)
* improve runner

* update allowlist

* review
2022-09-07 10:40:32 +02:00
89497780d5 Type-safe ParseErrors (#14320)
* Flow ParseError version.

Reviewed by @tolmasky.

* Begin updating everything.

Reviewed by @tolmasky.

* Convert more.

Reviewed by @tolmasky.

* Add more.

Reviewed by @tolmasky.

* Fix.

Reviewed by @tolmasky.

* Just switch everything to exact types.

Reviewed by @tolmasky.

* Style fixes.

Reviewed by @tolmasky.

* Fix remaining style issues and remove unecessary dry-error-messages.

Reviewed by @tolmasky.

* Don't use enums and address more issues.

Reviewed by @tolmasky.

* More fixes.

Reviewed by @tolmasky.

* Workaround for import situation.

Reviewed by @tolmasky.

* Fix a bunch of errors messages.

Reviewed by @tolmasky.

* Fix some flow stuff.

Reviewed by @tolmasky.

* Add a way to specify code.

Reviewed by @tolmasky.

* Fix lint errors.

Reviewed by @tolmasky.

* Fix Flow errors.

Reviewed by @tolmasky.

Another Flow things.

Reviewed by @tolmasky.

Fix Flow error.

Reviewed by @tolmasky.

Fix flow errors.

Reviewed by @tolmasky.

Fix flow error.

Reviewed by @tolmasky.

* See if this gets the name right.

Reviewed by @tolmasky.

* Add comments to raise and raiseOverwrite.

Reviewed by @tolmasky.

* Remove forward declaration.

Reviewed by @tolmasky.

* Change option to be kind.

Reviewed by @tolmasky.

* Fix for ambient context not being respected in variable declarations.

Reviewed by @tolmasky.

* Make IllegalBreakContinue based on type.

Reviewed by @tolmasky.

* Begin moving checkLVal to type-based system instead of contextDescription-based system, and fix let error in the process as well.

Reviewed by @tolmasky.

* Switch to isValidLVal.

Reviewed by @tolmasky.

* Don't use checkLVal for class names.

Reviewed by @tolmasky.

* Fix some Flow errors.

Reviewed by @tolmasky.

* Temporary fix for Flow error.

Reviewed by @tolmasky.

* Remove unused stuff.

Reviewed by @tolmasky.

* Try this.

Reviewed by @tolmasky.

* Don't use Object.fromEntries.

Reviewed by @tolmasky.

* Fix linter error.

Reviewed by @tolmasky.

* Fix for SyntaxError.

Reviewed by @tolmasky.

* Add TS1039 Initializers are not allowed in ambient contexts. to error-codes.js.

Reviewed by @tolmasky.

* Add TS1155 'const' declarations must be initialized.

Reviewed by @tolmasky.

* Allow consts with literals.

Reviewed by @tolmasky.

* Add enum support.

Reviewed by @tolmasky.

* Add filename to test runner to correctly identify .d.ts files.

Reviewed by @tolmasky.

* Only ignore reserved words in ambient contexts. Parse interface in parseStatementContent. Fix enums.

Reviewed by @tolmasky.

* Fix simple parameter error.

Reviewed by @tolmasky.

* Type references should allow reserved words (I believe we were just getting away with the fact that we turned reserved words off before).

Reviewed by @tolmasky.

* Allow import and export in TypeScript regardless of module or script.

Reviewed by @tolmasky.

* Fix declare enum and interface and reorganize the code a bit.

Reviewed by @tolmasky.

* Fix for keywords in export as.

Reviewed by @tolmasky.

* Fix reserved words in import types.

Reviewed by @tolmasky.

* Rename files.

Reviewed by @tolmasky.

* Add 1

* Remove files form allowlist that no longer need to be there.

Reviewed by @tolmasky.

* Parse as separate files and switch to only using error codes.

Reviewed by @tolmasky.

* Fix reading files with different encodings.

Reviewed by @tolmasky.

* Fix outside tests.

Reviewed by @tolmasky.

* Change test to pass since typescript should allow import.

Reviewed by @tolmasky.

* Update tests that should fail.

Reviewed by @tolmasky.

* Add tests for complex let assignments.

Reviewed by @tolmasky.

* Choose a better name for these.

Reviewed by @tolmasky.

* Add tests for a number of left-hand side expressions.

Reviewed by @tolmasky.

* Change name to kind.

Reviewed by @tolmasky.

* Choose better parameter names for these errors.

Reviewed by @tolmasky.

* Use error credentials and error details.

Reviewed by @tolmasky.

* Fix some names and add comments.

Reviewed by @tolmasky.

* Get rid of unused option.

Reviewed by @tolmasky.

* Better names.

Reviewed by @tolmasky.

* Split out pipeline errors and choose better names.

Reviewed by @tolmasky.

* Clean up LVal stuff.

reviewed by @tolmasky.

* Use "unambiguous" to determine whether to parse typescript tests as module or script, and stop always allowing imports in Typescript.

Reviewed by @tolmasky.

* Revert test to previous state.

Reviewed by @tolmasky.

* Better name for this.

Reviewed by @tolmasky.

* Add these back in.

Reviewed by @tolmasky.

* Add these.

Reviewed by @tolmasky.

* Fix flow errors and use toNodeDescription in more places.

Reviewed by @tolmasky.

* Rename LHSParent to LValAncestor.

Reviewed by @tolmasky.

* Add ParseError.clone and change symbol name to DefaultMessage from NoMessage.

Reviewed by @tolmasky.

* Change name to identifierName in a bunch of places.

Reviewed by @tolmasky.

* Fix for using type.

Reviewed by @tolmasky.

* Better names.

Reviewed by @tolmasky.

* Clean up API and add comments.

Reviewed by @tolmasky.

* Change name.

Reviewed by @tolmasky.

* Better names.

Reviewed by @tolmasky.

* Minor comment fix.

Reviewed by @tolmasky.

* Remove no longer used method.

Reviewed by @tolmasky.

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

* Minor grammar changes to comments.

Reviewed by @tolmasky.

* Use trim instead of slice(0, -1).

Reviewed by @tolmasky.

* Add a comment to explain the tagged template stuff.

Reviewed by @tolmasky.

* Use maxArgumentCount.

Reviewed by @tolmasky.

* Don't allow UpdateExpression without prefix.

Reviewed by @tolmasky.

* Add tds test for no-initializer.

Reviewed by @tolmasky.

* Make this test test ASI and not const initializers.

Reviewed by @tolmasky.

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

* Change template string to normal string and remove default.

Reviewed by @tolmasky.

* Get rid of ParseError class and use SyntaxErrors instead.

Reviewed by @tolmasky.

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

Co-authored-by: Huáng Jùnliàng <[email protected]>

* Remove this comment since we don't need this argument anymore.

Reviewed by @tolmasky.

* Use this in toMessage and restore clone method.

Reviewed by @tolmasky.

* Make sure pos and missingPlugin are enumerable.

Reviewed by @tolmasky.

* Make typescript tests faster by checking the bom manually.

Reviewed by @tolmasky.

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

* Update packages/babel-parser/src/plugins/estree.js

Co-authored-by: Nicolò Ribaudo <[email protected]>

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

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

Co-authored-by: Nicolò Ribaudo <[email protected]>

* Clarify const enum initialization comment.

Reviewed by @tolmasky.

* Fix Flow being angry because __proto__: null makes it think that the return type can be null.

Reviewed by @tolmasky.

* Don't automatically set DTS on the typescript plugin based on filename.

Reviewed by @tolmasky.

* Fix duplicated export error.

Reviewed by @tolmasky.

Co-authored-by: Nicolò Ribaudo <[email protected]>
Co-authored-by: Huáng Jùnliàng <[email protected]>
2022-03-08 09:36:40 -05:00
83dc04c654 Use native ESM for dev scripts (#12296)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2021-01-30 18:36:21 +01:00
Huáng JùnliàngandGitHub 77125d1ed9 replace whitelist by allowlist in parser-tests (#11727) 2020-06-17 15:32:46 -04:00
f5d89ac429 Update prettier to v2 (#11579)
Co-authored-by: Nicolò Ribaudo <[email protected]>
2020-06-07 22:21:33 +02:00
Nicolò Ribaudo 08fc0f4355 Run parser tests from the official TypeScript parser (#10444) 2019-12-03 01:09:54 +01:00