'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { isEmptyString } from '@flint/infra/analysis';
import { jsBasicTypes } from '../../../base-repo/constants/basic-types.js';
import { eslintFixTypeNames } from '../../../base-repo/constants/internal-common-strings.js';

var __defProp=Object['defineProperty'],__name=(_0x19e1f5,_0x534aa1)=>__defProp(_0x19e1f5,'name',{'value':_0x534aa1,'configurable':!![]});const ruleName='must-not-return-empty-strings';const ruleContent='\x0a###\x20**Must\x20not**\x20return\x20empty\x20strings\x0a\x0a####\x20Wrong\x0a\x0afunction\x20getUserName(userId:\x20string)\x20{\x0a\x20\x20\x20...\x0a\x20\x20\x20\x20return\x20\x22\x22;\x0a}\x0a\x0a####\x20Correct\x0a\x0afunction\x20getUserName(userId:\x20string)\x20{\x0a\x20\x20\x20...\x0a\x20\x20\x20\x20return\x20undefined;\x0a}\x0a\x0a####\x20Why\x0a\x0aReturn\x20undefined\x20instead\x20of\x20empty\x20strings\x20to\x20indicate\x20the\x20absence\x20of\x20a\x20value.';var mustNotReturnEmptyStrings = createEslintRule(ruleName,ruleContent,__name(function create(_0x4e77fa){return {'ReturnStatement'(_0x4bdfa6){if(_0x4bdfa6['argument']&&isEmptyString(_0x4bdfa6['argument'])){const _0x19b7e2=_0x4bdfa6['argument'];_0x4e77fa['report']({'node':_0x19b7e2,'messageId':ruleName,'fix':__name(function(_0x2cca96){return _0x2cca96['replaceText'](_0x19b7e2,jsBasicTypes['undefined']);},'fix')});}}};},'create'),{'fixable':eslintFixTypeNames['code']});

export { mustNotReturnEmptyStrings as default, ruleName };
