first commit
This commit is contained in:
81
app_vue/node_modules/eslint-visitor-keys/lib/index.js
generated
vendored
Normal file
81
app_vue/node_modules/eslint-visitor-keys/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
/**
|
||||
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const KEYS = require("./visitor-keys.json");
|
||||
|
||||
// Types.
|
||||
const NODE_TYPES = Object.freeze(Object.keys(KEYS));
|
||||
|
||||
// Freeze the keys.
|
||||
for (const type of NODE_TYPES) {
|
||||
Object.freeze(KEYS[type]);
|
||||
}
|
||||
Object.freeze(KEYS);
|
||||
|
||||
// List to ignore keys.
|
||||
const KEY_BLACKLIST = new Set([
|
||||
"parent",
|
||||
"leadingComments",
|
||||
"trailingComments"
|
||||
]);
|
||||
|
||||
/**
|
||||
* Check whether a given key should be used or not.
|
||||
* @param {string} key The key to check.
|
||||
* @returns {boolean} `true` if the key should be used.
|
||||
*/
|
||||
function filterKey(key) {
|
||||
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public interfaces
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = Object.freeze({
|
||||
|
||||
/**
|
||||
* Visitor keys.
|
||||
* @type {{ [type: string]: string[] | undefined }}
|
||||
*/
|
||||
KEYS,
|
||||
|
||||
/**
|
||||
* Get visitor keys of a given node.
|
||||
* @param {Object} node The AST node to get keys.
|
||||
* @returns {string[]} Visitor keys of the node.
|
||||
*/
|
||||
getKeys(node) {
|
||||
return Object.keys(node).filter(filterKey);
|
||||
},
|
||||
|
||||
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
|
||||
// eslint-disable-next-line valid-jsdoc
|
||||
/**
|
||||
* Make the union set with `KEYS` and given keys.
|
||||
* @param {Object} additionalKeys The additional keys.
|
||||
* @returns {{ [type: string]: string[] | undefined }} The union set.
|
||||
*/
|
||||
unionWith(additionalKeys) {
|
||||
const retv = Object.assign({}, KEYS);
|
||||
|
||||
for (const type of Object.keys(additionalKeys)) {
|
||||
if (retv.hasOwnProperty(type)) {
|
||||
const keys = new Set(additionalKeys[type]);
|
||||
|
||||
for (const key of retv[type]) {
|
||||
keys.add(key);
|
||||
}
|
||||
|
||||
retv[type] = Object.freeze(Array.from(keys));
|
||||
} else {
|
||||
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
|
||||
}
|
||||
}
|
||||
|
||||
return Object.freeze(retv);
|
||||
}
|
||||
});
|
289
app_vue/node_modules/eslint-visitor-keys/lib/visitor-keys.json
generated
vendored
Normal file
289
app_vue/node_modules/eslint-visitor-keys/lib/visitor-keys.json
generated
vendored
Normal file
@ -0,0 +1,289 @@
|
||||
{
|
||||
"AssignmentExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"AssignmentPattern": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"ArrayExpression": [
|
||||
"elements"
|
||||
],
|
||||
"ArrayPattern": [
|
||||
"elements"
|
||||
],
|
||||
"ArrowFunctionExpression": [
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"AwaitExpression": [
|
||||
"argument"
|
||||
],
|
||||
"BlockStatement": [
|
||||
"body"
|
||||
],
|
||||
"BinaryExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"BreakStatement": [
|
||||
"label"
|
||||
],
|
||||
"CallExpression": [
|
||||
"callee",
|
||||
"arguments"
|
||||
],
|
||||
"CatchClause": [
|
||||
"param",
|
||||
"body"
|
||||
],
|
||||
"ChainExpression": [
|
||||
"expression"
|
||||
],
|
||||
"ClassBody": [
|
||||
"body"
|
||||
],
|
||||
"ClassDeclaration": [
|
||||
"id",
|
||||
"superClass",
|
||||
"body"
|
||||
],
|
||||
"ClassExpression": [
|
||||
"id",
|
||||
"superClass",
|
||||
"body"
|
||||
],
|
||||
"ConditionalExpression": [
|
||||
"test",
|
||||
"consequent",
|
||||
"alternate"
|
||||
],
|
||||
"ContinueStatement": [
|
||||
"label"
|
||||
],
|
||||
"DebuggerStatement": [],
|
||||
"DoWhileStatement": [
|
||||
"body",
|
||||
"test"
|
||||
],
|
||||
"EmptyStatement": [],
|
||||
"ExportAllDeclaration": [
|
||||
"exported",
|
||||
"source"
|
||||
],
|
||||
"ExportDefaultDeclaration": [
|
||||
"declaration"
|
||||
],
|
||||
"ExportNamedDeclaration": [
|
||||
"declaration",
|
||||
"specifiers",
|
||||
"source"
|
||||
],
|
||||
"ExportSpecifier": [
|
||||
"exported",
|
||||
"local"
|
||||
],
|
||||
"ExpressionStatement": [
|
||||
"expression"
|
||||
],
|
||||
"ExperimentalRestProperty": [
|
||||
"argument"
|
||||
],
|
||||
"ExperimentalSpreadProperty": [
|
||||
"argument"
|
||||
],
|
||||
"ForStatement": [
|
||||
"init",
|
||||
"test",
|
||||
"update",
|
||||
"body"
|
||||
],
|
||||
"ForInStatement": [
|
||||
"left",
|
||||
"right",
|
||||
"body"
|
||||
],
|
||||
"ForOfStatement": [
|
||||
"left",
|
||||
"right",
|
||||
"body"
|
||||
],
|
||||
"FunctionDeclaration": [
|
||||
"id",
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"FunctionExpression": [
|
||||
"id",
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"Identifier": [],
|
||||
"IfStatement": [
|
||||
"test",
|
||||
"consequent",
|
||||
"alternate"
|
||||
],
|
||||
"ImportDeclaration": [
|
||||
"specifiers",
|
||||
"source"
|
||||
],
|
||||
"ImportDefaultSpecifier": [
|
||||
"local"
|
||||
],
|
||||
"ImportExpression": [
|
||||
"source"
|
||||
],
|
||||
"ImportNamespaceSpecifier": [
|
||||
"local"
|
||||
],
|
||||
"ImportSpecifier": [
|
||||
"imported",
|
||||
"local"
|
||||
],
|
||||
"JSXAttribute": [
|
||||
"name",
|
||||
"value"
|
||||
],
|
||||
"JSXClosingElement": [
|
||||
"name"
|
||||
],
|
||||
"JSXElement": [
|
||||
"openingElement",
|
||||
"children",
|
||||
"closingElement"
|
||||
],
|
||||
"JSXEmptyExpression": [],
|
||||
"JSXExpressionContainer": [
|
||||
"expression"
|
||||
],
|
||||
"JSXIdentifier": [],
|
||||
"JSXMemberExpression": [
|
||||
"object",
|
||||
"property"
|
||||
],
|
||||
"JSXNamespacedName": [
|
||||
"namespace",
|
||||
"name"
|
||||
],
|
||||
"JSXOpeningElement": [
|
||||
"name",
|
||||
"attributes"
|
||||
],
|
||||
"JSXSpreadAttribute": [
|
||||
"argument"
|
||||
],
|
||||
"JSXText": [],
|
||||
"JSXFragment": [
|
||||
"openingFragment",
|
||||
"children",
|
||||
"closingFragment"
|
||||
],
|
||||
"Literal": [],
|
||||
"LabeledStatement": [
|
||||
"label",
|
||||
"body"
|
||||
],
|
||||
"LogicalExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"MemberExpression": [
|
||||
"object",
|
||||
"property"
|
||||
],
|
||||
"MetaProperty": [
|
||||
"meta",
|
||||
"property"
|
||||
],
|
||||
"MethodDefinition": [
|
||||
"key",
|
||||
"value"
|
||||
],
|
||||
"NewExpression": [
|
||||
"callee",
|
||||
"arguments"
|
||||
],
|
||||
"ObjectExpression": [
|
||||
"properties"
|
||||
],
|
||||
"ObjectPattern": [
|
||||
"properties"
|
||||
],
|
||||
"PrivateIdentifier": [],
|
||||
"Program": [
|
||||
"body"
|
||||
],
|
||||
"Property": [
|
||||
"key",
|
||||
"value"
|
||||
],
|
||||
"PropertyDefinition": [
|
||||
"key",
|
||||
"value"
|
||||
],
|
||||
"RestElement": [
|
||||
"argument"
|
||||
],
|
||||
"ReturnStatement": [
|
||||
"argument"
|
||||
],
|
||||
"SequenceExpression": [
|
||||
"expressions"
|
||||
],
|
||||
"SpreadElement": [
|
||||
"argument"
|
||||
],
|
||||
"Super": [],
|
||||
"SwitchStatement": [
|
||||
"discriminant",
|
||||
"cases"
|
||||
],
|
||||
"SwitchCase": [
|
||||
"test",
|
||||
"consequent"
|
||||
],
|
||||
"TaggedTemplateExpression": [
|
||||
"tag",
|
||||
"quasi"
|
||||
],
|
||||
"TemplateElement": [],
|
||||
"TemplateLiteral": [
|
||||
"quasis",
|
||||
"expressions"
|
||||
],
|
||||
"ThisExpression": [],
|
||||
"ThrowStatement": [
|
||||
"argument"
|
||||
],
|
||||
"TryStatement": [
|
||||
"block",
|
||||
"handler",
|
||||
"finalizer"
|
||||
],
|
||||
"UnaryExpression": [
|
||||
"argument"
|
||||
],
|
||||
"UpdateExpression": [
|
||||
"argument"
|
||||
],
|
||||
"VariableDeclaration": [
|
||||
"declarations"
|
||||
],
|
||||
"VariableDeclarator": [
|
||||
"id",
|
||||
"init"
|
||||
],
|
||||
"WhileStatement": [
|
||||
"test",
|
||||
"body"
|
||||
],
|
||||
"WithStatement": [
|
||||
"object",
|
||||
"body"
|
||||
],
|
||||
"YieldExpression": [
|
||||
"argument"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user