@sprucelabs/spruce-cli 17.1.35 → 17.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/node_modules/@typescript-eslint/parser/LICENSE +22 -0
- package/node_modules/@typescript-eslint/parser/README.md +302 -0
- package/node_modules/@typescript-eslint/parser/dist/index.d.ts +4 -0
- package/node_modules/@typescript-eslint/parser/dist/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/parser/dist/index.js +13 -0
- package/node_modules/@typescript-eslint/parser/dist/index.js.map +1 -0
- package/node_modules/@typescript-eslint/parser/dist/parser.d.ts +17 -0
- package/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/parser/dist/parser.js +129 -0
- package/node_modules/@typescript-eslint/parser/dist/parser.js.map +1 -0
- package/node_modules/@typescript-eslint/parser/package.json +75 -0
- package/node_modules/@typescript-eslint/scope-manager/LICENSE +21 -0
- package/node_modules/@typescript-eslint/scope-manager/README.md +120 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ID.js +22 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ID.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts +72 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js +183 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts +62 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.js +58 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/analyze.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/assert.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/assert.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts +39 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js +19 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js +19 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js +30 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts +9 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/index.js +31 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts +16 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js +23 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js +66 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js +1283 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js +21 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js +23 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js +19 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js +13 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js +22 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js +20 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js +18 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js +24 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js +21 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js +16 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.sharedmemory.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js +114 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js +19 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js +24 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts +81 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js +165 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js +13 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js +24 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js +9 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js +28 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js +453 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +27 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +321 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts +15 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js +84 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts +14 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js +50 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts +28 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js +111 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts +89 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js +109 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +84 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +544 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts +33 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js +228 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts +13 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js +41 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts +22 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js +82 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js +6 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js +17 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts +13 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js +37 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts +18 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js +39 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts +21 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts +106 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js +363 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts +22 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js +26 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js +22 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts +20 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js +36 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts +34 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts +25 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js +19 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts +18 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js +33 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts +44 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js +39 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js +10 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/package.json +67 -0
- package/node_modules/@typescript-eslint/types/LICENSE +21 -0
- package/node_modules/@typescript-eslint/types/README.md +17 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +1729 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js +199 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/index.d.ts +5 -0
- package/node_modules/@typescript-eslint/types/dist/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/index.js +24 -0
- package/node_modules/@typescript-eslint/types/dist/index.js.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts +3 -0
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/lib.js +7 -0
- package/node_modules/@typescript-eslint/types/dist/lib.js.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +36 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.js +3 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.js.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts +8 -0
- package/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/types/dist/ts-estree.js +28 -0
- package/node_modules/@typescript-eslint/types/dist/ts-estree.js.map +1 -0
- package/node_modules/@typescript-eslint/types/package.json +84 -0
- package/node_modules/@typescript-eslint/typescript-estree/LICENSE +26 -0
- package/node_modules/@typescript-eslint/typescript-estree/README.md +383 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js +60 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts +11 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js +63 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts +159 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +2358 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +13 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js +6 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts +12 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js +66 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js +83 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts +11 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js +94 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts +5 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js +40 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts +19 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js +414 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts +5 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js +72 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts +22 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js +116 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts +13 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js +93 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts +4 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js +68 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts +12 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +40 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts +2 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js +259 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts +227 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js +584 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +188 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js +3 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts +25 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js +529 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts +13 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js +93 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js +54 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts +175 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js +4 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts +4 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js +25 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts +18 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js +3 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts +3 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js +53 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/gitignore.js +120 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.d.ts +186 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js +181 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/license +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/package.json +82 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/readme.md +170 -0
- package/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/stream-utils.js +46 -0
- package/node_modules/@typescript-eslint/typescript-estree/package.json +86 -0
- package/node_modules/@typescript-eslint/visitor-keys/LICENSE +21 -0
- package/node_modules/@typescript-eslint/visitor-keys/README.md +13 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts +4 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js +7 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts +3 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/index.js +8 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/index.js.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts +6 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +160 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/package.json +60 -0
- package/package.json +35 -35
|
@@ -0,0 +1,2358 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Converter = exports.convertError = void 0;
|
|
27
|
+
// There's lots of funny stuff due to the typing of ts.Node
|
|
28
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */
|
|
29
|
+
const ts = __importStar(require("typescript"));
|
|
30
|
+
const getModifiers_1 = require("./getModifiers");
|
|
31
|
+
const node_utils_1 = require("./node-utils");
|
|
32
|
+
const ts_estree_1 = require("./ts-estree");
|
|
33
|
+
const version_check_1 = require("./version-check");
|
|
34
|
+
const SyntaxKind = ts.SyntaxKind;
|
|
35
|
+
/**
|
|
36
|
+
* Extends and formats a given error object
|
|
37
|
+
* @param error the error object
|
|
38
|
+
* @returns converted error object
|
|
39
|
+
*/
|
|
40
|
+
function convertError(error) {
|
|
41
|
+
return (0, node_utils_1.createError)(error.file, error.start, ('message' in error && error.message) || error.messageText);
|
|
42
|
+
}
|
|
43
|
+
exports.convertError = convertError;
|
|
44
|
+
class Converter {
|
|
45
|
+
/**
|
|
46
|
+
* Converts a TypeScript node into an ESTree node
|
|
47
|
+
* @param ast the full TypeScript AST
|
|
48
|
+
* @param options additional options for the conversion
|
|
49
|
+
* @returns the converted ESTreeNode
|
|
50
|
+
*/
|
|
51
|
+
constructor(ast, options) {
|
|
52
|
+
this.esTreeNodeToTSNodeMap = new WeakMap();
|
|
53
|
+
this.tsNodeToESTreeNodeMap = new WeakMap();
|
|
54
|
+
this.allowPattern = false;
|
|
55
|
+
this.inTypeMode = false;
|
|
56
|
+
this.ast = ast;
|
|
57
|
+
this.options = Object.assign({}, options);
|
|
58
|
+
}
|
|
59
|
+
getASTMaps() {
|
|
60
|
+
return {
|
|
61
|
+
esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap,
|
|
62
|
+
tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
convertProgram() {
|
|
66
|
+
return this.converter(this.ast);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Converts a TypeScript node into an ESTree node.
|
|
70
|
+
* @param node the child ts.Node
|
|
71
|
+
* @param parent parentNode
|
|
72
|
+
* @param inTypeMode flag to determine if we are in typeMode
|
|
73
|
+
* @param allowPattern flag to determine if patterns are allowed
|
|
74
|
+
* @returns the converted ESTree node
|
|
75
|
+
*/
|
|
76
|
+
converter(node, parent, inTypeMode, allowPattern) {
|
|
77
|
+
/**
|
|
78
|
+
* Exit early for null and undefined
|
|
79
|
+
*/
|
|
80
|
+
if (!node) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const typeMode = this.inTypeMode;
|
|
84
|
+
const pattern = this.allowPattern;
|
|
85
|
+
if (inTypeMode !== undefined) {
|
|
86
|
+
this.inTypeMode = inTypeMode;
|
|
87
|
+
}
|
|
88
|
+
if (allowPattern !== undefined) {
|
|
89
|
+
this.allowPattern = allowPattern;
|
|
90
|
+
}
|
|
91
|
+
const result = this.convertNode(node, (parent !== null && parent !== void 0 ? parent : node.parent));
|
|
92
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
93
|
+
this.inTypeMode = typeMode;
|
|
94
|
+
this.allowPattern = pattern;
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Fixes the exports of the given ts.Node
|
|
99
|
+
* @param node the ts.Node
|
|
100
|
+
* @param result result
|
|
101
|
+
* @returns the ESTreeNode with fixed exports
|
|
102
|
+
*/
|
|
103
|
+
fixExports(node, result) {
|
|
104
|
+
// check for exports
|
|
105
|
+
const modifiers = (0, getModifiers_1.getModifiers)(node);
|
|
106
|
+
if ((modifiers === null || modifiers === void 0 ? void 0 : modifiers[0].kind) === SyntaxKind.ExportKeyword) {
|
|
107
|
+
/**
|
|
108
|
+
* Make sure that original node is registered instead of export
|
|
109
|
+
*/
|
|
110
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
111
|
+
const exportKeyword = modifiers[0];
|
|
112
|
+
const nextModifier = modifiers[1];
|
|
113
|
+
const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword;
|
|
114
|
+
const varToken = declarationIsDefault
|
|
115
|
+
? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast)
|
|
116
|
+
: (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast);
|
|
117
|
+
result.range[0] = varToken.getStart(this.ast);
|
|
118
|
+
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
|
|
119
|
+
if (declarationIsDefault) {
|
|
120
|
+
return this.createNode(node, {
|
|
121
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration,
|
|
122
|
+
declaration: result,
|
|
123
|
+
range: [exportKeyword.getStart(this.ast), result.range[1]],
|
|
124
|
+
exportKind: 'value',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration ||
|
|
129
|
+
result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration;
|
|
130
|
+
const isDeclare = 'declare' in result && result.declare === true;
|
|
131
|
+
return this.createNode(node, {
|
|
132
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
|
|
133
|
+
// @ts-expect-error - TODO, narrow the types here
|
|
134
|
+
declaration: result,
|
|
135
|
+
specifiers: [],
|
|
136
|
+
source: null,
|
|
137
|
+
exportKind: isType || isDeclare ? 'type' : 'value',
|
|
138
|
+
range: [exportKeyword.getStart(this.ast), result.range[1]],
|
|
139
|
+
assertions: [],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Register specific TypeScript node into map with first ESTree node provided
|
|
147
|
+
*/
|
|
148
|
+
registerTSNodeInNodeMap(node, result) {
|
|
149
|
+
if (result && this.options.shouldPreserveNodeMaps) {
|
|
150
|
+
if (!this.tsNodeToESTreeNodeMap.has(node)) {
|
|
151
|
+
this.tsNodeToESTreeNodeMap.set(node, result);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Converts a TypeScript node into an ESTree node.
|
|
157
|
+
* @param child the child ts.Node
|
|
158
|
+
* @param parent parentNode
|
|
159
|
+
* @returns the converted ESTree node
|
|
160
|
+
*/
|
|
161
|
+
convertPattern(child, parent) {
|
|
162
|
+
return this.converter(child, parent, this.inTypeMode, true);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Converts a TypeScript node into an ESTree node.
|
|
166
|
+
* @param child the child ts.Node
|
|
167
|
+
* @param parent parentNode
|
|
168
|
+
* @returns the converted ESTree node
|
|
169
|
+
*/
|
|
170
|
+
convertChild(child, parent) {
|
|
171
|
+
return this.converter(child, parent, this.inTypeMode, false);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Converts a TypeScript node into an ESTree node.
|
|
175
|
+
* @param child the child ts.Node
|
|
176
|
+
* @param parent parentNode
|
|
177
|
+
* @returns the converted ESTree node
|
|
178
|
+
*/
|
|
179
|
+
convertType(child, parent) {
|
|
180
|
+
return this.converter(child, parent, true, false);
|
|
181
|
+
}
|
|
182
|
+
createNode(node, data) {
|
|
183
|
+
const result = data;
|
|
184
|
+
if (!result.range) {
|
|
185
|
+
result.range = (0, node_utils_1.getRange)(
|
|
186
|
+
// this is completely valid, but TS hates it
|
|
187
|
+
node, this.ast);
|
|
188
|
+
}
|
|
189
|
+
if (!result.loc) {
|
|
190
|
+
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
|
|
191
|
+
}
|
|
192
|
+
if (result && this.options.shouldPreserveNodeMaps) {
|
|
193
|
+
this.esTreeNodeToTSNodeMap.set(result, node);
|
|
194
|
+
}
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
convertBindingNameWithTypeAnnotation(name, tsType, parent) {
|
|
198
|
+
const id = this.convertPattern(name);
|
|
199
|
+
if (tsType) {
|
|
200
|
+
id.typeAnnotation = this.convertTypeAnnotation(tsType, parent);
|
|
201
|
+
this.fixParentLocation(id, id.typeAnnotation.range);
|
|
202
|
+
}
|
|
203
|
+
return id;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Converts a child into a type annotation. This creates an intermediary
|
|
207
|
+
* TypeAnnotation node to match what Flow does.
|
|
208
|
+
* @param child The TypeScript AST node to convert.
|
|
209
|
+
* @param parent parentNode
|
|
210
|
+
* @returns The type annotation node.
|
|
211
|
+
*/
|
|
212
|
+
convertTypeAnnotation(child, parent) {
|
|
213
|
+
// in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon
|
|
214
|
+
const offset = (parent === null || parent === void 0 ? void 0 : parent.kind) === SyntaxKind.FunctionType ||
|
|
215
|
+
(parent === null || parent === void 0 ? void 0 : parent.kind) === SyntaxKind.ConstructorType
|
|
216
|
+
? 2
|
|
217
|
+
: 1;
|
|
218
|
+
const annotationStartCol = child.getFullStart() - offset;
|
|
219
|
+
const loc = (0, node_utils_1.getLocFor)(annotationStartCol, child.end, this.ast);
|
|
220
|
+
return {
|
|
221
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation,
|
|
222
|
+
loc,
|
|
223
|
+
range: [annotationStartCol, child.end],
|
|
224
|
+
typeAnnotation: this.convertType(child),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Coverts body Nodes and add a directive field to StringLiterals
|
|
229
|
+
* @param nodes of ts.Node
|
|
230
|
+
* @param parent parentNode
|
|
231
|
+
* @returns Array of body statements
|
|
232
|
+
*/
|
|
233
|
+
convertBodyExpressions(nodes, parent) {
|
|
234
|
+
let allowDirectives = (0, node_utils_1.canContainDirective)(parent);
|
|
235
|
+
return (nodes
|
|
236
|
+
.map(statement => {
|
|
237
|
+
const child = this.convertChild(statement);
|
|
238
|
+
if (allowDirectives) {
|
|
239
|
+
if ((child === null || child === void 0 ? void 0 : child.expression) &&
|
|
240
|
+
ts.isExpressionStatement(statement) &&
|
|
241
|
+
ts.isStringLiteral(statement.expression)) {
|
|
242
|
+
const raw = child.expression.raw;
|
|
243
|
+
child.directive = raw.slice(1, -1);
|
|
244
|
+
return child; // child can be null, but it's filtered below
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
allowDirectives = false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return child; // child can be null, but it's filtered below
|
|
251
|
+
})
|
|
252
|
+
// filter out unknown nodes for now
|
|
253
|
+
.filter(statement => statement));
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node
|
|
257
|
+
* @param typeArguments ts.NodeArray typeArguments
|
|
258
|
+
* @param node parent used to create this node
|
|
259
|
+
* @returns TypeParameterInstantiation node
|
|
260
|
+
*/
|
|
261
|
+
convertTypeArgumentsToTypeParameters(typeArguments, node) {
|
|
262
|
+
const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast);
|
|
263
|
+
return this.createNode(node, {
|
|
264
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation,
|
|
265
|
+
range: [typeArguments.pos - 1, greaterThanToken.end],
|
|
266
|
+
params: typeArguments.map(typeArgument => this.convertType(typeArgument)),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node
|
|
271
|
+
* @param typeParameters ts.Node typeParameters
|
|
272
|
+
* @returns TypeParameterDeclaration node
|
|
273
|
+
*/
|
|
274
|
+
convertTSTypeParametersToTypeParametersDeclaration(typeParameters) {
|
|
275
|
+
const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast);
|
|
276
|
+
return {
|
|
277
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration,
|
|
278
|
+
range: [typeParameters.pos - 1, greaterThanToken.end],
|
|
279
|
+
loc: (0, node_utils_1.getLocFor)(typeParameters.pos - 1, greaterThanToken.end, this.ast),
|
|
280
|
+
params: typeParameters.map(typeParameter => this.convertType(typeParameter)),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Converts an array of ts.Node parameters into an array of ESTreeNode params
|
|
285
|
+
* @param parameters An array of ts.Node params to be converted
|
|
286
|
+
* @returns an array of converted ESTreeNode params
|
|
287
|
+
*/
|
|
288
|
+
convertParameters(parameters) {
|
|
289
|
+
if (!(parameters === null || parameters === void 0 ? void 0 : parameters.length)) {
|
|
290
|
+
return [];
|
|
291
|
+
}
|
|
292
|
+
return parameters.map(param => {
|
|
293
|
+
const convertedParam = this.convertChild(param);
|
|
294
|
+
const decorators = (0, getModifiers_1.getDecorators)(param);
|
|
295
|
+
if (decorators === null || decorators === void 0 ? void 0 : decorators.length) {
|
|
296
|
+
convertedParam.decorators = decorators.map(el => this.convertChild(el));
|
|
297
|
+
}
|
|
298
|
+
return convertedParam;
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
convertChainExpression(node, tsNode) {
|
|
302
|
+
const { child, isOptional } = (() => {
|
|
303
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) {
|
|
304
|
+
return { child: node.object, isOptional: node.optional };
|
|
305
|
+
}
|
|
306
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) {
|
|
307
|
+
return { child: node.callee, isOptional: node.optional };
|
|
308
|
+
}
|
|
309
|
+
return { child: node.expression, isOptional: false };
|
|
310
|
+
})();
|
|
311
|
+
const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child);
|
|
312
|
+
if (!isChildUnwrappable && !isOptional) {
|
|
313
|
+
return node;
|
|
314
|
+
}
|
|
315
|
+
if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) {
|
|
316
|
+
// unwrap the chain expression child
|
|
317
|
+
const newChild = child.expression;
|
|
318
|
+
if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) {
|
|
319
|
+
node.object = newChild;
|
|
320
|
+
}
|
|
321
|
+
else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) {
|
|
322
|
+
node.callee = newChild;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
node.expression = newChild;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return this.createNode(tsNode, {
|
|
329
|
+
type: ts_estree_1.AST_NODE_TYPES.ChainExpression,
|
|
330
|
+
expression: node,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* For nodes that are copied directly from the TypeScript AST into
|
|
335
|
+
* ESTree mostly as-is. The only difference is the addition of a type
|
|
336
|
+
* property instead of a kind property. Recursively copies all children.
|
|
337
|
+
*/
|
|
338
|
+
deeplyCopy(node) {
|
|
339
|
+
if (node.kind === ts.SyntaxKind.JSDocFunctionType) {
|
|
340
|
+
throw (0, node_utils_1.createError)(this.ast, node.pos, 'JSDoc types can only be used inside documentation comments.');
|
|
341
|
+
}
|
|
342
|
+
const customType = `TS${SyntaxKind[node.kind]}`;
|
|
343
|
+
/**
|
|
344
|
+
* If the "errorOnUnknownASTType" option is set to true, throw an error,
|
|
345
|
+
* otherwise fallback to just including the unknown type as-is.
|
|
346
|
+
*/
|
|
347
|
+
if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) {
|
|
348
|
+
throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`);
|
|
349
|
+
}
|
|
350
|
+
const result = this.createNode(node, {
|
|
351
|
+
type: customType,
|
|
352
|
+
});
|
|
353
|
+
if ('type' in node) {
|
|
354
|
+
result.typeAnnotation =
|
|
355
|
+
node.type && 'kind' in node.type && ts.isTypeNode(node.type)
|
|
356
|
+
? this.convertTypeAnnotation(node.type, node)
|
|
357
|
+
: null;
|
|
358
|
+
}
|
|
359
|
+
if ('typeArguments' in node) {
|
|
360
|
+
result.typeParameters =
|
|
361
|
+
node.typeArguments && 'pos' in node.typeArguments
|
|
362
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
363
|
+
: null;
|
|
364
|
+
}
|
|
365
|
+
if ('typeParameters' in node) {
|
|
366
|
+
result.typeParameters =
|
|
367
|
+
node.typeParameters && 'pos' in node.typeParameters
|
|
368
|
+
? this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters)
|
|
369
|
+
: null;
|
|
370
|
+
}
|
|
371
|
+
const decorators = (0, getModifiers_1.getDecorators)(node);
|
|
372
|
+
if (decorators === null || decorators === void 0 ? void 0 : decorators.length) {
|
|
373
|
+
result.decorators = decorators.map(el => this.convertChild(el));
|
|
374
|
+
}
|
|
375
|
+
// keys we never want to clone from the base typescript node as they
|
|
376
|
+
// introduce garbage into our AST
|
|
377
|
+
const KEYS_TO_NOT_COPY = new Set([
|
|
378
|
+
'_children',
|
|
379
|
+
'decorators',
|
|
380
|
+
'end',
|
|
381
|
+
'flags',
|
|
382
|
+
'illegalDecorators',
|
|
383
|
+
'heritageClauses',
|
|
384
|
+
'locals',
|
|
385
|
+
'localSymbol',
|
|
386
|
+
'jsDoc',
|
|
387
|
+
'kind',
|
|
388
|
+
'modifierFlagsCache',
|
|
389
|
+
'modifiers',
|
|
390
|
+
'nextContainer',
|
|
391
|
+
'parent',
|
|
392
|
+
'pos',
|
|
393
|
+
'symbol',
|
|
394
|
+
'transformFlags',
|
|
395
|
+
'type',
|
|
396
|
+
'typeArguments',
|
|
397
|
+
'typeParameters',
|
|
398
|
+
]);
|
|
399
|
+
Object.entries(node)
|
|
400
|
+
.filter(([key]) => !KEYS_TO_NOT_COPY.has(key))
|
|
401
|
+
.forEach(([key, value]) => {
|
|
402
|
+
if (Array.isArray(value)) {
|
|
403
|
+
result[key] = value.map(el => this.convertChild(el));
|
|
404
|
+
}
|
|
405
|
+
else if (value && typeof value === 'object' && value.kind) {
|
|
406
|
+
// need to check node[key].kind to ensure we don't try to convert a symbol
|
|
407
|
+
result[key] = this.convertChild(value);
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
result[key] = value;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
return result;
|
|
414
|
+
}
|
|
415
|
+
convertJSXIdentifier(node) {
|
|
416
|
+
const result = this.createNode(node, {
|
|
417
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
418
|
+
name: node.getText(),
|
|
419
|
+
});
|
|
420
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
421
|
+
return result;
|
|
422
|
+
}
|
|
423
|
+
convertJSXNamespaceOrIdentifier(node) {
|
|
424
|
+
const text = node.getText();
|
|
425
|
+
const colonIndex = text.indexOf(':');
|
|
426
|
+
// this is intentional we can ignore conversion if `:` is in first character
|
|
427
|
+
if (colonIndex > 0) {
|
|
428
|
+
const range = (0, node_utils_1.getRange)(node, this.ast);
|
|
429
|
+
const result = this.createNode(node, {
|
|
430
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName,
|
|
431
|
+
namespace: this.createNode(node, {
|
|
432
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
433
|
+
name: text.slice(0, colonIndex),
|
|
434
|
+
range: [range[0], range[0] + colonIndex],
|
|
435
|
+
}),
|
|
436
|
+
name: this.createNode(node, {
|
|
437
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier,
|
|
438
|
+
name: text.slice(colonIndex + 1),
|
|
439
|
+
range: [range[0] + colonIndex + 1, range[1]],
|
|
440
|
+
}),
|
|
441
|
+
range,
|
|
442
|
+
});
|
|
443
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
444
|
+
return result;
|
|
445
|
+
}
|
|
446
|
+
return this.convertJSXIdentifier(node);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Converts a TypeScript JSX node.tagName into an ESTree node.name
|
|
450
|
+
* @param node the tagName object from a JSX ts.Node
|
|
451
|
+
* @param parent
|
|
452
|
+
* @returns the converted ESTree name object
|
|
453
|
+
*/
|
|
454
|
+
convertJSXTagName(node, parent) {
|
|
455
|
+
let result;
|
|
456
|
+
switch (node.kind) {
|
|
457
|
+
case SyntaxKind.PropertyAccessExpression:
|
|
458
|
+
if (node.name.kind === SyntaxKind.PrivateIdentifier) {
|
|
459
|
+
// This is one of the few times where TS explicitly errors, and doesn't even gracefully handle the syntax.
|
|
460
|
+
// So we shouldn't ever get into this state to begin with.
|
|
461
|
+
throw new Error('Non-private identifier expected.');
|
|
462
|
+
}
|
|
463
|
+
result = this.createNode(node, {
|
|
464
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression,
|
|
465
|
+
object: this.convertJSXTagName(node.expression, parent),
|
|
466
|
+
property: this.convertJSXIdentifier(node.name),
|
|
467
|
+
});
|
|
468
|
+
break;
|
|
469
|
+
case SyntaxKind.ThisKeyword:
|
|
470
|
+
case SyntaxKind.Identifier:
|
|
471
|
+
default:
|
|
472
|
+
return this.convertJSXNamespaceOrIdentifier(node);
|
|
473
|
+
}
|
|
474
|
+
this.registerTSNodeInNodeMap(node, result);
|
|
475
|
+
return result;
|
|
476
|
+
}
|
|
477
|
+
convertMethodSignature(node) {
|
|
478
|
+
const result = this.createNode(node, {
|
|
479
|
+
type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
|
|
480
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
481
|
+
key: this.convertChild(node.name),
|
|
482
|
+
params: this.convertParameters(node.parameters),
|
|
483
|
+
kind: (() => {
|
|
484
|
+
switch (node.kind) {
|
|
485
|
+
case SyntaxKind.GetAccessor:
|
|
486
|
+
return 'get';
|
|
487
|
+
case SyntaxKind.SetAccessor:
|
|
488
|
+
return 'set';
|
|
489
|
+
case SyntaxKind.MethodSignature:
|
|
490
|
+
return 'method';
|
|
491
|
+
}
|
|
492
|
+
})(),
|
|
493
|
+
});
|
|
494
|
+
if ((0, node_utils_1.isOptional)(node)) {
|
|
495
|
+
result.optional = true;
|
|
496
|
+
}
|
|
497
|
+
if (node.type) {
|
|
498
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
499
|
+
}
|
|
500
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node)) {
|
|
501
|
+
result.readonly = true;
|
|
502
|
+
}
|
|
503
|
+
if (node.typeParameters) {
|
|
504
|
+
result.typeParameters =
|
|
505
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
506
|
+
}
|
|
507
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
508
|
+
if (accessibility) {
|
|
509
|
+
result.accessibility = accessibility;
|
|
510
|
+
}
|
|
511
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node)) {
|
|
512
|
+
result.export = true;
|
|
513
|
+
}
|
|
514
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node)) {
|
|
515
|
+
result.static = true;
|
|
516
|
+
}
|
|
517
|
+
return result;
|
|
518
|
+
}
|
|
519
|
+
convertAssertClasue(node) {
|
|
520
|
+
return node === undefined
|
|
521
|
+
? []
|
|
522
|
+
: node.elements.map(element => this.convertChild(element));
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Applies the given TS modifiers to the given result object.
|
|
526
|
+
*
|
|
527
|
+
* This method adds not standardized `modifiers` property in nodes
|
|
528
|
+
*
|
|
529
|
+
* @param result
|
|
530
|
+
* @param modifiers original ts.Nodes from the node.modifiers array
|
|
531
|
+
* @returns the current result object will be mutated
|
|
532
|
+
*/
|
|
533
|
+
applyModifiersToResult(result, modifiers) {
|
|
534
|
+
if (!modifiers) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
const remainingModifiers = [];
|
|
538
|
+
/**
|
|
539
|
+
* Some modifiers are explicitly handled by applying them as
|
|
540
|
+
* boolean values on the result node. As well as adding them
|
|
541
|
+
* to the result, we remove them from the array, so that they
|
|
542
|
+
* are not handled twice.
|
|
543
|
+
*/
|
|
544
|
+
for (const modifier of modifiers) {
|
|
545
|
+
switch (modifier.kind) {
|
|
546
|
+
/**
|
|
547
|
+
* Ignore ExportKeyword and DefaultKeyword, they are handled
|
|
548
|
+
* via the fixExports utility function
|
|
549
|
+
*/
|
|
550
|
+
case SyntaxKind.ExportKeyword:
|
|
551
|
+
case SyntaxKind.DefaultKeyword:
|
|
552
|
+
break;
|
|
553
|
+
case SyntaxKind.ConstKeyword:
|
|
554
|
+
result.const = true;
|
|
555
|
+
break;
|
|
556
|
+
case SyntaxKind.DeclareKeyword:
|
|
557
|
+
result.declare = true;
|
|
558
|
+
break;
|
|
559
|
+
default:
|
|
560
|
+
remainingModifiers.push(this.convertChild(modifier));
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* If there are still valid modifiers available which have
|
|
566
|
+
* not been explicitly handled above, we just convert and
|
|
567
|
+
* add the modifiers array to the result node.
|
|
568
|
+
*/
|
|
569
|
+
if (remainingModifiers.length > 0) {
|
|
570
|
+
result.modifiers = remainingModifiers;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Uses the provided range location to adjust the location data of the given Node
|
|
575
|
+
* @param result The node that will have its location data mutated
|
|
576
|
+
* @param childRange The child node range used to expand location
|
|
577
|
+
*/
|
|
578
|
+
fixParentLocation(result, childRange) {
|
|
579
|
+
if (childRange[0] < result.range[0]) {
|
|
580
|
+
result.range[0] = childRange[0];
|
|
581
|
+
result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast);
|
|
582
|
+
}
|
|
583
|
+
if (childRange[1] > result.range[1]) {
|
|
584
|
+
result.range[1] = childRange[1];
|
|
585
|
+
result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
assertModuleSpecifier(node, allowNull) {
|
|
589
|
+
var _a;
|
|
590
|
+
if (!allowNull && node.moduleSpecifier == null) {
|
|
591
|
+
throw (0, node_utils_1.createError)(this.ast, node.pos, 'Module specifier must be a string literal.');
|
|
592
|
+
}
|
|
593
|
+
if (node.moduleSpecifier &&
|
|
594
|
+
((_a = node.moduleSpecifier) === null || _a === void 0 ? void 0 : _a.kind) !== SyntaxKind.StringLiteral) {
|
|
595
|
+
throw (0, node_utils_1.createError)(this.ast, node.moduleSpecifier.pos, 'Module specifier must be a string literal.');
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Converts a TypeScript node into an ESTree node.
|
|
600
|
+
* The core of the conversion logic:
|
|
601
|
+
* Identify and convert each relevant TypeScript SyntaxKind
|
|
602
|
+
* @param node the child ts.Node
|
|
603
|
+
* @param parent parentNode
|
|
604
|
+
* @returns the converted ESTree node
|
|
605
|
+
*/
|
|
606
|
+
convertNode(node, parent) {
|
|
607
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
608
|
+
switch (node.kind) {
|
|
609
|
+
case SyntaxKind.SourceFile: {
|
|
610
|
+
return this.createNode(node, {
|
|
611
|
+
type: ts_estree_1.AST_NODE_TYPES.Program,
|
|
612
|
+
body: this.convertBodyExpressions(node.statements, node),
|
|
613
|
+
sourceType: node.externalModuleIndicator ? 'module' : 'script',
|
|
614
|
+
range: [node.getStart(this.ast), node.endOfFileToken.end],
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
case SyntaxKind.Block: {
|
|
618
|
+
return this.createNode(node, {
|
|
619
|
+
type: ts_estree_1.AST_NODE_TYPES.BlockStatement,
|
|
620
|
+
body: this.convertBodyExpressions(node.statements, node),
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
case SyntaxKind.Identifier: {
|
|
624
|
+
if ((0, node_utils_1.isThisInTypeQuery)(node)) {
|
|
625
|
+
// special case for `typeof this.foo` - TS emits an Identifier for `this`
|
|
626
|
+
// but we want to treat it as a ThisExpression for consistency
|
|
627
|
+
return this.createNode(node, {
|
|
628
|
+
type: ts_estree_1.AST_NODE_TYPES.ThisExpression,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
return this.createNode(node, {
|
|
632
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
633
|
+
name: node.text,
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
case SyntaxKind.PrivateIdentifier: {
|
|
637
|
+
return this.createNode(node, {
|
|
638
|
+
type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier,
|
|
639
|
+
// typescript includes the `#` in the text
|
|
640
|
+
name: node.text.slice(1),
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
case SyntaxKind.WithStatement:
|
|
644
|
+
return this.createNode(node, {
|
|
645
|
+
type: ts_estree_1.AST_NODE_TYPES.WithStatement,
|
|
646
|
+
object: this.convertChild(node.expression),
|
|
647
|
+
body: this.convertChild(node.statement),
|
|
648
|
+
});
|
|
649
|
+
// Control Flow
|
|
650
|
+
case SyntaxKind.ReturnStatement:
|
|
651
|
+
return this.createNode(node, {
|
|
652
|
+
type: ts_estree_1.AST_NODE_TYPES.ReturnStatement,
|
|
653
|
+
argument: this.convertChild(node.expression),
|
|
654
|
+
});
|
|
655
|
+
case SyntaxKind.LabeledStatement:
|
|
656
|
+
return this.createNode(node, {
|
|
657
|
+
type: ts_estree_1.AST_NODE_TYPES.LabeledStatement,
|
|
658
|
+
label: this.convertChild(node.label),
|
|
659
|
+
body: this.convertChild(node.statement),
|
|
660
|
+
});
|
|
661
|
+
case SyntaxKind.ContinueStatement:
|
|
662
|
+
return this.createNode(node, {
|
|
663
|
+
type: ts_estree_1.AST_NODE_TYPES.ContinueStatement,
|
|
664
|
+
label: this.convertChild(node.label),
|
|
665
|
+
});
|
|
666
|
+
case SyntaxKind.BreakStatement:
|
|
667
|
+
return this.createNode(node, {
|
|
668
|
+
type: ts_estree_1.AST_NODE_TYPES.BreakStatement,
|
|
669
|
+
label: this.convertChild(node.label),
|
|
670
|
+
});
|
|
671
|
+
// Choice
|
|
672
|
+
case SyntaxKind.IfStatement:
|
|
673
|
+
return this.createNode(node, {
|
|
674
|
+
type: ts_estree_1.AST_NODE_TYPES.IfStatement,
|
|
675
|
+
test: this.convertChild(node.expression),
|
|
676
|
+
consequent: this.convertChild(node.thenStatement),
|
|
677
|
+
alternate: this.convertChild(node.elseStatement),
|
|
678
|
+
});
|
|
679
|
+
case SyntaxKind.SwitchStatement:
|
|
680
|
+
return this.createNode(node, {
|
|
681
|
+
type: ts_estree_1.AST_NODE_TYPES.SwitchStatement,
|
|
682
|
+
discriminant: this.convertChild(node.expression),
|
|
683
|
+
cases: node.caseBlock.clauses.map(el => this.convertChild(el)),
|
|
684
|
+
});
|
|
685
|
+
case SyntaxKind.CaseClause:
|
|
686
|
+
case SyntaxKind.DefaultClause:
|
|
687
|
+
return this.createNode(node, {
|
|
688
|
+
type: ts_estree_1.AST_NODE_TYPES.SwitchCase,
|
|
689
|
+
// expression is present in case only
|
|
690
|
+
test: node.kind === SyntaxKind.CaseClause
|
|
691
|
+
? this.convertChild(node.expression)
|
|
692
|
+
: null,
|
|
693
|
+
consequent: node.statements.map(el => this.convertChild(el)),
|
|
694
|
+
});
|
|
695
|
+
// Exceptions
|
|
696
|
+
case SyntaxKind.ThrowStatement:
|
|
697
|
+
return this.createNode(node, {
|
|
698
|
+
type: ts_estree_1.AST_NODE_TYPES.ThrowStatement,
|
|
699
|
+
argument: this.convertChild(node.expression),
|
|
700
|
+
});
|
|
701
|
+
case SyntaxKind.TryStatement:
|
|
702
|
+
return this.createNode(node, {
|
|
703
|
+
type: ts_estree_1.AST_NODE_TYPES.TryStatement,
|
|
704
|
+
block: this.convertChild(node.tryBlock),
|
|
705
|
+
handler: this.convertChild(node.catchClause),
|
|
706
|
+
finalizer: this.convertChild(node.finallyBlock),
|
|
707
|
+
});
|
|
708
|
+
case SyntaxKind.CatchClause:
|
|
709
|
+
return this.createNode(node, {
|
|
710
|
+
type: ts_estree_1.AST_NODE_TYPES.CatchClause,
|
|
711
|
+
param: node.variableDeclaration
|
|
712
|
+
? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type)
|
|
713
|
+
: null,
|
|
714
|
+
body: this.convertChild(node.block),
|
|
715
|
+
});
|
|
716
|
+
// Loops
|
|
717
|
+
case SyntaxKind.WhileStatement:
|
|
718
|
+
return this.createNode(node, {
|
|
719
|
+
type: ts_estree_1.AST_NODE_TYPES.WhileStatement,
|
|
720
|
+
test: this.convertChild(node.expression),
|
|
721
|
+
body: this.convertChild(node.statement),
|
|
722
|
+
});
|
|
723
|
+
/**
|
|
724
|
+
* Unlike other parsers, TypeScript calls a "DoWhileStatement"
|
|
725
|
+
* a "DoStatement"
|
|
726
|
+
*/
|
|
727
|
+
case SyntaxKind.DoStatement:
|
|
728
|
+
return this.createNode(node, {
|
|
729
|
+
type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement,
|
|
730
|
+
test: this.convertChild(node.expression),
|
|
731
|
+
body: this.convertChild(node.statement),
|
|
732
|
+
});
|
|
733
|
+
case SyntaxKind.ForStatement:
|
|
734
|
+
return this.createNode(node, {
|
|
735
|
+
type: ts_estree_1.AST_NODE_TYPES.ForStatement,
|
|
736
|
+
init: this.convertChild(node.initializer),
|
|
737
|
+
test: this.convertChild(node.condition),
|
|
738
|
+
update: this.convertChild(node.incrementor),
|
|
739
|
+
body: this.convertChild(node.statement),
|
|
740
|
+
});
|
|
741
|
+
case SyntaxKind.ForInStatement:
|
|
742
|
+
return this.createNode(node, {
|
|
743
|
+
type: ts_estree_1.AST_NODE_TYPES.ForInStatement,
|
|
744
|
+
left: this.convertPattern(node.initializer),
|
|
745
|
+
right: this.convertChild(node.expression),
|
|
746
|
+
body: this.convertChild(node.statement),
|
|
747
|
+
});
|
|
748
|
+
case SyntaxKind.ForOfStatement:
|
|
749
|
+
return this.createNode(node, {
|
|
750
|
+
type: ts_estree_1.AST_NODE_TYPES.ForOfStatement,
|
|
751
|
+
left: this.convertPattern(node.initializer),
|
|
752
|
+
right: this.convertChild(node.expression),
|
|
753
|
+
body: this.convertChild(node.statement),
|
|
754
|
+
await: Boolean(node.awaitModifier &&
|
|
755
|
+
node.awaitModifier.kind === SyntaxKind.AwaitKeyword),
|
|
756
|
+
});
|
|
757
|
+
// Declarations
|
|
758
|
+
case SyntaxKind.FunctionDeclaration: {
|
|
759
|
+
const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
|
|
760
|
+
const result = this.createNode(node, {
|
|
761
|
+
type: isDeclare || !node.body
|
|
762
|
+
? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction
|
|
763
|
+
: ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
|
|
764
|
+
id: this.convertChild(node.name),
|
|
765
|
+
generator: !!node.asteriskToken,
|
|
766
|
+
expression: false,
|
|
767
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
768
|
+
params: this.convertParameters(node.parameters),
|
|
769
|
+
body: this.convertChild(node.body) || undefined,
|
|
770
|
+
});
|
|
771
|
+
// Process returnType
|
|
772
|
+
if (node.type) {
|
|
773
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
774
|
+
}
|
|
775
|
+
// Process typeParameters
|
|
776
|
+
if (node.typeParameters) {
|
|
777
|
+
result.typeParameters =
|
|
778
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
779
|
+
}
|
|
780
|
+
if (isDeclare) {
|
|
781
|
+
result.declare = true;
|
|
782
|
+
}
|
|
783
|
+
// check for exports
|
|
784
|
+
return this.fixExports(node, result);
|
|
785
|
+
}
|
|
786
|
+
case SyntaxKind.VariableDeclaration: {
|
|
787
|
+
const result = this.createNode(node, {
|
|
788
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator,
|
|
789
|
+
id: this.convertBindingNameWithTypeAnnotation(node.name, node.type, node),
|
|
790
|
+
init: this.convertChild(node.initializer),
|
|
791
|
+
});
|
|
792
|
+
if (node.exclamationToken) {
|
|
793
|
+
result.definite = true;
|
|
794
|
+
}
|
|
795
|
+
return result;
|
|
796
|
+
}
|
|
797
|
+
case SyntaxKind.VariableStatement: {
|
|
798
|
+
const result = this.createNode(node, {
|
|
799
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
800
|
+
declarations: node.declarationList.declarations.map(el => this.convertChild(el)),
|
|
801
|
+
kind: (0, node_utils_1.getDeclarationKind)(node.declarationList),
|
|
802
|
+
});
|
|
803
|
+
/**
|
|
804
|
+
* Semantically, decorators are not allowed on variable declarations,
|
|
805
|
+
* Pre 4.8 TS would include them in the AST, so we did as well.
|
|
806
|
+
* However as of 4.8 TS no longer includes it (as it is, well, invalid).
|
|
807
|
+
*
|
|
808
|
+
* So for consistency across versions, we no longer include it either.
|
|
809
|
+
*/
|
|
810
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
|
|
811
|
+
result.declare = true;
|
|
812
|
+
}
|
|
813
|
+
// check for exports
|
|
814
|
+
return this.fixExports(node, result);
|
|
815
|
+
}
|
|
816
|
+
// mostly for for-of, for-in
|
|
817
|
+
case SyntaxKind.VariableDeclarationList:
|
|
818
|
+
return this.createNode(node, {
|
|
819
|
+
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
|
|
820
|
+
declarations: node.declarations.map(el => this.convertChild(el)),
|
|
821
|
+
kind: (0, node_utils_1.getDeclarationKind)(node),
|
|
822
|
+
});
|
|
823
|
+
// Expressions
|
|
824
|
+
case SyntaxKind.ExpressionStatement:
|
|
825
|
+
return this.createNode(node, {
|
|
826
|
+
type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement,
|
|
827
|
+
expression: this.convertChild(node.expression),
|
|
828
|
+
});
|
|
829
|
+
case SyntaxKind.ThisKeyword:
|
|
830
|
+
return this.createNode(node, {
|
|
831
|
+
type: ts_estree_1.AST_NODE_TYPES.ThisExpression,
|
|
832
|
+
});
|
|
833
|
+
case SyntaxKind.ArrayLiteralExpression: {
|
|
834
|
+
// TypeScript uses ArrayLiteralExpression in destructuring assignment, too
|
|
835
|
+
if (this.allowPattern) {
|
|
836
|
+
return this.createNode(node, {
|
|
837
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayPattern,
|
|
838
|
+
elements: node.elements.map(el => this.convertPattern(el)),
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
return this.createNode(node, {
|
|
843
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayExpression,
|
|
844
|
+
elements: node.elements.map(el => this.convertChild(el)),
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
case SyntaxKind.ObjectLiteralExpression: {
|
|
849
|
+
// TypeScript uses ObjectLiteralExpression in destructuring assignment, too
|
|
850
|
+
if (this.allowPattern) {
|
|
851
|
+
return this.createNode(node, {
|
|
852
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectPattern,
|
|
853
|
+
properties: node.properties.map(el => this.convertPattern(el)),
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
else {
|
|
857
|
+
return this.createNode(node, {
|
|
858
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectExpression,
|
|
859
|
+
properties: node.properties.map(el => this.convertChild(el)),
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
case SyntaxKind.PropertyAssignment:
|
|
864
|
+
return this.createNode(node, {
|
|
865
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
866
|
+
key: this.convertChild(node.name),
|
|
867
|
+
value: this.converter(node.initializer, node, this.inTypeMode, this.allowPattern),
|
|
868
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
869
|
+
method: false,
|
|
870
|
+
shorthand: false,
|
|
871
|
+
kind: 'init',
|
|
872
|
+
});
|
|
873
|
+
case SyntaxKind.ShorthandPropertyAssignment: {
|
|
874
|
+
if (node.objectAssignmentInitializer) {
|
|
875
|
+
return this.createNode(node, {
|
|
876
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
877
|
+
key: this.convertChild(node.name),
|
|
878
|
+
value: this.createNode(node, {
|
|
879
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
880
|
+
left: this.convertPattern(node.name),
|
|
881
|
+
right: this.convertChild(node.objectAssignmentInitializer),
|
|
882
|
+
}),
|
|
883
|
+
computed: false,
|
|
884
|
+
method: false,
|
|
885
|
+
shorthand: true,
|
|
886
|
+
kind: 'init',
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
return this.createNode(node, {
|
|
891
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
892
|
+
key: this.convertChild(node.name),
|
|
893
|
+
value: this.convertChild(node.name),
|
|
894
|
+
computed: false,
|
|
895
|
+
method: false,
|
|
896
|
+
shorthand: true,
|
|
897
|
+
kind: 'init',
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
case SyntaxKind.ComputedPropertyName:
|
|
902
|
+
return this.convertChild(node.expression);
|
|
903
|
+
case SyntaxKind.PropertyDeclaration: {
|
|
904
|
+
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
|
|
905
|
+
const result = this.createNode(node, {
|
|
906
|
+
type: isAbstract
|
|
907
|
+
? ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition
|
|
908
|
+
: ts_estree_1.AST_NODE_TYPES.PropertyDefinition,
|
|
909
|
+
key: this.convertChild(node.name),
|
|
910
|
+
value: isAbstract ? null : this.convertChild(node.initializer),
|
|
911
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
912
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
913
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
|
|
914
|
+
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
|
|
915
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
|
|
916
|
+
});
|
|
917
|
+
if (node.type) {
|
|
918
|
+
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
919
|
+
}
|
|
920
|
+
const decorators = (0, getModifiers_1.getDecorators)(node);
|
|
921
|
+
if (decorators) {
|
|
922
|
+
result.decorators = decorators.map(el => this.convertChild(el));
|
|
923
|
+
}
|
|
924
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
925
|
+
if (accessibility) {
|
|
926
|
+
result.accessibility = accessibility;
|
|
927
|
+
}
|
|
928
|
+
if ((node.name.kind === SyntaxKind.Identifier ||
|
|
929
|
+
node.name.kind === SyntaxKind.ComputedPropertyName ||
|
|
930
|
+
node.name.kind === SyntaxKind.PrivateIdentifier) &&
|
|
931
|
+
node.questionToken) {
|
|
932
|
+
result.optional = true;
|
|
933
|
+
}
|
|
934
|
+
if (node.exclamationToken) {
|
|
935
|
+
result.definite = true;
|
|
936
|
+
}
|
|
937
|
+
if (result.key.type === ts_estree_1.AST_NODE_TYPES.Literal && node.questionToken) {
|
|
938
|
+
result.optional = true;
|
|
939
|
+
}
|
|
940
|
+
return result;
|
|
941
|
+
}
|
|
942
|
+
case SyntaxKind.GetAccessor:
|
|
943
|
+
case SyntaxKind.SetAccessor: {
|
|
944
|
+
if (node.parent.kind === SyntaxKind.InterfaceDeclaration ||
|
|
945
|
+
node.parent.kind === SyntaxKind.TypeLiteral) {
|
|
946
|
+
return this.convertMethodSignature(node);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
// otherwise, it is a non-type accessor - intentional fallthrough
|
|
950
|
+
case SyntaxKind.MethodDeclaration: {
|
|
951
|
+
const method = this.createNode(node, {
|
|
952
|
+
type: !node.body
|
|
953
|
+
? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression
|
|
954
|
+
: ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
955
|
+
id: null,
|
|
956
|
+
generator: !!node.asteriskToken,
|
|
957
|
+
expression: false,
|
|
958
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
959
|
+
body: this.convertChild(node.body),
|
|
960
|
+
range: [node.parameters.pos - 1, node.end],
|
|
961
|
+
params: [],
|
|
962
|
+
});
|
|
963
|
+
if (node.type) {
|
|
964
|
+
method.returnType = this.convertTypeAnnotation(node.type, node);
|
|
965
|
+
}
|
|
966
|
+
// Process typeParameters
|
|
967
|
+
if (node.typeParameters) {
|
|
968
|
+
method.typeParameters =
|
|
969
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
970
|
+
this.fixParentLocation(method, method.typeParameters.range);
|
|
971
|
+
}
|
|
972
|
+
let result;
|
|
973
|
+
if (parent.kind === SyntaxKind.ObjectLiteralExpression) {
|
|
974
|
+
method.params = node.parameters.map(el => this.convertChild(el));
|
|
975
|
+
result = this.createNode(node, {
|
|
976
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
977
|
+
key: this.convertChild(node.name),
|
|
978
|
+
value: method,
|
|
979
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
980
|
+
method: node.kind === SyntaxKind.MethodDeclaration,
|
|
981
|
+
shorthand: false,
|
|
982
|
+
kind: 'init',
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
// class
|
|
987
|
+
/**
|
|
988
|
+
* Unlike in object literal methods, class method params can have decorators
|
|
989
|
+
*/
|
|
990
|
+
method.params = this.convertParameters(node.parameters);
|
|
991
|
+
/**
|
|
992
|
+
* TypeScript class methods can be defined as "abstract"
|
|
993
|
+
*/
|
|
994
|
+
const methodDefinitionType = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)
|
|
995
|
+
? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition
|
|
996
|
+
: ts_estree_1.AST_NODE_TYPES.MethodDefinition;
|
|
997
|
+
result = this.createNode(node, {
|
|
998
|
+
type: methodDefinitionType,
|
|
999
|
+
key: this.convertChild(node.name),
|
|
1000
|
+
value: method,
|
|
1001
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
1002
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
|
|
1003
|
+
kind: 'method',
|
|
1004
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
|
|
1005
|
+
});
|
|
1006
|
+
const decorators = (0, getModifiers_1.getDecorators)(node);
|
|
1007
|
+
if (decorators) {
|
|
1008
|
+
result.decorators = decorators.map(el => this.convertChild(el));
|
|
1009
|
+
}
|
|
1010
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
1011
|
+
if (accessibility) {
|
|
1012
|
+
result.accessibility = accessibility;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
if (node.questionToken) {
|
|
1016
|
+
result.optional = true;
|
|
1017
|
+
}
|
|
1018
|
+
if (node.kind === SyntaxKind.GetAccessor) {
|
|
1019
|
+
result.kind = 'get';
|
|
1020
|
+
}
|
|
1021
|
+
else if (node.kind === SyntaxKind.SetAccessor) {
|
|
1022
|
+
result.kind = 'set';
|
|
1023
|
+
}
|
|
1024
|
+
else if (!result.static &&
|
|
1025
|
+
node.name.kind === SyntaxKind.StringLiteral &&
|
|
1026
|
+
node.name.text === 'constructor' &&
|
|
1027
|
+
result.type !== ts_estree_1.AST_NODE_TYPES.Property) {
|
|
1028
|
+
result.kind = 'constructor';
|
|
1029
|
+
}
|
|
1030
|
+
return result;
|
|
1031
|
+
}
|
|
1032
|
+
// TypeScript uses this even for static methods named "constructor"
|
|
1033
|
+
case SyntaxKind.Constructor: {
|
|
1034
|
+
const lastModifier = (0, node_utils_1.getLastModifier)(node);
|
|
1035
|
+
const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ||
|
|
1036
|
+
node.getFirstToken();
|
|
1037
|
+
const constructor = this.createNode(node, {
|
|
1038
|
+
type: !node.body
|
|
1039
|
+
? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression
|
|
1040
|
+
: ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
1041
|
+
id: null,
|
|
1042
|
+
params: this.convertParameters(node.parameters),
|
|
1043
|
+
generator: false,
|
|
1044
|
+
expression: false,
|
|
1045
|
+
async: false,
|
|
1046
|
+
body: this.convertChild(node.body),
|
|
1047
|
+
range: [node.parameters.pos - 1, node.end],
|
|
1048
|
+
});
|
|
1049
|
+
// Process typeParameters
|
|
1050
|
+
if (node.typeParameters) {
|
|
1051
|
+
constructor.typeParameters =
|
|
1052
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
1053
|
+
this.fixParentLocation(constructor, constructor.typeParameters.range);
|
|
1054
|
+
}
|
|
1055
|
+
// Process returnType
|
|
1056
|
+
if (node.type) {
|
|
1057
|
+
constructor.returnType = this.convertTypeAnnotation(node.type, node);
|
|
1058
|
+
}
|
|
1059
|
+
const constructorKey = this.createNode(node, {
|
|
1060
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
1061
|
+
name: 'constructor',
|
|
1062
|
+
range: [constructorToken.getStart(this.ast), constructorToken.end],
|
|
1063
|
+
});
|
|
1064
|
+
const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node);
|
|
1065
|
+
const result = this.createNode(node, {
|
|
1066
|
+
type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)
|
|
1067
|
+
? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition
|
|
1068
|
+
: ts_estree_1.AST_NODE_TYPES.MethodDefinition,
|
|
1069
|
+
key: constructorKey,
|
|
1070
|
+
value: constructor,
|
|
1071
|
+
computed: false,
|
|
1072
|
+
static: isStatic,
|
|
1073
|
+
kind: isStatic ? 'method' : 'constructor',
|
|
1074
|
+
override: false,
|
|
1075
|
+
});
|
|
1076
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
1077
|
+
if (accessibility) {
|
|
1078
|
+
result.accessibility = accessibility;
|
|
1079
|
+
}
|
|
1080
|
+
return result;
|
|
1081
|
+
}
|
|
1082
|
+
case SyntaxKind.FunctionExpression: {
|
|
1083
|
+
const result = this.createNode(node, {
|
|
1084
|
+
type: ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
1085
|
+
id: this.convertChild(node.name),
|
|
1086
|
+
generator: !!node.asteriskToken,
|
|
1087
|
+
params: this.convertParameters(node.parameters),
|
|
1088
|
+
body: this.convertChild(node.body),
|
|
1089
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
1090
|
+
expression: false,
|
|
1091
|
+
});
|
|
1092
|
+
// Process returnType
|
|
1093
|
+
if (node.type) {
|
|
1094
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
1095
|
+
}
|
|
1096
|
+
// Process typeParameters
|
|
1097
|
+
if (node.typeParameters) {
|
|
1098
|
+
result.typeParameters =
|
|
1099
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
1100
|
+
}
|
|
1101
|
+
return result;
|
|
1102
|
+
}
|
|
1103
|
+
case SyntaxKind.SuperKeyword:
|
|
1104
|
+
return this.createNode(node, {
|
|
1105
|
+
type: ts_estree_1.AST_NODE_TYPES.Super,
|
|
1106
|
+
});
|
|
1107
|
+
case SyntaxKind.ArrayBindingPattern:
|
|
1108
|
+
return this.createNode(node, {
|
|
1109
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrayPattern,
|
|
1110
|
+
elements: node.elements.map(el => this.convertPattern(el)),
|
|
1111
|
+
});
|
|
1112
|
+
// occurs with missing array elements like [,]
|
|
1113
|
+
case SyntaxKind.OmittedExpression:
|
|
1114
|
+
return null;
|
|
1115
|
+
case SyntaxKind.ObjectBindingPattern:
|
|
1116
|
+
return this.createNode(node, {
|
|
1117
|
+
type: ts_estree_1.AST_NODE_TYPES.ObjectPattern,
|
|
1118
|
+
properties: node.elements.map(el => this.convertPattern(el)),
|
|
1119
|
+
});
|
|
1120
|
+
case SyntaxKind.BindingElement: {
|
|
1121
|
+
if (parent.kind === SyntaxKind.ArrayBindingPattern) {
|
|
1122
|
+
const arrayItem = this.convertChild(node.name, parent);
|
|
1123
|
+
if (node.initializer) {
|
|
1124
|
+
return this.createNode(node, {
|
|
1125
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1126
|
+
left: arrayItem,
|
|
1127
|
+
right: this.convertChild(node.initializer),
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
else if (node.dotDotDotToken) {
|
|
1131
|
+
return this.createNode(node, {
|
|
1132
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1133
|
+
argument: arrayItem,
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
return arrayItem;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
else {
|
|
1141
|
+
let result;
|
|
1142
|
+
if (node.dotDotDotToken) {
|
|
1143
|
+
result = this.createNode(node, {
|
|
1144
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1145
|
+
argument: this.convertChild((_a = node.propertyName) !== null && _a !== void 0 ? _a : node.name),
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
else {
|
|
1149
|
+
result = this.createNode(node, {
|
|
1150
|
+
type: ts_estree_1.AST_NODE_TYPES.Property,
|
|
1151
|
+
key: this.convertChild((_b = node.propertyName) !== null && _b !== void 0 ? _b : node.name),
|
|
1152
|
+
value: this.convertChild(node.name),
|
|
1153
|
+
computed: Boolean(node.propertyName &&
|
|
1154
|
+
node.propertyName.kind === SyntaxKind.ComputedPropertyName),
|
|
1155
|
+
method: false,
|
|
1156
|
+
shorthand: !node.propertyName,
|
|
1157
|
+
kind: 'init',
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
if (node.initializer) {
|
|
1161
|
+
result.value = this.createNode(node, {
|
|
1162
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1163
|
+
left: this.convertChild(node.name),
|
|
1164
|
+
right: this.convertChild(node.initializer),
|
|
1165
|
+
range: [node.name.getStart(this.ast), node.initializer.end],
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
return result;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
case SyntaxKind.ArrowFunction: {
|
|
1172
|
+
const result = this.createNode(node, {
|
|
1173
|
+
type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
1174
|
+
generator: false,
|
|
1175
|
+
id: null,
|
|
1176
|
+
params: this.convertParameters(node.parameters),
|
|
1177
|
+
body: this.convertChild(node.body),
|
|
1178
|
+
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
|
|
1179
|
+
expression: node.body.kind !== SyntaxKind.Block,
|
|
1180
|
+
});
|
|
1181
|
+
// Process returnType
|
|
1182
|
+
if (node.type) {
|
|
1183
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
1184
|
+
}
|
|
1185
|
+
// Process typeParameters
|
|
1186
|
+
if (node.typeParameters) {
|
|
1187
|
+
result.typeParameters =
|
|
1188
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
1189
|
+
}
|
|
1190
|
+
return result;
|
|
1191
|
+
}
|
|
1192
|
+
case SyntaxKind.YieldExpression:
|
|
1193
|
+
return this.createNode(node, {
|
|
1194
|
+
type: ts_estree_1.AST_NODE_TYPES.YieldExpression,
|
|
1195
|
+
delegate: !!node.asteriskToken,
|
|
1196
|
+
argument: this.convertChild(node.expression),
|
|
1197
|
+
});
|
|
1198
|
+
case SyntaxKind.AwaitExpression:
|
|
1199
|
+
return this.createNode(node, {
|
|
1200
|
+
type: ts_estree_1.AST_NODE_TYPES.AwaitExpression,
|
|
1201
|
+
argument: this.convertChild(node.expression),
|
|
1202
|
+
});
|
|
1203
|
+
// Template Literals
|
|
1204
|
+
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
|
1205
|
+
return this.createNode(node, {
|
|
1206
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral,
|
|
1207
|
+
quasis: [
|
|
1208
|
+
this.createNode(node, {
|
|
1209
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateElement,
|
|
1210
|
+
value: {
|
|
1211
|
+
raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1),
|
|
1212
|
+
cooked: node.text,
|
|
1213
|
+
},
|
|
1214
|
+
tail: true,
|
|
1215
|
+
}),
|
|
1216
|
+
],
|
|
1217
|
+
expressions: [],
|
|
1218
|
+
});
|
|
1219
|
+
case SyntaxKind.TemplateExpression: {
|
|
1220
|
+
const result = this.createNode(node, {
|
|
1221
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral,
|
|
1222
|
+
quasis: [this.convertChild(node.head)],
|
|
1223
|
+
expressions: [],
|
|
1224
|
+
});
|
|
1225
|
+
node.templateSpans.forEach(templateSpan => {
|
|
1226
|
+
result.expressions.push(this.convertChild(templateSpan.expression));
|
|
1227
|
+
result.quasis.push(this.convertChild(templateSpan.literal));
|
|
1228
|
+
});
|
|
1229
|
+
return result;
|
|
1230
|
+
}
|
|
1231
|
+
case SyntaxKind.TaggedTemplateExpression:
|
|
1232
|
+
return this.createNode(node, {
|
|
1233
|
+
type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression,
|
|
1234
|
+
typeParameters: node.typeArguments
|
|
1235
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
1236
|
+
: undefined,
|
|
1237
|
+
tag: this.convertChild(node.tag),
|
|
1238
|
+
quasi: this.convertChild(node.template),
|
|
1239
|
+
});
|
|
1240
|
+
case SyntaxKind.TemplateHead:
|
|
1241
|
+
case SyntaxKind.TemplateMiddle:
|
|
1242
|
+
case SyntaxKind.TemplateTail: {
|
|
1243
|
+
const tail = node.kind === SyntaxKind.TemplateTail;
|
|
1244
|
+
return this.createNode(node, {
|
|
1245
|
+
type: ts_estree_1.AST_NODE_TYPES.TemplateElement,
|
|
1246
|
+
value: {
|
|
1247
|
+
raw: this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2)),
|
|
1248
|
+
cooked: node.text,
|
|
1249
|
+
},
|
|
1250
|
+
tail,
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
// Patterns
|
|
1254
|
+
case SyntaxKind.SpreadAssignment:
|
|
1255
|
+
case SyntaxKind.SpreadElement: {
|
|
1256
|
+
if (this.allowPattern) {
|
|
1257
|
+
return this.createNode(node, {
|
|
1258
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1259
|
+
argument: this.convertPattern(node.expression),
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
else {
|
|
1263
|
+
return this.createNode(node, {
|
|
1264
|
+
type: ts_estree_1.AST_NODE_TYPES.SpreadElement,
|
|
1265
|
+
argument: this.convertChild(node.expression),
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
case SyntaxKind.Parameter: {
|
|
1270
|
+
let parameter;
|
|
1271
|
+
let result;
|
|
1272
|
+
if (node.dotDotDotToken) {
|
|
1273
|
+
parameter = result = this.createNode(node, {
|
|
1274
|
+
type: ts_estree_1.AST_NODE_TYPES.RestElement,
|
|
1275
|
+
argument: this.convertChild(node.name),
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
else if (node.initializer) {
|
|
1279
|
+
parameter = this.convertChild(node.name);
|
|
1280
|
+
result = this.createNode(node, {
|
|
1281
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1282
|
+
left: parameter,
|
|
1283
|
+
right: this.convertChild(node.initializer),
|
|
1284
|
+
});
|
|
1285
|
+
const modifiers = (0, getModifiers_1.getModifiers)(node);
|
|
1286
|
+
if (modifiers) {
|
|
1287
|
+
// AssignmentPattern should not contain modifiers in range
|
|
1288
|
+
result.range[0] = parameter.range[0];
|
|
1289
|
+
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
parameter = result = this.convertChild(node.name, parent);
|
|
1294
|
+
}
|
|
1295
|
+
if (node.type) {
|
|
1296
|
+
parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
1297
|
+
this.fixParentLocation(parameter, parameter.typeAnnotation.range);
|
|
1298
|
+
}
|
|
1299
|
+
if (node.questionToken) {
|
|
1300
|
+
if (node.questionToken.end > parameter.range[1]) {
|
|
1301
|
+
parameter.range[1] = node.questionToken.end;
|
|
1302
|
+
parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast);
|
|
1303
|
+
}
|
|
1304
|
+
parameter.optional = true;
|
|
1305
|
+
}
|
|
1306
|
+
const modifiers = (0, getModifiers_1.getModifiers)(node);
|
|
1307
|
+
if (modifiers) {
|
|
1308
|
+
return this.createNode(node, {
|
|
1309
|
+
type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty,
|
|
1310
|
+
accessibility: (_c = (0, node_utils_1.getTSNodeAccessibility)(node)) !== null && _c !== void 0 ? _c : undefined,
|
|
1311
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
|
|
1312
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node) || undefined,
|
|
1313
|
+
export: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node) || undefined,
|
|
1314
|
+
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node) || undefined,
|
|
1315
|
+
parameter: result,
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
return result;
|
|
1319
|
+
}
|
|
1320
|
+
// Classes
|
|
1321
|
+
case SyntaxKind.ClassDeclaration:
|
|
1322
|
+
case SyntaxKind.ClassExpression: {
|
|
1323
|
+
const heritageClauses = (_d = node.heritageClauses) !== null && _d !== void 0 ? _d : [];
|
|
1324
|
+
const classNodeType = node.kind === SyntaxKind.ClassDeclaration
|
|
1325
|
+
? ts_estree_1.AST_NODE_TYPES.ClassDeclaration
|
|
1326
|
+
: ts_estree_1.AST_NODE_TYPES.ClassExpression;
|
|
1327
|
+
const superClass = heritageClauses.find(clause => clause.token === SyntaxKind.ExtendsKeyword);
|
|
1328
|
+
const implementsClause = heritageClauses.find(clause => clause.token === SyntaxKind.ImplementsKeyword);
|
|
1329
|
+
const result = this.createNode(node, {
|
|
1330
|
+
type: classNodeType,
|
|
1331
|
+
id: this.convertChild(node.name),
|
|
1332
|
+
body: this.createNode(node, {
|
|
1333
|
+
type: ts_estree_1.AST_NODE_TYPES.ClassBody,
|
|
1334
|
+
body: [],
|
|
1335
|
+
range: [node.members.pos - 1, node.end],
|
|
1336
|
+
}),
|
|
1337
|
+
superClass: (superClass === null || superClass === void 0 ? void 0 : superClass.types[0])
|
|
1338
|
+
? this.convertChild(superClass.types[0].expression)
|
|
1339
|
+
: null,
|
|
1340
|
+
});
|
|
1341
|
+
if (superClass) {
|
|
1342
|
+
if (superClass.types.length > 1) {
|
|
1343
|
+
throw (0, node_utils_1.createError)(this.ast, superClass.types[1].pos, 'Classes can only extend a single class.');
|
|
1344
|
+
}
|
|
1345
|
+
if ((_e = superClass.types[0]) === null || _e === void 0 ? void 0 : _e.typeArguments) {
|
|
1346
|
+
result.superTypeParameters =
|
|
1347
|
+
this.convertTypeArgumentsToTypeParameters(superClass.types[0].typeArguments, superClass.types[0]);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
if (node.typeParameters) {
|
|
1351
|
+
result.typeParameters =
|
|
1352
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
1353
|
+
}
|
|
1354
|
+
if (implementsClause) {
|
|
1355
|
+
result.implements = implementsClause.types.map(el => this.convertChild(el));
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* TypeScript class declarations can be defined as "abstract"
|
|
1359
|
+
*/
|
|
1360
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)) {
|
|
1361
|
+
result.abstract = true;
|
|
1362
|
+
}
|
|
1363
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
|
|
1364
|
+
result.declare = true;
|
|
1365
|
+
}
|
|
1366
|
+
const decorators = (0, getModifiers_1.getDecorators)(node);
|
|
1367
|
+
if (decorators) {
|
|
1368
|
+
result.decorators = decorators.map(el => this.convertChild(el));
|
|
1369
|
+
}
|
|
1370
|
+
const filteredMembers = node.members.filter(node_utils_1.isESTreeClassMember);
|
|
1371
|
+
if (filteredMembers.length) {
|
|
1372
|
+
result.body.body = filteredMembers.map(el => this.convertChild(el));
|
|
1373
|
+
}
|
|
1374
|
+
// check for exports
|
|
1375
|
+
return this.fixExports(node, result);
|
|
1376
|
+
}
|
|
1377
|
+
// Modules
|
|
1378
|
+
case SyntaxKind.ModuleBlock:
|
|
1379
|
+
return this.createNode(node, {
|
|
1380
|
+
type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock,
|
|
1381
|
+
body: this.convertBodyExpressions(node.statements, node),
|
|
1382
|
+
});
|
|
1383
|
+
case SyntaxKind.ImportDeclaration: {
|
|
1384
|
+
this.assertModuleSpecifier(node, false);
|
|
1385
|
+
const result = this.createNode(node, {
|
|
1386
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration,
|
|
1387
|
+
source: this.convertChild(node.moduleSpecifier),
|
|
1388
|
+
specifiers: [],
|
|
1389
|
+
importKind: 'value',
|
|
1390
|
+
assertions: this.convertAssertClasue(node.assertClause),
|
|
1391
|
+
});
|
|
1392
|
+
if (node.importClause) {
|
|
1393
|
+
if (node.importClause.isTypeOnly) {
|
|
1394
|
+
result.importKind = 'type';
|
|
1395
|
+
}
|
|
1396
|
+
if (node.importClause.name) {
|
|
1397
|
+
result.specifiers.push(this.convertChild(node.importClause));
|
|
1398
|
+
}
|
|
1399
|
+
if (node.importClause.namedBindings) {
|
|
1400
|
+
switch (node.importClause.namedBindings.kind) {
|
|
1401
|
+
case SyntaxKind.NamespaceImport:
|
|
1402
|
+
result.specifiers.push(this.convertChild(node.importClause.namedBindings));
|
|
1403
|
+
break;
|
|
1404
|
+
case SyntaxKind.NamedImports:
|
|
1405
|
+
result.specifiers = result.specifiers.concat(node.importClause.namedBindings.elements.map(el => this.convertChild(el)));
|
|
1406
|
+
break;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
return result;
|
|
1411
|
+
}
|
|
1412
|
+
case SyntaxKind.NamespaceImport:
|
|
1413
|
+
return this.createNode(node, {
|
|
1414
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier,
|
|
1415
|
+
local: this.convertChild(node.name),
|
|
1416
|
+
});
|
|
1417
|
+
case SyntaxKind.ImportSpecifier:
|
|
1418
|
+
return this.createNode(node, {
|
|
1419
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier,
|
|
1420
|
+
local: this.convertChild(node.name),
|
|
1421
|
+
imported: this.convertChild((_f = node.propertyName) !== null && _f !== void 0 ? _f : node.name),
|
|
1422
|
+
importKind: node.isTypeOnly ? 'type' : 'value',
|
|
1423
|
+
});
|
|
1424
|
+
case SyntaxKind.ImportClause: {
|
|
1425
|
+
const local = this.convertChild(node.name);
|
|
1426
|
+
return this.createNode(node, {
|
|
1427
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier,
|
|
1428
|
+
local,
|
|
1429
|
+
range: local.range,
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
case SyntaxKind.ExportDeclaration: {
|
|
1433
|
+
if (((_g = node.exportClause) === null || _g === void 0 ? void 0 : _g.kind) === SyntaxKind.NamedExports) {
|
|
1434
|
+
this.assertModuleSpecifier(node, true);
|
|
1435
|
+
return this.createNode(node, {
|
|
1436
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
|
|
1437
|
+
source: this.convertChild(node.moduleSpecifier),
|
|
1438
|
+
specifiers: node.exportClause.elements.map(el => this.convertChild(el)),
|
|
1439
|
+
exportKind: node.isTypeOnly ? 'type' : 'value',
|
|
1440
|
+
declaration: null,
|
|
1441
|
+
assertions: this.convertAssertClasue(node.assertClause),
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
else {
|
|
1445
|
+
this.assertModuleSpecifier(node, false);
|
|
1446
|
+
return this.createNode(node, {
|
|
1447
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration,
|
|
1448
|
+
source: this.convertChild(node.moduleSpecifier),
|
|
1449
|
+
exportKind: node.isTypeOnly ? 'type' : 'value',
|
|
1450
|
+
exported:
|
|
1451
|
+
// note - for compat with 3.7.x, where node.exportClause is always undefined and
|
|
1452
|
+
// SyntaxKind.NamespaceExport does not exist yet (i.e. is undefined), this
|
|
1453
|
+
// cannot be shortened to an optional chain, or else you end up with
|
|
1454
|
+
// undefined === undefined, and the true path will hard error at runtime
|
|
1455
|
+
node.exportClause &&
|
|
1456
|
+
node.exportClause.kind === SyntaxKind.NamespaceExport
|
|
1457
|
+
? this.convertChild(node.exportClause.name)
|
|
1458
|
+
: null,
|
|
1459
|
+
assertions: this.convertAssertClasue(node.assertClause),
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
case SyntaxKind.ExportSpecifier:
|
|
1464
|
+
return this.createNode(node, {
|
|
1465
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier,
|
|
1466
|
+
local: this.convertChild((_h = node.propertyName) !== null && _h !== void 0 ? _h : node.name),
|
|
1467
|
+
exported: this.convertChild(node.name),
|
|
1468
|
+
exportKind: node.isTypeOnly ? 'type' : 'value',
|
|
1469
|
+
});
|
|
1470
|
+
case SyntaxKind.ExportAssignment:
|
|
1471
|
+
if (node.isExportEquals) {
|
|
1472
|
+
return this.createNode(node, {
|
|
1473
|
+
type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment,
|
|
1474
|
+
expression: this.convertChild(node.expression),
|
|
1475
|
+
});
|
|
1476
|
+
}
|
|
1477
|
+
else {
|
|
1478
|
+
return this.createNode(node, {
|
|
1479
|
+
type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration,
|
|
1480
|
+
declaration: this.convertChild(node.expression),
|
|
1481
|
+
exportKind: 'value',
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
// Unary Operations
|
|
1485
|
+
case SyntaxKind.PrefixUnaryExpression:
|
|
1486
|
+
case SyntaxKind.PostfixUnaryExpression: {
|
|
1487
|
+
const operator = (0, node_utils_1.getTextForTokenKind)(node.operator);
|
|
1488
|
+
/**
|
|
1489
|
+
* ESTree uses UpdateExpression for ++/--
|
|
1490
|
+
*/
|
|
1491
|
+
if (operator === '++' || operator === '--') {
|
|
1492
|
+
return this.createNode(node, {
|
|
1493
|
+
type: ts_estree_1.AST_NODE_TYPES.UpdateExpression,
|
|
1494
|
+
operator,
|
|
1495
|
+
prefix: node.kind === SyntaxKind.PrefixUnaryExpression,
|
|
1496
|
+
argument: this.convertChild(node.operand),
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
else {
|
|
1500
|
+
return this.createNode(node, {
|
|
1501
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1502
|
+
operator,
|
|
1503
|
+
prefix: node.kind === SyntaxKind.PrefixUnaryExpression,
|
|
1504
|
+
argument: this.convertChild(node.operand),
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
case SyntaxKind.DeleteExpression:
|
|
1509
|
+
return this.createNode(node, {
|
|
1510
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1511
|
+
operator: 'delete',
|
|
1512
|
+
prefix: true,
|
|
1513
|
+
argument: this.convertChild(node.expression),
|
|
1514
|
+
});
|
|
1515
|
+
case SyntaxKind.VoidExpression:
|
|
1516
|
+
return this.createNode(node, {
|
|
1517
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1518
|
+
operator: 'void',
|
|
1519
|
+
prefix: true,
|
|
1520
|
+
argument: this.convertChild(node.expression),
|
|
1521
|
+
});
|
|
1522
|
+
case SyntaxKind.TypeOfExpression:
|
|
1523
|
+
return this.createNode(node, {
|
|
1524
|
+
type: ts_estree_1.AST_NODE_TYPES.UnaryExpression,
|
|
1525
|
+
operator: 'typeof',
|
|
1526
|
+
prefix: true,
|
|
1527
|
+
argument: this.convertChild(node.expression),
|
|
1528
|
+
});
|
|
1529
|
+
case SyntaxKind.TypeOperator:
|
|
1530
|
+
return this.createNode(node, {
|
|
1531
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator,
|
|
1532
|
+
operator: (0, node_utils_1.getTextForTokenKind)(node.operator),
|
|
1533
|
+
typeAnnotation: this.convertChild(node.type),
|
|
1534
|
+
});
|
|
1535
|
+
// Binary Operations
|
|
1536
|
+
case SyntaxKind.BinaryExpression: {
|
|
1537
|
+
// TypeScript uses BinaryExpression for sequences as well
|
|
1538
|
+
if ((0, node_utils_1.isComma)(node.operatorToken)) {
|
|
1539
|
+
const result = this.createNode(node, {
|
|
1540
|
+
type: ts_estree_1.AST_NODE_TYPES.SequenceExpression,
|
|
1541
|
+
expressions: [],
|
|
1542
|
+
});
|
|
1543
|
+
const left = this.convertChild(node.left);
|
|
1544
|
+
if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression &&
|
|
1545
|
+
node.left.kind !== SyntaxKind.ParenthesizedExpression) {
|
|
1546
|
+
result.expressions = result.expressions.concat(left.expressions);
|
|
1547
|
+
}
|
|
1548
|
+
else {
|
|
1549
|
+
result.expressions.push(left);
|
|
1550
|
+
}
|
|
1551
|
+
result.expressions.push(this.convertChild(node.right));
|
|
1552
|
+
return result;
|
|
1553
|
+
}
|
|
1554
|
+
else {
|
|
1555
|
+
const type = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken);
|
|
1556
|
+
if (this.allowPattern &&
|
|
1557
|
+
type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) {
|
|
1558
|
+
return this.createNode(node, {
|
|
1559
|
+
type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern,
|
|
1560
|
+
left: this.convertPattern(node.left, node),
|
|
1561
|
+
right: this.convertChild(node.right),
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
return this.createNode(node, {
|
|
1565
|
+
type,
|
|
1566
|
+
operator: (0, node_utils_1.getTextForTokenKind)(node.operatorToken.kind),
|
|
1567
|
+
left: this.converter(node.left, node, this.inTypeMode, type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression),
|
|
1568
|
+
right: this.convertChild(node.right),
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
case SyntaxKind.PropertyAccessExpression: {
|
|
1573
|
+
const object = this.convertChild(node.expression);
|
|
1574
|
+
const property = this.convertChild(node.name);
|
|
1575
|
+
const computed = false;
|
|
1576
|
+
const result = this.createNode(node, {
|
|
1577
|
+
type: ts_estree_1.AST_NODE_TYPES.MemberExpression,
|
|
1578
|
+
object,
|
|
1579
|
+
property,
|
|
1580
|
+
computed,
|
|
1581
|
+
optional: node.questionDotToken !== undefined,
|
|
1582
|
+
});
|
|
1583
|
+
return this.convertChainExpression(result, node);
|
|
1584
|
+
}
|
|
1585
|
+
case SyntaxKind.ElementAccessExpression: {
|
|
1586
|
+
const object = this.convertChild(node.expression);
|
|
1587
|
+
const property = this.convertChild(node.argumentExpression);
|
|
1588
|
+
const computed = true;
|
|
1589
|
+
const result = this.createNode(node, {
|
|
1590
|
+
type: ts_estree_1.AST_NODE_TYPES.MemberExpression,
|
|
1591
|
+
object,
|
|
1592
|
+
property,
|
|
1593
|
+
computed,
|
|
1594
|
+
optional: node.questionDotToken !== undefined,
|
|
1595
|
+
});
|
|
1596
|
+
return this.convertChainExpression(result, node);
|
|
1597
|
+
}
|
|
1598
|
+
case SyntaxKind.CallExpression: {
|
|
1599
|
+
if (node.expression.kind === SyntaxKind.ImportKeyword) {
|
|
1600
|
+
if (node.arguments.length !== 1 && node.arguments.length !== 2) {
|
|
1601
|
+
throw (0, node_utils_1.createError)(this.ast, node.arguments.pos, 'Dynamic import requires exactly one or two arguments.');
|
|
1602
|
+
}
|
|
1603
|
+
return this.createNode(node, {
|
|
1604
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportExpression,
|
|
1605
|
+
source: this.convertChild(node.arguments[0]),
|
|
1606
|
+
attributes: node.arguments[1]
|
|
1607
|
+
? this.convertChild(node.arguments[1])
|
|
1608
|
+
: null,
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
const callee = this.convertChild(node.expression);
|
|
1612
|
+
const args = node.arguments.map(el => this.convertChild(el));
|
|
1613
|
+
const result = this.createNode(node, {
|
|
1614
|
+
type: ts_estree_1.AST_NODE_TYPES.CallExpression,
|
|
1615
|
+
callee,
|
|
1616
|
+
arguments: args,
|
|
1617
|
+
optional: node.questionDotToken !== undefined,
|
|
1618
|
+
});
|
|
1619
|
+
if (node.typeArguments) {
|
|
1620
|
+
result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node);
|
|
1621
|
+
}
|
|
1622
|
+
return this.convertChainExpression(result, node);
|
|
1623
|
+
}
|
|
1624
|
+
case SyntaxKind.NewExpression: {
|
|
1625
|
+
// NOTE - NewExpression cannot have an optional chain in it
|
|
1626
|
+
const result = this.createNode(node, {
|
|
1627
|
+
type: ts_estree_1.AST_NODE_TYPES.NewExpression,
|
|
1628
|
+
callee: this.convertChild(node.expression),
|
|
1629
|
+
arguments: node.arguments
|
|
1630
|
+
? node.arguments.map(el => this.convertChild(el))
|
|
1631
|
+
: [],
|
|
1632
|
+
});
|
|
1633
|
+
if (node.typeArguments) {
|
|
1634
|
+
result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node);
|
|
1635
|
+
}
|
|
1636
|
+
return result;
|
|
1637
|
+
}
|
|
1638
|
+
case SyntaxKind.ConditionalExpression:
|
|
1639
|
+
return this.createNode(node, {
|
|
1640
|
+
type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression,
|
|
1641
|
+
test: this.convertChild(node.condition),
|
|
1642
|
+
consequent: this.convertChild(node.whenTrue),
|
|
1643
|
+
alternate: this.convertChild(node.whenFalse),
|
|
1644
|
+
});
|
|
1645
|
+
case SyntaxKind.MetaProperty: {
|
|
1646
|
+
return this.createNode(node, {
|
|
1647
|
+
type: ts_estree_1.AST_NODE_TYPES.MetaProperty,
|
|
1648
|
+
meta: this.createNode(
|
|
1649
|
+
// TODO: do we really want to convert it to Token?
|
|
1650
|
+
node.getFirstToken(), {
|
|
1651
|
+
type: ts_estree_1.AST_NODE_TYPES.Identifier,
|
|
1652
|
+
name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken),
|
|
1653
|
+
}),
|
|
1654
|
+
property: this.convertChild(node.name),
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
case SyntaxKind.Decorator: {
|
|
1658
|
+
return this.createNode(node, {
|
|
1659
|
+
type: ts_estree_1.AST_NODE_TYPES.Decorator,
|
|
1660
|
+
expression: this.convertChild(node.expression),
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
// Literals
|
|
1664
|
+
case SyntaxKind.StringLiteral: {
|
|
1665
|
+
return this.createNode(node, {
|
|
1666
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1667
|
+
value: parent.kind === SyntaxKind.JsxAttribute
|
|
1668
|
+
? (0, node_utils_1.unescapeStringLiteralText)(node.text)
|
|
1669
|
+
: node.text,
|
|
1670
|
+
raw: node.getText(),
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
case SyntaxKind.NumericLiteral: {
|
|
1674
|
+
return this.createNode(node, {
|
|
1675
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1676
|
+
value: Number(node.text),
|
|
1677
|
+
raw: node.getText(),
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
case SyntaxKind.BigIntLiteral: {
|
|
1681
|
+
const range = (0, node_utils_1.getRange)(node, this.ast);
|
|
1682
|
+
const rawValue = this.ast.text.slice(range[0], range[1]);
|
|
1683
|
+
const bigint = rawValue
|
|
1684
|
+
// remove suffix `n`
|
|
1685
|
+
.slice(0, -1)
|
|
1686
|
+
// `BigInt` doesn't accept numeric separator
|
|
1687
|
+
// and `bigint` property should not include numeric separator
|
|
1688
|
+
.replace(/_/g, '');
|
|
1689
|
+
const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null;
|
|
1690
|
+
return this.createNode(node, {
|
|
1691
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1692
|
+
raw: rawValue,
|
|
1693
|
+
value: value,
|
|
1694
|
+
bigint: value === null ? bigint : String(value),
|
|
1695
|
+
range,
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
case SyntaxKind.RegularExpressionLiteral: {
|
|
1699
|
+
const pattern = node.text.slice(1, node.text.lastIndexOf('/'));
|
|
1700
|
+
const flags = node.text.slice(node.text.lastIndexOf('/') + 1);
|
|
1701
|
+
let regex = null;
|
|
1702
|
+
try {
|
|
1703
|
+
regex = new RegExp(pattern, flags);
|
|
1704
|
+
}
|
|
1705
|
+
catch (exception) {
|
|
1706
|
+
regex = null;
|
|
1707
|
+
}
|
|
1708
|
+
return this.createNode(node, {
|
|
1709
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1710
|
+
value: regex,
|
|
1711
|
+
raw: node.text,
|
|
1712
|
+
regex: {
|
|
1713
|
+
pattern,
|
|
1714
|
+
flags,
|
|
1715
|
+
},
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
case SyntaxKind.TrueKeyword:
|
|
1719
|
+
return this.createNode(node, {
|
|
1720
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1721
|
+
value: true,
|
|
1722
|
+
raw: 'true',
|
|
1723
|
+
});
|
|
1724
|
+
case SyntaxKind.FalseKeyword:
|
|
1725
|
+
return this.createNode(node, {
|
|
1726
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1727
|
+
value: false,
|
|
1728
|
+
raw: 'false',
|
|
1729
|
+
});
|
|
1730
|
+
case SyntaxKind.NullKeyword: {
|
|
1731
|
+
if (!version_check_1.typescriptVersionIsAtLeast['4.0'] && this.inTypeMode) {
|
|
1732
|
+
// 4.0 started nesting null types inside a LiteralType node, but we still need to support pre-4.0
|
|
1733
|
+
return this.createNode(node, {
|
|
1734
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword,
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
return this.createNode(node, {
|
|
1738
|
+
type: ts_estree_1.AST_NODE_TYPES.Literal,
|
|
1739
|
+
value: null,
|
|
1740
|
+
raw: 'null',
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
case SyntaxKind.EmptyStatement:
|
|
1744
|
+
return this.createNode(node, {
|
|
1745
|
+
type: ts_estree_1.AST_NODE_TYPES.EmptyStatement,
|
|
1746
|
+
});
|
|
1747
|
+
case SyntaxKind.DebuggerStatement:
|
|
1748
|
+
return this.createNode(node, {
|
|
1749
|
+
type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement,
|
|
1750
|
+
});
|
|
1751
|
+
// JSX
|
|
1752
|
+
case SyntaxKind.JsxElement:
|
|
1753
|
+
return this.createNode(node, {
|
|
1754
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXElement,
|
|
1755
|
+
openingElement: this.convertChild(node.openingElement),
|
|
1756
|
+
closingElement: this.convertChild(node.closingElement),
|
|
1757
|
+
children: node.children.map(el => this.convertChild(el)),
|
|
1758
|
+
});
|
|
1759
|
+
case SyntaxKind.JsxFragment:
|
|
1760
|
+
return this.createNode(node, {
|
|
1761
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXFragment,
|
|
1762
|
+
openingFragment: this.convertChild(node.openingFragment),
|
|
1763
|
+
closingFragment: this.convertChild(node.closingFragment),
|
|
1764
|
+
children: node.children.map(el => this.convertChild(el)),
|
|
1765
|
+
});
|
|
1766
|
+
case SyntaxKind.JsxSelfClosingElement: {
|
|
1767
|
+
return this.createNode(node, {
|
|
1768
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXElement,
|
|
1769
|
+
/**
|
|
1770
|
+
* Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement,
|
|
1771
|
+
* TypeScript does not seem to have the idea of openingElement when tag is self-closing
|
|
1772
|
+
*/
|
|
1773
|
+
openingElement: this.createNode(node, {
|
|
1774
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1775
|
+
typeParameters: node.typeArguments
|
|
1776
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
1777
|
+
: undefined,
|
|
1778
|
+
selfClosing: true,
|
|
1779
|
+
name: this.convertJSXTagName(node.tagName, node),
|
|
1780
|
+
attributes: node.attributes.properties.map(el => this.convertChild(el)),
|
|
1781
|
+
range: (0, node_utils_1.getRange)(node, this.ast),
|
|
1782
|
+
}),
|
|
1783
|
+
closingElement: null,
|
|
1784
|
+
children: [],
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
case SyntaxKind.JsxOpeningElement:
|
|
1788
|
+
return this.createNode(node, {
|
|
1789
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement,
|
|
1790
|
+
typeParameters: node.typeArguments
|
|
1791
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
1792
|
+
: undefined,
|
|
1793
|
+
selfClosing: false,
|
|
1794
|
+
name: this.convertJSXTagName(node.tagName, node),
|
|
1795
|
+
attributes: node.attributes.properties.map(el => this.convertChild(el)),
|
|
1796
|
+
});
|
|
1797
|
+
case SyntaxKind.JsxClosingElement:
|
|
1798
|
+
return this.createNode(node, {
|
|
1799
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement,
|
|
1800
|
+
name: this.convertJSXTagName(node.tagName, node),
|
|
1801
|
+
});
|
|
1802
|
+
case SyntaxKind.JsxOpeningFragment:
|
|
1803
|
+
return this.createNode(node, {
|
|
1804
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment,
|
|
1805
|
+
});
|
|
1806
|
+
case SyntaxKind.JsxClosingFragment:
|
|
1807
|
+
return this.createNode(node, {
|
|
1808
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment,
|
|
1809
|
+
});
|
|
1810
|
+
case SyntaxKind.JsxExpression: {
|
|
1811
|
+
const expression = node.expression
|
|
1812
|
+
? this.convertChild(node.expression)
|
|
1813
|
+
: this.createNode(node, {
|
|
1814
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression,
|
|
1815
|
+
range: [node.getStart(this.ast) + 1, node.getEnd() - 1],
|
|
1816
|
+
});
|
|
1817
|
+
if (node.dotDotDotToken) {
|
|
1818
|
+
return this.createNode(node, {
|
|
1819
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild,
|
|
1820
|
+
expression,
|
|
1821
|
+
});
|
|
1822
|
+
}
|
|
1823
|
+
else {
|
|
1824
|
+
return this.createNode(node, {
|
|
1825
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer,
|
|
1826
|
+
expression,
|
|
1827
|
+
});
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
case SyntaxKind.JsxAttribute: {
|
|
1831
|
+
return this.createNode(node, {
|
|
1832
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXAttribute,
|
|
1833
|
+
name: this.convertJSXNamespaceOrIdentifier(node.name),
|
|
1834
|
+
value: this.convertChild(node.initializer),
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
case SyntaxKind.JsxText: {
|
|
1838
|
+
const start = node.getFullStart();
|
|
1839
|
+
const end = node.getEnd();
|
|
1840
|
+
const text = this.ast.text.slice(start, end);
|
|
1841
|
+
return this.createNode(node, {
|
|
1842
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXText,
|
|
1843
|
+
value: (0, node_utils_1.unescapeStringLiteralText)(text),
|
|
1844
|
+
raw: text,
|
|
1845
|
+
range: [start, end],
|
|
1846
|
+
});
|
|
1847
|
+
}
|
|
1848
|
+
case SyntaxKind.JsxSpreadAttribute:
|
|
1849
|
+
return this.createNode(node, {
|
|
1850
|
+
type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute,
|
|
1851
|
+
argument: this.convertChild(node.expression),
|
|
1852
|
+
});
|
|
1853
|
+
case SyntaxKind.QualifiedName: {
|
|
1854
|
+
return this.createNode(node, {
|
|
1855
|
+
type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName,
|
|
1856
|
+
left: this.convertChild(node.left),
|
|
1857
|
+
right: this.convertChild(node.right),
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
// TypeScript specific
|
|
1861
|
+
case SyntaxKind.TypeReference: {
|
|
1862
|
+
return this.createNode(node, {
|
|
1863
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeReference,
|
|
1864
|
+
typeName: this.convertType(node.typeName),
|
|
1865
|
+
typeParameters: node.typeArguments
|
|
1866
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
1867
|
+
: undefined,
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
case SyntaxKind.TypeParameter: {
|
|
1871
|
+
return this.createNode(node, {
|
|
1872
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter,
|
|
1873
|
+
name: this.convertType(node.name),
|
|
1874
|
+
constraint: node.constraint
|
|
1875
|
+
? this.convertType(node.constraint)
|
|
1876
|
+
: undefined,
|
|
1877
|
+
default: node.default ? this.convertType(node.default) : undefined,
|
|
1878
|
+
in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node),
|
|
1879
|
+
out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node),
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
case SyntaxKind.ThisType:
|
|
1883
|
+
return this.createNode(node, {
|
|
1884
|
+
type: ts_estree_1.AST_NODE_TYPES.TSThisType,
|
|
1885
|
+
});
|
|
1886
|
+
case SyntaxKind.AnyKeyword:
|
|
1887
|
+
case SyntaxKind.BigIntKeyword:
|
|
1888
|
+
case SyntaxKind.BooleanKeyword:
|
|
1889
|
+
case SyntaxKind.NeverKeyword:
|
|
1890
|
+
case SyntaxKind.NumberKeyword:
|
|
1891
|
+
case SyntaxKind.ObjectKeyword:
|
|
1892
|
+
case SyntaxKind.StringKeyword:
|
|
1893
|
+
case SyntaxKind.SymbolKeyword:
|
|
1894
|
+
case SyntaxKind.UnknownKeyword:
|
|
1895
|
+
case SyntaxKind.VoidKeyword:
|
|
1896
|
+
case SyntaxKind.UndefinedKeyword:
|
|
1897
|
+
case SyntaxKind.IntrinsicKeyword: {
|
|
1898
|
+
return this.createNode(node, {
|
|
1899
|
+
type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`],
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
case SyntaxKind.NonNullExpression: {
|
|
1903
|
+
const nnExpr = this.createNode(node, {
|
|
1904
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression,
|
|
1905
|
+
expression: this.convertChild(node.expression),
|
|
1906
|
+
});
|
|
1907
|
+
return this.convertChainExpression(nnExpr, node);
|
|
1908
|
+
}
|
|
1909
|
+
case SyntaxKind.TypeLiteral: {
|
|
1910
|
+
return this.createNode(node, {
|
|
1911
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral,
|
|
1912
|
+
members: node.members.map(el => this.convertChild(el)),
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
case SyntaxKind.ArrayType: {
|
|
1916
|
+
return this.createNode(node, {
|
|
1917
|
+
type: ts_estree_1.AST_NODE_TYPES.TSArrayType,
|
|
1918
|
+
elementType: this.convertType(node.elementType),
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
case SyntaxKind.IndexedAccessType: {
|
|
1922
|
+
return this.createNode(node, {
|
|
1923
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType,
|
|
1924
|
+
objectType: this.convertType(node.objectType),
|
|
1925
|
+
indexType: this.convertType(node.indexType),
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
case SyntaxKind.ConditionalType: {
|
|
1929
|
+
return this.createNode(node, {
|
|
1930
|
+
type: ts_estree_1.AST_NODE_TYPES.TSConditionalType,
|
|
1931
|
+
checkType: this.convertType(node.checkType),
|
|
1932
|
+
extendsType: this.convertType(node.extendsType),
|
|
1933
|
+
trueType: this.convertType(node.trueType),
|
|
1934
|
+
falseType: this.convertType(node.falseType),
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
case SyntaxKind.TypeQuery: {
|
|
1938
|
+
return this.createNode(node, {
|
|
1939
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery,
|
|
1940
|
+
exprName: this.convertType(node.exprName),
|
|
1941
|
+
typeParameters: node.typeArguments &&
|
|
1942
|
+
this.convertTypeArgumentsToTypeParameters(node.typeArguments, node),
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
case SyntaxKind.MappedType: {
|
|
1946
|
+
const result = this.createNode(node, {
|
|
1947
|
+
type: ts_estree_1.AST_NODE_TYPES.TSMappedType,
|
|
1948
|
+
typeParameter: this.convertType(node.typeParameter),
|
|
1949
|
+
nameType: (_j = this.convertType(node.nameType)) !== null && _j !== void 0 ? _j : null,
|
|
1950
|
+
});
|
|
1951
|
+
if (node.readonlyToken) {
|
|
1952
|
+
if (node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword) {
|
|
1953
|
+
result.readonly = true;
|
|
1954
|
+
}
|
|
1955
|
+
else {
|
|
1956
|
+
result.readonly = (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
if (node.questionToken) {
|
|
1960
|
+
if (node.questionToken.kind === SyntaxKind.QuestionToken) {
|
|
1961
|
+
result.optional = true;
|
|
1962
|
+
}
|
|
1963
|
+
else {
|
|
1964
|
+
result.optional = (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
if (node.type) {
|
|
1968
|
+
result.typeAnnotation = this.convertType(node.type);
|
|
1969
|
+
}
|
|
1970
|
+
return result;
|
|
1971
|
+
}
|
|
1972
|
+
case SyntaxKind.ParenthesizedExpression:
|
|
1973
|
+
return this.convertChild(node.expression, parent);
|
|
1974
|
+
case SyntaxKind.TypeAliasDeclaration: {
|
|
1975
|
+
const result = this.createNode(node, {
|
|
1976
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration,
|
|
1977
|
+
id: this.convertChild(node.name),
|
|
1978
|
+
typeAnnotation: this.convertType(node.type),
|
|
1979
|
+
});
|
|
1980
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
|
|
1981
|
+
result.declare = true;
|
|
1982
|
+
}
|
|
1983
|
+
// Process typeParameters
|
|
1984
|
+
if (node.typeParameters) {
|
|
1985
|
+
result.typeParameters =
|
|
1986
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
1987
|
+
}
|
|
1988
|
+
// check for exports
|
|
1989
|
+
return this.fixExports(node, result);
|
|
1990
|
+
}
|
|
1991
|
+
case SyntaxKind.MethodSignature: {
|
|
1992
|
+
return this.convertMethodSignature(node);
|
|
1993
|
+
}
|
|
1994
|
+
case SyntaxKind.PropertySignature: {
|
|
1995
|
+
const result = this.createNode(node, {
|
|
1996
|
+
type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
|
|
1997
|
+
optional: (0, node_utils_1.isOptional)(node) || undefined,
|
|
1998
|
+
computed: (0, node_utils_1.isComputedProperty)(node.name),
|
|
1999
|
+
key: this.convertChild(node.name),
|
|
2000
|
+
typeAnnotation: node.type
|
|
2001
|
+
? this.convertTypeAnnotation(node.type, node)
|
|
2002
|
+
: undefined,
|
|
2003
|
+
initializer: this.convertChild(
|
|
2004
|
+
// eslint-disable-next-line deprecation/deprecation -- TODO breaking change remove this from the AST
|
|
2005
|
+
node.initializer) || undefined,
|
|
2006
|
+
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
|
|
2007
|
+
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node) || undefined,
|
|
2008
|
+
export: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node) || undefined,
|
|
2009
|
+
});
|
|
2010
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
2011
|
+
if (accessibility) {
|
|
2012
|
+
result.accessibility = accessibility;
|
|
2013
|
+
}
|
|
2014
|
+
return result;
|
|
2015
|
+
}
|
|
2016
|
+
case SyntaxKind.IndexSignature: {
|
|
2017
|
+
const result = this.createNode(node, {
|
|
2018
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
|
|
2019
|
+
parameters: node.parameters.map(el => this.convertChild(el)),
|
|
2020
|
+
});
|
|
2021
|
+
if (node.type) {
|
|
2022
|
+
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
2023
|
+
}
|
|
2024
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node)) {
|
|
2025
|
+
result.readonly = true;
|
|
2026
|
+
}
|
|
2027
|
+
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
|
|
2028
|
+
if (accessibility) {
|
|
2029
|
+
result.accessibility = accessibility;
|
|
2030
|
+
}
|
|
2031
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node)) {
|
|
2032
|
+
result.export = true;
|
|
2033
|
+
}
|
|
2034
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node)) {
|
|
2035
|
+
result.static = true;
|
|
2036
|
+
}
|
|
2037
|
+
return result;
|
|
2038
|
+
}
|
|
2039
|
+
case SyntaxKind.ConstructorType: {
|
|
2040
|
+
const result = this.createNode(node, {
|
|
2041
|
+
type: ts_estree_1.AST_NODE_TYPES.TSConstructorType,
|
|
2042
|
+
params: this.convertParameters(node.parameters),
|
|
2043
|
+
abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node),
|
|
2044
|
+
});
|
|
2045
|
+
if (node.type) {
|
|
2046
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
2047
|
+
}
|
|
2048
|
+
if (node.typeParameters) {
|
|
2049
|
+
result.typeParameters =
|
|
2050
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
2051
|
+
}
|
|
2052
|
+
return result;
|
|
2053
|
+
}
|
|
2054
|
+
case SyntaxKind.FunctionType:
|
|
2055
|
+
case SyntaxKind.ConstructSignature:
|
|
2056
|
+
case SyntaxKind.CallSignature: {
|
|
2057
|
+
const type = node.kind === SyntaxKind.ConstructSignature
|
|
2058
|
+
? ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration
|
|
2059
|
+
: node.kind === SyntaxKind.CallSignature
|
|
2060
|
+
? ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration
|
|
2061
|
+
: ts_estree_1.AST_NODE_TYPES.TSFunctionType;
|
|
2062
|
+
const result = this.createNode(node, {
|
|
2063
|
+
type: type,
|
|
2064
|
+
params: this.convertParameters(node.parameters),
|
|
2065
|
+
});
|
|
2066
|
+
if (node.type) {
|
|
2067
|
+
result.returnType = this.convertTypeAnnotation(node.type, node);
|
|
2068
|
+
}
|
|
2069
|
+
if (node.typeParameters) {
|
|
2070
|
+
result.typeParameters =
|
|
2071
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
2072
|
+
}
|
|
2073
|
+
return result;
|
|
2074
|
+
}
|
|
2075
|
+
case SyntaxKind.ExpressionWithTypeArguments: {
|
|
2076
|
+
const parentKind = parent.kind;
|
|
2077
|
+
const type = parentKind === SyntaxKind.InterfaceDeclaration
|
|
2078
|
+
? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage
|
|
2079
|
+
: parentKind === SyntaxKind.HeritageClause
|
|
2080
|
+
? ts_estree_1.AST_NODE_TYPES.TSClassImplements
|
|
2081
|
+
: ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression;
|
|
2082
|
+
const result = this.createNode(node, {
|
|
2083
|
+
type,
|
|
2084
|
+
expression: this.convertChild(node.expression),
|
|
2085
|
+
});
|
|
2086
|
+
if (node.typeArguments) {
|
|
2087
|
+
result.typeParameters = this.convertTypeArgumentsToTypeParameters(node.typeArguments, node);
|
|
2088
|
+
}
|
|
2089
|
+
return result;
|
|
2090
|
+
}
|
|
2091
|
+
case SyntaxKind.InterfaceDeclaration: {
|
|
2092
|
+
const interfaceHeritageClauses = (_k = node.heritageClauses) !== null && _k !== void 0 ? _k : [];
|
|
2093
|
+
const result = this.createNode(node, {
|
|
2094
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration,
|
|
2095
|
+
body: this.createNode(node, {
|
|
2096
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody,
|
|
2097
|
+
body: node.members.map(member => this.convertChild(member)),
|
|
2098
|
+
range: [node.members.pos - 1, node.end],
|
|
2099
|
+
}),
|
|
2100
|
+
id: this.convertChild(node.name),
|
|
2101
|
+
});
|
|
2102
|
+
if (node.typeParameters) {
|
|
2103
|
+
result.typeParameters =
|
|
2104
|
+
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
|
|
2105
|
+
}
|
|
2106
|
+
if (interfaceHeritageClauses.length > 0) {
|
|
2107
|
+
const interfaceExtends = [];
|
|
2108
|
+
const interfaceImplements = [];
|
|
2109
|
+
for (const heritageClause of interfaceHeritageClauses) {
|
|
2110
|
+
if (heritageClause.token === SyntaxKind.ExtendsKeyword) {
|
|
2111
|
+
for (const n of heritageClause.types) {
|
|
2112
|
+
interfaceExtends.push(this.convertChild(n, node));
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
else {
|
|
2116
|
+
for (const n of heritageClause.types) {
|
|
2117
|
+
interfaceImplements.push(this.convertChild(n, node));
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
if (interfaceExtends.length) {
|
|
2122
|
+
result.extends = interfaceExtends;
|
|
2123
|
+
}
|
|
2124
|
+
if (interfaceImplements.length) {
|
|
2125
|
+
result.implements = interfaceImplements;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)) {
|
|
2129
|
+
result.abstract = true;
|
|
2130
|
+
}
|
|
2131
|
+
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
|
|
2132
|
+
result.declare = true;
|
|
2133
|
+
}
|
|
2134
|
+
// check for exports
|
|
2135
|
+
return this.fixExports(node, result);
|
|
2136
|
+
}
|
|
2137
|
+
case SyntaxKind.TypePredicate: {
|
|
2138
|
+
const result = this.createNode(node, {
|
|
2139
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate,
|
|
2140
|
+
asserts: node.assertsModifier !== undefined,
|
|
2141
|
+
parameterName: this.convertChild(node.parameterName),
|
|
2142
|
+
typeAnnotation: null,
|
|
2143
|
+
});
|
|
2144
|
+
/**
|
|
2145
|
+
* Specific fix for type-guard location data
|
|
2146
|
+
*/
|
|
2147
|
+
if (node.type) {
|
|
2148
|
+
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
|
|
2149
|
+
result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc;
|
|
2150
|
+
result.typeAnnotation.range =
|
|
2151
|
+
result.typeAnnotation.typeAnnotation.range;
|
|
2152
|
+
}
|
|
2153
|
+
return result;
|
|
2154
|
+
}
|
|
2155
|
+
case SyntaxKind.ImportType:
|
|
2156
|
+
return this.createNode(node, {
|
|
2157
|
+
type: ts_estree_1.AST_NODE_TYPES.TSImportType,
|
|
2158
|
+
isTypeOf: !!node.isTypeOf,
|
|
2159
|
+
parameter: this.convertChild(node.argument),
|
|
2160
|
+
qualifier: this.convertChild(node.qualifier),
|
|
2161
|
+
typeParameters: node.typeArguments
|
|
2162
|
+
? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node)
|
|
2163
|
+
: null,
|
|
2164
|
+
});
|
|
2165
|
+
case SyntaxKind.EnumDeclaration: {
|
|
2166
|
+
const result = this.createNode(node, {
|
|
2167
|
+
type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration,
|
|
2168
|
+
id: this.convertChild(node.name),
|
|
2169
|
+
members: node.members.map(el => this.convertChild(el)),
|
|
2170
|
+
});
|
|
2171
|
+
// apply modifiers first...
|
|
2172
|
+
this.applyModifiersToResult(result, (0, getModifiers_1.getModifiers)(node));
|
|
2173
|
+
// ...then check for exports
|
|
2174
|
+
return this.fixExports(node, result);
|
|
2175
|
+
}
|
|
2176
|
+
case SyntaxKind.EnumMember: {
|
|
2177
|
+
const result = this.createNode(node, {
|
|
2178
|
+
type: ts_estree_1.AST_NODE_TYPES.TSEnumMember,
|
|
2179
|
+
id: this.convertChild(node.name),
|
|
2180
|
+
});
|
|
2181
|
+
if (node.initializer) {
|
|
2182
|
+
result.initializer = this.convertChild(node.initializer);
|
|
2183
|
+
}
|
|
2184
|
+
if (node.name.kind === ts.SyntaxKind.ComputedPropertyName) {
|
|
2185
|
+
result.computed = true;
|
|
2186
|
+
}
|
|
2187
|
+
return result;
|
|
2188
|
+
}
|
|
2189
|
+
case SyntaxKind.ModuleDeclaration: {
|
|
2190
|
+
const result = this.createNode(node, {
|
|
2191
|
+
type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration,
|
|
2192
|
+
id: this.convertChild(node.name),
|
|
2193
|
+
});
|
|
2194
|
+
if (node.body) {
|
|
2195
|
+
result.body = this.convertChild(node.body);
|
|
2196
|
+
}
|
|
2197
|
+
// apply modifiers first...
|
|
2198
|
+
this.applyModifiersToResult(result, (0, getModifiers_1.getModifiers)(node));
|
|
2199
|
+
if (node.flags & ts.NodeFlags.GlobalAugmentation) {
|
|
2200
|
+
result.global = true;
|
|
2201
|
+
}
|
|
2202
|
+
// ...then check for exports
|
|
2203
|
+
return this.fixExports(node, result);
|
|
2204
|
+
}
|
|
2205
|
+
// TypeScript specific types
|
|
2206
|
+
case SyntaxKind.ParenthesizedType: {
|
|
2207
|
+
return this.convertType(node.type);
|
|
2208
|
+
}
|
|
2209
|
+
case SyntaxKind.UnionType: {
|
|
2210
|
+
return this.createNode(node, {
|
|
2211
|
+
type: ts_estree_1.AST_NODE_TYPES.TSUnionType,
|
|
2212
|
+
types: node.types.map(el => this.convertType(el)),
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2215
|
+
case SyntaxKind.IntersectionType: {
|
|
2216
|
+
return this.createNode(node, {
|
|
2217
|
+
type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType,
|
|
2218
|
+
types: node.types.map(el => this.convertType(el)),
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
case SyntaxKind.AsExpression: {
|
|
2222
|
+
return this.createNode(node, {
|
|
2223
|
+
type: ts_estree_1.AST_NODE_TYPES.TSAsExpression,
|
|
2224
|
+
expression: this.convertChild(node.expression),
|
|
2225
|
+
typeAnnotation: this.convertType(node.type),
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
case SyntaxKind.InferType: {
|
|
2229
|
+
return this.createNode(node, {
|
|
2230
|
+
type: ts_estree_1.AST_NODE_TYPES.TSInferType,
|
|
2231
|
+
typeParameter: this.convertType(node.typeParameter),
|
|
2232
|
+
});
|
|
2233
|
+
}
|
|
2234
|
+
case SyntaxKind.LiteralType: {
|
|
2235
|
+
if (version_check_1.typescriptVersionIsAtLeast['4.0'] &&
|
|
2236
|
+
node.literal.kind === SyntaxKind.NullKeyword) {
|
|
2237
|
+
// 4.0 started nesting null types inside a LiteralType node
|
|
2238
|
+
// but our AST is designed around the old way of null being a keyword
|
|
2239
|
+
return this.createNode(node.literal, {
|
|
2240
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword,
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
else {
|
|
2244
|
+
return this.createNode(node, {
|
|
2245
|
+
type: ts_estree_1.AST_NODE_TYPES.TSLiteralType,
|
|
2246
|
+
literal: this.convertType(node.literal),
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
case SyntaxKind.TypeAssertionExpression: {
|
|
2251
|
+
return this.createNode(node, {
|
|
2252
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion,
|
|
2253
|
+
typeAnnotation: this.convertType(node.type),
|
|
2254
|
+
expression: this.convertChild(node.expression),
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
case SyntaxKind.ImportEqualsDeclaration: {
|
|
2258
|
+
return this.createNode(node, {
|
|
2259
|
+
type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration,
|
|
2260
|
+
id: this.convertChild(node.name),
|
|
2261
|
+
moduleReference: this.convertChild(node.moduleReference),
|
|
2262
|
+
importKind: node.isTypeOnly ? 'type' : 'value',
|
|
2263
|
+
isExport: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node),
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
case SyntaxKind.ExternalModuleReference: {
|
|
2267
|
+
return this.createNode(node, {
|
|
2268
|
+
type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference,
|
|
2269
|
+
expression: this.convertChild(node.expression),
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2272
|
+
case SyntaxKind.NamespaceExportDeclaration: {
|
|
2273
|
+
return this.createNode(node, {
|
|
2274
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration,
|
|
2275
|
+
id: this.convertChild(node.name),
|
|
2276
|
+
});
|
|
2277
|
+
}
|
|
2278
|
+
case SyntaxKind.AbstractKeyword: {
|
|
2279
|
+
return this.createNode(node, {
|
|
2280
|
+
type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword,
|
|
2281
|
+
});
|
|
2282
|
+
}
|
|
2283
|
+
// Tuple
|
|
2284
|
+
case SyntaxKind.TupleType: {
|
|
2285
|
+
// In TS 4.0, the `elementTypes` property was changed to `elements`.
|
|
2286
|
+
// To support both at compile time, we cast to access the newer version
|
|
2287
|
+
// if the former does not exist.
|
|
2288
|
+
const elementTypes = 'elementTypes' in node
|
|
2289
|
+
? node.elementTypes.map((el) => this.convertType(el))
|
|
2290
|
+
: node.elements.map(el => this.convertType(el));
|
|
2291
|
+
return this.createNode(node, {
|
|
2292
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTupleType,
|
|
2293
|
+
elementTypes,
|
|
2294
|
+
});
|
|
2295
|
+
}
|
|
2296
|
+
case SyntaxKind.NamedTupleMember: {
|
|
2297
|
+
const member = this.createNode(node, {
|
|
2298
|
+
type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember,
|
|
2299
|
+
elementType: this.convertType(node.type, node),
|
|
2300
|
+
label: this.convertChild(node.name, node),
|
|
2301
|
+
optional: node.questionToken != null,
|
|
2302
|
+
});
|
|
2303
|
+
if (node.dotDotDotToken) {
|
|
2304
|
+
// adjust the start to account for the "..."
|
|
2305
|
+
member.range[0] = member.label.range[0];
|
|
2306
|
+
member.loc.start = member.label.loc.start;
|
|
2307
|
+
return this.createNode(node, {
|
|
2308
|
+
type: ts_estree_1.AST_NODE_TYPES.TSRestType,
|
|
2309
|
+
typeAnnotation: member,
|
|
2310
|
+
});
|
|
2311
|
+
}
|
|
2312
|
+
return member;
|
|
2313
|
+
}
|
|
2314
|
+
case SyntaxKind.OptionalType: {
|
|
2315
|
+
return this.createNode(node, {
|
|
2316
|
+
type: ts_estree_1.AST_NODE_TYPES.TSOptionalType,
|
|
2317
|
+
typeAnnotation: this.convertType(node.type),
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
case SyntaxKind.RestType: {
|
|
2321
|
+
return this.createNode(node, {
|
|
2322
|
+
type: ts_estree_1.AST_NODE_TYPES.TSRestType,
|
|
2323
|
+
typeAnnotation: this.convertType(node.type),
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
// Template Literal Types
|
|
2327
|
+
case SyntaxKind.TemplateLiteralType: {
|
|
2328
|
+
const result = this.createNode(node, {
|
|
2329
|
+
type: ts_estree_1.AST_NODE_TYPES.TSTemplateLiteralType,
|
|
2330
|
+
quasis: [this.convertChild(node.head)],
|
|
2331
|
+
types: [],
|
|
2332
|
+
});
|
|
2333
|
+
node.templateSpans.forEach(templateSpan => {
|
|
2334
|
+
result.types.push(this.convertChild(templateSpan.type));
|
|
2335
|
+
result.quasis.push(this.convertChild(templateSpan.literal));
|
|
2336
|
+
});
|
|
2337
|
+
return result;
|
|
2338
|
+
}
|
|
2339
|
+
case SyntaxKind.ClassStaticBlockDeclaration: {
|
|
2340
|
+
return this.createNode(node, {
|
|
2341
|
+
type: ts_estree_1.AST_NODE_TYPES.StaticBlock,
|
|
2342
|
+
body: this.convertBodyExpressions(node.body.statements, node),
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
case SyntaxKind.AssertEntry: {
|
|
2346
|
+
return this.createNode(node, {
|
|
2347
|
+
type: ts_estree_1.AST_NODE_TYPES.ImportAttribute,
|
|
2348
|
+
key: this.convertChild(node.name),
|
|
2349
|
+
value: this.convertChild(node.value),
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
default:
|
|
2353
|
+
return this.deeplyCopy(node);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
exports.Converter = Converter;
|
|
2358
|
+
//# sourceMappingURL=convert.js.map
|