How to use the @typescript-eslint/typescript-estree/dist/ts-estree/ast-node-types.AST_NODE_TYPES.ClassProperty function in @typescript-eslint/typescript-estree

To help you get started, we’ve selected a few @typescript-eslint/typescript-estree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Halliwood / ts2lua / src / gen / TsCollector.ts View on Github external
private processClassDeclaration(ast: ClassDeclaration) {
    let info: TsClassInfo = { type: AST_NODE_TYPES.ClassDeclaration, name: ast.id.name, properties: {}, funcs: {} };
    for(let cbb of ast.body.body) {
      if(cbb.type == AST_NODE_TYPES.ClassProperty) {
        let cp = cbb as ClassProperty;
        let cpInfo: TsPropInfo = { type: AST_NODE_TYPES.ClassProperty, name: (cp.key as Identifier).name, isStatic: cp.static, varType: cp.typeAnnotation };
        info.properties[cpInfo.name] = cpInfo;
      } else if(cbb.type == AST_NODE_TYPES.MethodDefinition) {
        let md = cbb as MethodDefinition;
        let mdInfo: TsFuncInfo = { type: AST_NODE_TYPES.MethodDefinition, name: (md.key as Identifier).name, isStatic: md.static, returnType: md.value.returnType };
        info.funcs[mdInfo.name] = mdInfo;
      }
    }
    this.classMap[ast.id.name] = info;
    if(this.moduleName) {
      this.classMap[this.moduleName + '.' + ast.id.name] = info;
      this.moduleMap[this.moduleName].classes[ast.id.name] = info;
    }
  }
github Halliwood / ts2lua / src / gen / TsCollector.ts View on Github external
private processClassDeclaration(ast: ClassDeclaration) {
    let info: TsClassInfo = { type: AST_NODE_TYPES.ClassDeclaration, name: ast.id.name, properties: {}, funcs: {} };
    for(let cbb of ast.body.body) {
      if(cbb.type == AST_NODE_TYPES.ClassProperty) {
        let cp = cbb as ClassProperty;
        let cpInfo: TsPropInfo = { type: AST_NODE_TYPES.ClassProperty, name: (cp.key as Identifier).name, isStatic: cp.static, varType: cp.typeAnnotation };
        info.properties[cpInfo.name] = cpInfo;
      } else if(cbb.type == AST_NODE_TYPES.MethodDefinition) {
        let md = cbb as MethodDefinition;
        let mdInfo: TsFuncInfo = { type: AST_NODE_TYPES.MethodDefinition, name: (md.key as Identifier).name, isStatic: md.static, returnType: md.value.returnType };
        info.funcs[mdInfo.name] = mdInfo;
      }
    }
    this.classMap[ast.id.name] = info;
    if(this.moduleName) {
      this.classMap[this.moduleName + '.' + ast.id.name] = info;
      this.moduleMap[this.moduleName].classes[ast.id.name] = info;
    }
  }

@typescript-eslint/typescript-estree

A parser that converts TypeScript source code into an ESTree compatible form

BSD-2-Clause
Latest version published 8 days ago

Package Health Score

95 / 100
Full package analysis