'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { nodeTypes } from '@flint/infra/analysis';
import { fileSuffixes } from '../../../base-repo/constants/internal-extensions.js';
import { url, eslintProperties, ruleTypes } from '@flint/infra/constants/rules-meta';
import { folders } from '../../../base-repo/app-constants/project-paths.js';

var __defProp=Object['defineProperty'],__name=(_0x3df942,_0xea11e6)=>__defProp(_0x3df942,'name',{'value':_0xea11e6,'configurable':!![]});const ruleName='no-constructor-name-for-resource';const constants={'messageId':'noUseConstructorName','endFileName':fileSuffixes['resourceTs']},createRule=ESLintUtils['RuleCreator'](_0xa832ac=>''+url+_0xa832ac),noUseConstructorName=createRule({'name':ruleName,'meta':{'type':ruleTypes['problem'],'docs':{'description':'Disallow\x20usage\x20of\x20.constructor.name\x20in\x20favor\x20of\x20constant\x20resource\x20names.'},'messages':{[constants['messageId']]:'no-constructor-name-for-resource\x0a###\x20**Must\x20not**\x20use\x20.constructor.name\x20to\x20get\x20a\x20resource\x20name\x0a\x0a####\x20Wrong:\x0a\x0aconst\x20resourceName\x20=\x20foo.constructor.name;\x0a\x0a####\x20Correct:\x0a\x0aconst\x20resourceName\x20=\x20resourceNames.foo;\x0a\x0a####\x20Why:\x0a\x0aUsing\x20names\x20from\x20constants\x20is\x20better\x20because\x20it\x27s\x20easier\x20to\x20understand\x20what\x20we\x27re\x20using\x20them\x20for.\x20Constructor\x20names\x20might\x20change.'},'schema':[]},'defaultOptions':[],'create':__name(_0x4b756e=>{const _0x844572=(_0x4b756e['filename']??'')['replace'](/\\/g,'/');if(_0x844572['includes'](folders['meta']+'/'+folders['decorators'])||!_0x844572['endsWith'](constants['endFileName']))return {};return {'MemberExpression'(_0x99e225){if(_0x99e225['object']['type']===nodeTypes['memberExpression']){const _0x5391ef=_0x99e225['object'];(_0x5391ef['object']['type']===nodeTypes['identifier']||_0x5391ef['object']['type']===nodeTypes['memberExpression'])&&_0x5391ef['property']['type']===nodeTypes['identifier']&&_0x5391ef['property']['name']==='constructor'&&_0x99e225['property']['type']===nodeTypes['identifier']&&_0x99e225['property']['name']===eslintProperties['name']&&_0x4b756e['report']({'node':_0x99e225,'messageId':constants['messageId']});}}};},'create')});

export { noUseConstructorName as default, ruleName };
