'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import _0x3881d1__default from 'fs';
import { fileExtensions } from '../../../base-repo/app-constants/internal-system-constants.js';
import { flintRuleIdentifiers } from '@flint/infra/constants/shared-string-identifiers';

var __defProp=Object['defineProperty'],__name=(_0x3097a9,_0x5da69a)=>__defProp(_0x3097a9,'name',{'value':_0x5da69a,'configurable':!![]});const ruleName='must-not-create-funcs-files-for-non-components';const ruleContent='\x0a###\x20**Must\x20not**\x20create\x20funcs-files\x20for\x20non-components\x0a\x0a####\x20Wrong\x0a\x0a//\x20foo.ts\x0aexport\x20const\x20foo\x20=\x20{\x0a\x20\x20\x20\x20bar:\x20{\x20...\x20},\x0a\x20\x20\x20\x20baz:\x20(context)\x20=>\x20{\x20...\x20}\x0a};\x0a\x0a//\x20foo.funcs.ts\x0aexport\x20function\x20qux(value)\x20{\x0a\x20\x20\x20\x20…\x0a}\x0a\x0a####\x20Correct\x0a\x0a//\x20foo.ts\x0aexport\x20const\x20foo\x20=\x20{\x0a\x20\x20\x20\x20bar:\x20{\x20...\x20},\x0a\x20\x20\x20\x20baz:\x20(context)\x20=>\x20{\x20...\x20}\x0a};\x0a\x0aexport\x20function\x20qux(value)\x20{\x0a\x20\x20\x20\x20…\x0a}\x0a\x0a####\x20Why\x0a\x0aThe\x20.funcs.ts\x20pattern\x20is\x20only\x20allowed\x20for\x20React\x20components.\x20For\x20all\x20other\x20code\x20types,\x20keep\x20all\x20related\x20functions\x20in\x20a\x20single\x20file.';var mustNotCreateFuncsFilesForNonComponents = createEslintRule(ruleName,ruleContent,__name(function create(_0x1745f7){return {'Program'(){const _0x1bfc39=_0x1745f7['filename'];if(_0x1bfc39['endsWith'](constants['ends'])){const _0x374bab=_0x1bfc39['replace'](constants['ends'],fileExtensions['tsx']),_0x3fe0b7=_0x374bab['replace'](/\\/g,'/');!_0x3881d1__default['existsSync'](_0x3fe0b7)&&_0x1745f7['report']({'messageId':ruleName,'loc':{'line':0x1,'column':0x0}});}}};},'create'));const constants={'ends':flintRuleIdentifiers['funcsTs']};

export { mustNotCreateFuncsFilesForNonComponents as default, ruleName };
