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

const ruleName='exported-func-above-regular';const ruleContent='\x0a###\x20**Must**\x20place\x20exported\x20functions\x20above\x20regular\x20functions.\x0a\x0a####\x20Wrong\x0a\x0afunction\x20bar()\x20{\x0a\x20\x20//\x20...\x0a}\x0a\x0aexport\x20function\x20foo()\x20{\x0a\x20\x20//\x20...\x0a}\x0a\x0a####\x20Correct\x0a\x0aexport\x20function\x20foo()\x20{\x0a\x20\x20//\x20...\x0a}\x0a\x0afunction\x20bar()\x20{\x0a\x20\x20//\x20...\x0a}\x0a\x0a####\x20Why\x0a\x0aWhen\x20exported\x20functions\x20are\x20declared\x20below\x20regular\x20ones,\x20it\x20hides\x20the\x20public\x20interface\x20of\x20the\x20file,\x20making\x20it\x20harder\x20to\x20understand\x20what\x20is\x20exposed.\x20Declaring\x20exports\x20first\x20ensures\x20a\x20clear\x20and\x20consistent\x20file\x20structure.';var exportedFuncAboveRegular = createEslintRule(ruleName,ruleContent,_0x1a8c30=>{let _0x455243=![];return {'Program'(_0x37a0c8){for(const _0x37f6d3 of _0x37a0c8['body']){if(isExportedFunctionStatement(_0x37f6d3))_0x455243&&_0x1a8c30['report']({'node':_0x37f6d3,'messageId':ruleName});else isFunctionStatement(_0x37f6d3)&&(_0x455243=!![]);}}};});

export { exportedFuncAboveRegular as default, ruleName };
