How to use the eslint-visitor-keys.unionWith function in eslint-visitor-keys

To help you get started, we’ve selected a few eslint-visitor-keys 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 mysticatea / vue-eslint-parser / src / ast / traverse.ts View on Github external
/**
 * @author Toru Nagashima 
 * @copyright 2017 Toru Nagashima. All rights reserved.
 * See LICENSE file in root directory for full license.
 */
import Evk, { VisitorKeys } from "eslint-visitor-keys"
import { Node } from "./nodes"

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const KEYS = Evk.unionWith({
    VAttribute: ["key", "value"],
    VDirectiveKey: ["name", "argument", "modifiers"],
    VDocumentFragment: ["children"],
    VElement: ["startTag", "children", "endTag"],
    VEndTag: [],
    VExpressionContainer: ["expression"],
    VFilter: ["callee", "arguments"],
    VFilterSequenceExpression: ["expression", "filters"],
    VForExpression: ["left", "right"],
    VIdentifier: [],
    VLiteral: [],
    VOnExpression: ["body"],
    VSlotScopeExpression: ["params"],
    VStartTag: ["attributes"],
    VText: [],
})
github typescript-eslint / typescript-eslint / packages / typescript-estree / src / visitor-keys.ts View on Github external
import * as eslintVisitorKeys from 'eslint-visitor-keys';

export const visitorKeys = eslintVisitorKeys.unionWith({
  // Additional estree nodes.
  Import: [],
  // Additional Properties.
  ArrayPattern: ['decorators', 'elements', 'typeAnnotation'],
  ArrowFunctionExpression: ['typeParameters', 'params', 'returnType', 'body'],
  ClassDeclaration: [
    'decorators',
    'id',
    'typeParameters',
    'superClass',
    'superTypeParameters',
    'implements',
    'body',
  ],
  ClassExpression: [
    'decorators',
github eslint / typescript-eslint-parser / visitor-keys.js View on Github external
/**
 * @fileoverview The visitor keys for the new and updated node types
 * @author Michał Sajnóg 
 * MIT License
 */

"use strict";

const Evk = require("eslint-visitor-keys");

module.exports = Evk.unionWith({
    // Additional Properties.
    ArrayPattern: ["elements", "typeAnnotation"],
    ArrowFunctionExpression: ["typeParameters", "params", "returnType", "body"],
    ClassDeclaration: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "implements", "body"],
    ClassExpression: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "implements", "body"],
    FunctionDeclaration: ["id", "typeParameters", "params", "returnType", "body"],
    FunctionExpression: ["id", "typeParameters", "params", "returnType", "body"],
    Identifier: ["decorators", "typeAnnotation"],
    MethodDefinition: ["decorators", "key", "value"],
    ObjectPattern: ["properties", "typeAnnotation"],
    RestElement: ["argument", "typeAnnotation"],
    NewExpression: ["callee", "typeParameters", "arguments"],
    CallExpression: ["callee", "typeParameters", "arguments"],

    // Additional Nodes.
    BigIntLiteral: [],

eslint-visitor-keys

Constants and utilities about visitor keys to traverse AST.

BSD-2-Clause
Latest version published 20 days ago

Package Health Score

94 / 100
Full package analysis

Similar packages