'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { nodeTypes, isEnumTypeDefinition, enumTypeDefinitionStatuses } from '@flint/infra/analysis';

var __defProp=Object['defineProperty'],__name=(_0x204a06,_0x2fc39d)=>__defProp(_0x204a06,'name',{'value':_0x2fc39d,'configurable':!![]});const ruleName='enum-type-immediate-definition';const ruleContent='\x0a###\x20**Must**\x20define\x20enum\x20type\x20immediately\x20after\x20its\x20constant\x20declaration.\x0a\x0a####\x20Wrong\x0a\x0aexport\x20const\x20foo\x20=\x20{\x20bar:\x20\x22Bar\x22\x20};\x0aconst\x20someConfig\x20=\x20true;\x0aexport\x20type\x20Foo\x20=\x20(typeof\x20foo)[keyof\x20typeof\x20foo];\x0a\x0a####\x20Correct\x0a\x0aexport\x20const\x20foo\x20=\x20{\x20bar:\x20\x22Bar\x22\x20};\x0aexport\x20type\x20Foo\x20=\x20(typeof\x20foo)[keyof\x20typeof\x20foo];\x0a\x0a####\x20Why\x0a\x0aSeparating\x20the\x20constant\x20object\x20from\x20its\x20type\x20definition\x20makes\x20code\x20harder\x20to\x20read\x20and\x20maintain.';var enumTypeImmediateDefinition = createEslintRule(ruleName,ruleContent,__name(function create(_0x51e827){return {[nodeTypes['TSTypeAliasDeclaration']](_0x203e7c){isEnumTypeDefinition(_0x203e7c)===enumTypeDefinitionStatuses['invalid']&&_0x51e827['report']({'node':_0x203e7c,'messageId':ruleName,'data':{'name':_0x203e7c['id']['name']}});}};},'create'),{'dynamicMessage':'Object\x20\x27{{name}}\x27\x20is\x20not\x20defined\x20immediately\x20after\x20its\x20constant\x20declaration.'});

export { enumTypeImmediateDefinition as default, ruleName };
