* ensure only builders starting with lowercase are used
* update generate builders to have function name starting flow lowercase
* fix bug in deprecated builders
* remove comment about not yet discussed change in next major version
* Replace lodash 'includes' usage with Array.prototype.includes
* Replace lodash 'values' usage with Object.values
* Replace lodash 'uniq' usage with Array.from(new Set(...))
* Property safety: ensure that ignoreSuites/ignoreTasks are populated prior to access
* Property safety: ensure that blacklistTypes is populated prior to access
* Revert "Replace lodash 'values' usage with Object.values"
This reverts commit 9fd3679d6db03066daee09fad0050e5292a32aa1.
* Replace lodash 'repeat' usage with String.prototype.repeat
* Replace lodash 'isinteger' usage with Number.isInteger
* Remove explicit lodash dependency from babel-generator package
* Update packages/babel-helper-transform-fixture-test-runner/src/index.js
Co-authored-by: Brian Ng <bng412@gmail.com>
* Rely on optional chaining operator as sole boolean check
* Handle additional optional chaining operator simplification
* Update type signature
Co-authored-by: Brian Ng <bng412@gmail.com>
* fix: statementlist behavior
* fixed prettier and babel-types/converter errors
* added check for first node
* remove node length check, only check if node is first
* add reset eLU if proceeding is non-empty
* fix failure for ci tests
* remove .expressions since sequence expression isn't produced
* changed test title
* 🔄 createUnionTypeAnnotation => createFlowUnionType
* ➕ add createFlowUnionType if it exists (in new versions only ⚠️)
* 🔄 use createFlowUnionType for createUnionTypeAnnotation
* ➕ add test fixture
* ➕ add removeTypeDuplicates for typescript
* ➕ add createTSUnionType for typescript
* 💊 fix ConditionalExpression for typescript
* 💊 fix ConditionalExpression
* 💊 fix added test case
* ➕ add new line at the end of the file
* 💊 types.every(f) => f(types[0])
* 🔄 bug => foo
* ➕ add TSBaseType
* ➕ add conditions NOT to break backward compatibility
* Add stricter Optional Chain node validation
Optional chains cannot start with `optional: false`. Somewhere in the `object`/`callee` tree, there must be an optional with `optional: true`.
* Print current node's type when finding an error.
* Added support for record and tuple syntax.
This commit adds support for both the hash #{} and bar {||}
syntaxes to babel-parser, as well as adds the supporting
babel-plugin-syntax-record-and-tuple plugin to enable support
for the syntax. Does not include any transform for records and
tuples.
* typo
* added check to ensure recordAndTuple in babel-parser
* switched to syntaxType option instead of explicit entries for each record and tuple type
* switched to using recordAndTupleSyntaxType for generator options instead of adding to node
* added tests for generator option recordAndTupleSyntaxType
* added test for record and tuple bar syntax with flow typings
* added tests for invalid/missing recordAndTuple syntaxType parser option
* fixed flowcheck errors
* fix merge with class privates in tokenizer
* Update packages/babel-parser/src/types.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* improved recordAndTuple generator error message, added tests for invalid,missing options
* updated error messages for invalid parser syntaxType option
* updated error message
* added better error messages for when the recordAndTuple syntaxType is doesn't match the syntax used
* updated record and tuple support to use new error message templates
* added recordAndTuple to missing plugin helpers
* Fix linting
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* feat: add cloneDeepWithoutLoc
* fix: sort functions alphabetically
* doc: add documentation for the withoutLoc parameter
* test: add a test for shallow cloneWithoutLoc
* test: add loc object to node and fix test
* fix: set loc object on deeper node
* test: check loc on deeper node is null
* doc: adjust withoutLoc documentation
* fix: add withoutLoc param to deep clones
* fix: apply cloneIfNodeOrArray for leadingComments, innerComments and trailingComments
* test: add test for leadingComments, innerComments and trailingComments
* Cleanup PR
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* Add support for type only imports in TS (#11053)
* Implement "export type {}" (#11122)
* Add "exportKind: type" when needed with TS (#11157)
* Add `onlyRemoveTypeImports` option to `transform-typescript` (#11173)
* Add onlyRemoveTypeImports to preset-typescript (#11179)
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Raja Sekar <rajasekarm.dev@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Henry Zhu <smiley.we@gmail.com>
Co-authored-by: Siddhant N Trivedi <sidntrivedi012@gmail.com>
* Update Purish aliases
- Adds `Purish` to `RegexLiteral`, since it can't cause any side-effects.
- Removes `Purish` from `ClassExpression` and `ClassDeclaration`, since they can be impure with static class fields.
* Update types
* Change isReferenced to return false for object/class method parameter names.
* use indexOf instead of for-of loop
* replace `.indexOf` check with `.includes` and assume `parent.params` exists
Co-Authored-By: Justin Ridgewell <justin@ridgewell.name>
* check .params within case block for ClassMethod/ClassPrivateMethod/ObjectMethod only
* add comment clarifying that case clause fall-through is intentional
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
* fix: parameter expression closure should not have access to the declaration inside function body
* fix: renameVisitor should skip when a pattern is a scope
* address review comments