'use strict';
import { isNameMatch, isMemberExpression, isIdentifier } from '@flint/infra/analysis';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { commandNames } from '../../../base-repo/constants/internal-common-strings.js';

var __defProp=Object['defineProperty'],__name=(_0xea8cfa,_0x3f04ba)=>__defProp(_0xea8cfa,'name',{'value':_0x3f04ba,'configurable':!![]});const ruleName='must-separate-unrelated-tests-into-different-files';const ruleContent='\x0a###\x20**Must**\x20separate\x20unrelated\x20tests\x20into\x20different\x20files\x0a\x0a####\x20Wrong\x0a\x0a//\x20custom-eslint-rules.spec.js\x0aruleTester.run(\x22foo\x22,\x20fooRule,\x20{\x0a\x20\x20\x20\x20…\x0a});\x0a\x0aruleTester.run(\x22bar\x22,\x20barRule,\x20{\x0a\x20\x20\x20\x20…\x0a});\x0a\x0a####\x20Correct\x0a\x0a//\x20foo.spec.js\x0aruleTester.run(\x22foo\x22,\x20fooRule,\x20{\x0a\x20\x20\x20\x20…\x0a});\x0a\x0a//\x20bar.spec.js\x0aruleTester.run(\x22bar\x22,\x20barRule,\x20{\x0a\x20\x20\x20\x20…\x0a});\x0a\x0a####\x20Why\x0a\x0aSeparating\x20unrelated\x20tests\x20improves\x20organization,\x20makes\x20failures\x20easier\x20to\x20isolate.';var mustSeparateUnrelatedTestsIntoDifferentFiles = createEslintRule(ruleName,ruleContent,__name(function create(_0x514849){let _0x1bfa6b=-0x19+0x3b4+0x39b*-0x1;return {'CallExpression'(_0x41e947){const _0x4006ca=_0x41e947['callee'];(isDirectRunTests(_0x4006ca)||isTesterRun(_0x4006ca))&&(_0x1bfa6b++,_0x1bfa6b>-0xad*-0x26+-0xb*0x2bf+0x488&&_0x514849['report']({'node':_0x41e947,'messageId':ruleName}));}};},'create'));function isDirectRunTests(_0x26a649){return isNameMatch(_0x26a649,'runTests')||isNameMatch(_0x26a649,'runEslintTests');}__name(isDirectRunTests,'isDirectRunTests');function isTesterRun(_0x5a5057){return isMemberExpression(_0x5a5057)&&isIdentifier(_0x5a5057['object'])&&_0x5a5057['object']['name']['toLowerCase']()['includes']('tester')&&isNameMatch(_0x5a5057['property'],commandNames['run']);}__name(isTesterRun,'isTesterRun');

export { mustSeparateUnrelatedTestsIntoDifferentFiles as default, ruleName };
