* Ensure non-standard types have an appropriate alias
This helps with filter out the types. Eg, I'm concerned with just the core JS types, and in I can derive them via:
```typescript
type Core = Exclude<t.Node, t.TypeScript | t.Flow>;
```
* Lint
* Export deprecated alias types
* Add docs descriptions for new aliases
* Add Standardized alias
* Fix inherits aliases
* Filter aliases from node types
* Remove Proposal alias
* docs: refine babel-types docs generator
* avoid AST node shape title when it does not have node fields
* remove h1 from the output
* refactor docs generators
* 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>
* 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
* 🔄 createUnionTypeAnnotation => createFlowUnionType
* ➕ add createFlowUnionType if it exists (in new versions only ⚠️)
* 🔄 use createFlowUnionType for createUnionTypeAnnotation
* 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>
This adds lots of missing declarations to the types of @babel/types,
including many utility functions useful to plugin authors.
With the typescript types, I tried to make them as useful as possible
for control flow analysis / inference, but Flow doesn't seem to
support overloads and I'm not as familiar with it anyway so it has
simpler types.
Flow maybe types state;
> Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined.
So in this case, explicitly allow the type, null, or undefined in the
typescript definition.
Fixes#10403
* feat: v8intrinsic syntax plugin
Implement V8 Intrinsic Syntax Extension. Here we check the execution branch inside the parseSubscript to make sure the V8IntrinsicIdentifier is immediately followed by a call expression.
* feat: disable combining placeholders and v8intrisic
per https://github.com/babel/babel/issues/10104#issuecomment-506950969
* test: add more error cases
* refactor: parse v8 intrinsic in parseExprAtom
This approach is identical to V8’s implementation. Move the test cases as the behaviour changes.
* fix: plugin-name typo
* test: add yield-expression test case
* feat: require startsExpr on modulo for v8intrinsic
* perf: skip eof and braceR check as they must return false
* Print V8IntrinsicIdentifier
* feat: add v8intrinsic to parser typings
* Add generated type helpers
* fix: incorrect type definition
* fix: allow V8IntrinsicIdentifier to be callee
* babel-types is* type checks accept null | undefiend as value TS type
* Use | null | undefined instead of any, make Flow type nullable
* Also change flow types of generated src