'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { nodeTypes, getFileName } from '@flint/infra/analysis';
import { ruleTypes, url } from '@flint/infra/constants/rules-meta';

var __defProp=Object['defineProperty'],__name=(_0xaff1eb,_0x5da4ef)=>__defProp(_0xaff1eb,'name',{'value':_0x5da4ef,'configurable':!![]});const ruleName='must-create-assert-functions-in-asserts-files';const messageId='mustCreateAssertFunctionsInAssertsFiles',constants={'meta':{'type':ruleTypes['problem'],'docs':{'description':'Must\x20create\x20assert\x20functions\x20in\x20asserts\x20files.'},'messages':{[messageId]:ruleName+'\x0a###\x20**Must**\x20create\x20assert\x20functions\x20in\x20asserts\x20files.\x0a\x0a####\x20Wrong\x0a\x0a//\x20table-po.ts\x0aexport\x20function\x20assertTableGetFoo()\x20{...}\x0a\x0a####\x20Correct\x0a\x0a//\x20table-asserts.ts\x0aexport\x20function\x20assertTableGetFoo()\x20{...}\x0a\x0a####\x20Why\x0a\x0aThis\x20helps\x20separate\x20asserts\x20from\x20other\x20functions.'},'schema':[]}},createRule=ESLintUtils['RuleCreator'](_0x50f0d6=>''+url+_0x50f0d6),mustCreateAssertFunctionsInAssertsFiles=createRule({'name':ruleName,'meta':constants['meta'],'defaultOptions':[],'create'(_0x2639bb){return {'FunctionDeclaration'(_0xb6a984){checkFunctionName(_0x2639bb,_0xb6a984);},'FunctionExpression'(_0x204f29){!checkFunctionName(_0x2639bb,_0x204f29)&&_0x204f29['parent']['type']===nodeTypes['variableDeclarator']&&checkFunctionName(_0x2639bb,_0x204f29['parent']);},'TSDeclareFunction'(_0x15375f){checkFunctionName(_0x2639bb,_0x15375f);},'VariableDeclarator'(_0x2286c4){String(_0x2286c4['init']?.['type'])===nodeTypes['arrowFunctionExpression']&&checkFunctionName(_0x2639bb,_0x2286c4);}};}});function checkFunctionName(_0x2cb862,_0x32062b){let _0x4f541a=![];const _0x5a7c12=/(^a|-a)sserts?([.-]|$)/,_0x526e64=/(^a|A)ssert($|[A-Z])/;return _0x32062b['id']&&_0x32062b['id']['type']===nodeTypes['identifier']&&_0x526e64['test'](_0x32062b['id']['name'])&&!_0x5a7c12['test'](getFileName(_0x2cb862['filename']))&&(_0x2cb862['report']({'node':_0x32062b['id'],'messageId':messageId}),_0x4f541a=!![]),_0x4f541a;}__name(checkFunctionName,'checkFunctionName');

export { mustCreateAssertFunctionsInAssertsFiles as default, ruleName };
