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

var __defProp=Object['defineProperty'],__name=(_0x4c2ad3,_0x11b79e)=>__defProp(_0x4c2ad3,'name',{'value':_0x11b79e,'configurable':!![]});const ruleName='must-not-use-nullish-coalescing-empty-string';const ruleContent='\x0a###\x20**Must\x20not**\x20use\x20nullish\x20coalescing\x20with\x20an\x20empty\x20string\x20default.\x0a\x0a####\x20Wrong\x0a\x0aconst\x20actualFilename\x20=\x20filenameParts.pop()\x20??\x20\x22\x22;\x0a\x0a####\x20Correct\x0a\x0aconst\x20actualFilename\x20=\x20filenameParts.pop();\x0a\x0aif\x20(!actualFilename)\x20throw\x20createError(\x22Filename\x20is\x20missing\x22);\x0a\x0a####\x20Why\x0a\x0aEmpty\x20strings\x20hide\x20missing\x20values\x20and\x20make\x20absence\x20handling\x20harder\x20to\x20reason\x20about.';var mustNotUseNullishCoalescingEmptyString = createEslintRule(ruleName,ruleContent,__name(function create(_0x15f430){return {'LogicalExpression'(_0x5c9547){if(_0x5c9547['operator']!=='??')return;isEmptyString(_0x5c9547['right'])&&_0x15f430['report']({'node':_0x5c9547['right'],'messageId':ruleName});}};},'create'));

export { mustNotUseNullishCoalescingEmptyString as default, ruleName };
