'use strict';
import { AST_TOKEN_TYPES, ESLintUtils } from '@typescript-eslint/utils';
import { ruleTypes, url } from '@flint/infra/constants/rules-meta';
import { eslintFixTypeNames } from '../../../base-repo/constants/internal-common-strings.js';

const ruleName='must-add-empty-line-before-assert-act-arrange';const ruleId='mustAddEmptyLineBeforeAssertActArrange';const constants={'meta':{'type':ruleTypes['problem'],'docs':{'description':ruleName},'messages':{[ruleId]:ruleName+'\x0a###\x20**Must**\x20add\x20empty\x20line\x20before\x20Assert,\x20Act,\x20Arrange.\x0a\x0a####\x20Wrong\x0a\x0aconst\x20foo\x20=\x20\x22Foo\x22;\x0a//\x20Act\x0aconst\x20result\x20=\x20actual.result;\x0a\x0a####\x20Correct\x0a\x0aconst\x20foo\x20=\x20\x22Foo\x22;\x0a\x0a//\x20Act\x0aconst\x20result\x20=\x20actual.result;\x0a\x0a####\x20Why\x0a\x0aThis\x20improves\x20readability\x20of\x20tests.'},'fixable':eslintFixTypeNames['whitespace'],'schema':[]},'tokens':{'punctuator':AST_TOKEN_TYPES['Punctuator']}},createRule=ESLintUtils['RuleCreator'](_0x56bc4f=>''+url+_0x56bc4f),mustAddEmptyLineBeforeAssertActArrange=createRule({'name':ruleName,'meta':constants['meta'],'defaultOptions':[],'create'(_0x908b41){const _0x39ce5a=_0x908b41['sourceCode'];return {'Program'(){const _0x384004=_0x39ce5a['getAllComments'](),_0x54b428=/^\s*(Arrange|Act|Assert)(,\s*(Arrange|Act|Assert))*\b/i;_0x384004['forEach'](_0x52271c=>{const _0xcd939b=_0x39ce5a['getTokenBefore'](_0x52271c,{'includeComments':!![]}),_0x4da44e=_0x54b428['test'](_0x52271c['value'])&&_0x52271c['loc']['start']['line']!==-0x95*-0x23+-0x1ad6*-0x1+-0x2f34&&_0xcd939b&&!(_0xcd939b['type']===constants['tokens']['punctuator']&&_0xcd939b['value']==='{')&&_0x52271c['loc']['start']['line']-_0xcd939b['loc']['end']['line']===-0xb0*-0x2+0x1*0x6b+-0x2*0xe5;_0x4da44e&&_0x908b41['report']({'loc':_0x52271c['loc'],'messageId':ruleId,'fix'(_0x5f0967){const _0x533287=_0x39ce5a['getIndexFromLoc']({'line':_0x52271c['loc']['start']['line'],'column':0x0});return _0x5f0967['insertTextBeforeRange']([_0x533287,_0x533287],'\x0a');}});});}};}});

export { mustAddEmptyLineBeforeAssertActArrange as default, ruleId, ruleName };
