'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { nodeTypes } from '@flint/infra/analysis';

var __defProp=Object['defineProperty'],__name=(_0x1ef807,_0x338164)=>__defProp(_0x1ef807,'name',{'value':_0x338164,'configurable':!![]});const ruleName='must-not-import-ast-node-types';const identifierName='AST_NODE_TYPES',ruleContent='\x0a###\x20**Must\x20not**\x20import\x20or\x20use\x20AST_NODE_TYPES\x20directly.\x0a\x0a####\x20Wrong\x0a\x0aimport\x20{\x20AST_NODE_TYPES\x20}\x20from\x20\x22@typescript-eslint/utils\x22;\x0a\x0aif\x20(node.type\x20===\x20AST_NODE_TYPES.CallExpression)\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0a####\x20Correct\x0a\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22../infra/analysis\x22;\x0a\x0aif\x20(node.type\x20===\x20nodeTypes.CallExpression)\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0a####\x20Why\x0a\x0aAll\x20node\x20type\x20constants\x20are\x20already\x20defined\x20in\x20analysis\x20to\x20keep\x20consistency\x20across\x20rules.';var mustNotImportAstNodeTypes = createEslintRule(ruleName,ruleContent,__name(function create(_0x42b296){return {'ImportDeclaration'(_0xff6619){isImportTypesEslintElement(_0xff6619['source']['value']['toString']())&&(isImportingAstNodeTypes(_0xff6619['specifiers'])&&_0x42b296['report']({'node':_0xff6619,'messageId':ruleName}));},'MemberExpression'(_0x5b0c08){isMemberExpressionUsingAstNodeTypes(_0x5b0c08)&&_0x42b296['report']({'node':_0x5b0c08,'messageId':ruleName});}};},'create'));function isImportTypesEslintElement(_0x3bf6c9){return /^(@typescript-eslint\/)/['test'](_0x3bf6c9);}__name(isImportTypesEslintElement,'isImportTypesEslintElement');function isImportingAstNodeTypes(_0x4cac05){return _0x4cac05['some'](_0x2bbe33=>_0x2bbe33['type']===nodeTypes['importSpecifier']&&_0x2bbe33['imported']['type']===nodeTypes['identifier']&&_0x2bbe33['imported']['name']===identifierName);}__name(isImportingAstNodeTypes,'isImportingAstNodeTypes');function isMemberExpressionUsingAstNodeTypes(_0x1d2e75){return _0x1d2e75['object']['type']===nodeTypes['identifier']&&_0x1d2e75['object']['name']===identifierName||_0x1d2e75['object']['type']===nodeTypes['memberExpression']&&_0x1d2e75['object']['type']===nodeTypes['memberExpression']&&_0x1d2e75['object']['property']['type']===nodeTypes['identifier']&&_0x1d2e75['object']['property']['name']===identifierName;}__name(isMemberExpressionUsingAstNodeTypes,'isMemberExpressionUsingAstNodeTypes');

export { mustNotImportAstNodeTypes as default, ruleName };
