How to use the @typescript-eslint/typescript-estree.AST_NODE_TYPES 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 / gen / LuaMaker.js View on Github external
function LuaMaker() {
        this.noBraceTypes = [typescript_estree_1.AST_NODE_TYPES.MemberExpression, typescript_estree_1.AST_NODE_TYPES.ThisExpression, typescript_estree_1.AST_NODE_TYPES.Identifier, typescript_estree_1.AST_NODE_TYPES.CallExpression, typescript_estree_1.AST_NODE_TYPES.TSAsExpression, typescript_estree_1.AST_NODE_TYPES.TSTypeAssertion, typescript_estree_1.AST_NODE_TYPES.Super];
        // TODO: Typeof's return value may be different between ts and lua
        this.tsType2luaType = {
            'undefined': 'nil',
            'object': 'table'
        };
        this.ignoreExpressionType = [typescript_estree_1.AST_NODE_TYPES.MemberExpression, typescript_estree_1.AST_NODE_TYPES.Identifier];
        this.luaKeyWords = ['and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', 'until', 'while'];
        this.pv = 0;
        this.operatorPriorityMap = {};
        this.isDevMode = false;
        this.funcReplConf = {};
        this.regexReplConf = {};
        this.usedIdMapByClass = {};
        this.importAsts = [];
        this.imports = [];
        this.importMapByClass = {};
github sikidamjanovic / cowrite / node_modules / @typescript-eslint / parser / dist / parser.js View on Github external
const analyze_scope_1 = require("./analyze-scope");
const simple_traverse_1 = require("./simple-traverse");
const visitor_keys_1 = require("./visitor-keys");
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
const packageJSON = require('../package.json');
function validateBoolean(value, fallback = false) {
    if (typeof value !== 'boolean') {
        return fallback;
    }
    return value;
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
exports.version = packageJSON.version;
exports.Syntax = Object.freeze(typescript_estree_1.AST_NODE_TYPES);
function parse(code, options) {
    return parseForESLint(code, options).ast;
}
exports.parse = parse;
function parseForESLint(code, options) {
    if (!options || typeof options !== 'object') {
        options = {};
    }
    // https://eslint.org/docs/user-guide/configuring#specifying-parser-options
    // if sourceType is not provided by default eslint expect that it will be set to "script"
    if (options.sourceType !== 'module' && options.sourceType !== 'script') {
        options.sourceType = 'script';
    }
    if (typeof options.ecmaFeatures !== 'object') {
        options.ecmaFeatures = {};
    }
github Halliwood / ts2lua / gen / LuaMaker.js View on Github external
case typescript_estree_1.AST_NODE_TYPES.ForOfStatement:
                str += this.codeFromForOfStatement(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.ForStatement:
                str += this.codeFromForStatement(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration:
                str += this.codeFromFunctionDeclaration(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.FunctionExpression:
                str += this.codeFromFunctionExpression(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.Identifier:
                str += this.codeFromIdentifier(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.IfStatement:
                str += this.codeFromIfStatement(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.Import:
                str += this.codeFromImport(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.ImportDeclaration:
                str += this.codeFromImportDeclaration(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier:
                str += this.codeFromImportDefaultSpecifier(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier:
                str += this.codeFromImportNamespaceSpecifier(ast);
                break;
            case typescript_estree_1.AST_NODE_TYPES.ImportSpecifier:
                str += this.codeFromImportSpecifier(ast);

@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