'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { createNodeVisitor, nodeTypes } from '@flint/infra/analysis';
import { ruleTypes, url } from '@flint/infra/constants/rules-meta';
import { wellKnownProps } from '../../../base-repo/constants/internal-common-strings.js';

var __defProp=Object['defineProperty'],__name=(_0x236b37,_0x33b5f7)=>__defProp(_0x236b37,'name',{'value':_0x33b5f7,'configurable':!![]});const ruleName='no-use-id';const constants={'idLiteral':wellKnownProps['id'],'messageId':{'noUseId':'noUseId'},'meta':{'type':ruleTypes['problem'],'docs':{'description':'Disallow\x20using\x20\x27id\x27\x20as\x20a\x20parameter\x20name\x20in\x20functions'},'messages':{'noUseId':'no-use-id\x0a###\x20**Must\x20not**\x20use\x20id\x20as\x20parameter\x20name\x20in\x20functions.\x0a\x0a####\x20Wrong\x0a\x0aexport\x20async\x20function\x20foo(\x0a\x20\x20\x20\x20id?:\x20string,\x0a)\x20{…}\x0a\x0a####\x20Correct\x0a\x0aexport\x20async\x20function\x20foo(\x0a\x20\x20\x20\x20resourceMetaId?:\x20string,\x0a)\x20{…}\x0a\x0a####\x20Why\x0a\x0aUsing\x20id\x20as\x20a\x20parameter\x20name\x20is\x20too\x20generic\x20and\x20can\x20lead\x20to\x20confusion\x20when\x20working\x20with\x20multiple\x20entities.'},'schema':[]}},createRule=ESLintUtils['RuleCreator'](_0x537571=>''+url+_0x537571),noUseId=createRule({'name':ruleName,'meta':constants['meta'],'defaultOptions':[],'create'(_0x8aed83){return {...createNodeVisitor(_0x4ec083=>checkParams(_0x4ec083['params'],_0x8aed83))};}});function checkParams(_0x26b5a0,_0x53bf67){for(const _0x242e81 of _0x26b5a0){_0x242e81['type']===nodeTypes['identifier']&&_0x242e81['name']===constants['idLiteral']&&_0x53bf67['report']({'node':_0x242e81,'messageId':constants['messageId']['noUseId']}),_0x242e81['type']===nodeTypes['assignmentPattern']&&_0x242e81['left']['type']===nodeTypes['identifier']&&_0x242e81['left']['name']===constants['idLiteral']&&_0x53bf67['report']({'node':_0x242e81['left'],'messageId':constants['messageId']['noUseId']}),_0x242e81['type']===nodeTypes['restElement']&&_0x242e81['argument']['type']===nodeTypes['identifier']&&_0x242e81['argument']['name']===constants['idLiteral']&&_0x53bf67['report']({'node':_0x242e81['argument'],'messageId':constants['messageId']['noUseId']});}}__name(checkParams,'checkParams');

export { noUseId as default, ruleName };
