ast-info.cjs.map
3.21 KB
{"version":3,"names":["ESLINT_VISITOR_KEYS","require","KEYS","babel","visitorKeys","exports","getVisitorKeys","newTypes","ChainExpression","ImportExpression","Literal","MethodDefinition","concat","Property","PropertyDefinition","conflictTypes","ClassPrivateMethod","ExportAllDeclaration","types","VISITOR_KEYS","tokLabels","getTokLabels","p","reduce","o","k","v","Object","entries","tokTypes","map","key","tok","label"],"sources":["../../src/worker/ast-info.cjs"],"sourcesContent":["const ESLINT_VISITOR_KEYS = require(\"eslint-visitor-keys\").KEYS;\nconst babel = require(\"./babel-core.cjs\");\n\nlet visitorKeys;\nexports.getVisitorKeys = function getVisitorKeys() {\n if (!visitorKeys) {\n // AST Types that are not presented in Babel AST\n const newTypes = {\n ChainExpression: ESLINT_VISITOR_KEYS.ChainExpression,\n ImportExpression: ESLINT_VISITOR_KEYS.ImportExpression,\n Literal: ESLINT_VISITOR_KEYS.Literal,\n MethodDefinition: [\"decorators\"].concat(\n ESLINT_VISITOR_KEYS.MethodDefinition,\n ),\n Property: [\"decorators\"].concat(ESLINT_VISITOR_KEYS.Property),\n PropertyDefinition: [\"decorators\", \"typeAnnotation\"].concat(\n ESLINT_VISITOR_KEYS.PropertyDefinition,\n ),\n };\n\n // AST Types that shares `\"type\"` property with Babel but have different shape\n const conflictTypes = {\n // todo: remove this when we drop Babel 7 support\n ClassPrivateMethod: [\"decorators\"].concat(\n ESLINT_VISITOR_KEYS.MethodDefinition,\n ),\n ExportAllDeclaration: ESLINT_VISITOR_KEYS.ExportAllDeclaration,\n };\n\n visitorKeys = {\n ...newTypes,\n ...babel.types.VISITOR_KEYS,\n ...conflictTypes,\n };\n }\n return visitorKeys;\n};\n\nlet tokLabels;\nexports.getTokLabels = function getTokLabels() {\n return (tokLabels ||= (\n process.env.BABEL_8_BREAKING\n ? Object.fromEntries\n : p => p.reduce((o, [k, v]) => ({ ...o, [k]: v }), {})\n )(Object.entries(babel.tokTypes).map(([key, tok]) => [key, tok.label])));\n};\n"],"mappings":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