'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { nodeTypes, isIdentifier, isNameMatch, getRootTSType } from '@flint/infra/analysis';
import { jsBasicTypes } from '../../../base-repo/constants/basic-types.js';

var __defProp=Object['defineProperty'],__name=(_0x59e88d,_0x544eee)=>__defProp(_0x59e88d,'name',{'value':_0x544eee,'configurable':!![]});const ruleName='must-not-use-indexed-access-type-in-function-params';const ruleContent='\x0a###\x20**Must\x20not**\x20use\x20indexed\x20access\x20type\x20in\x20function\x20parameters\x0a\x0a####\x20Wrong\x0a\x0afunction\x20foo(bar:\x20baz[\x22qux\x22])\x20{\x0a\x20\x20\x20\x20...\x0a}\x0a\x0a####\x20Correct\x0a\x0aexport\x20function\x20foo(bar:\x20baz)\x20{\x0a\x20\x20\x20\x20return\x20waldo(bar.qux);\x0a}\x0a\x0a####\x20Why\x0a\x0aIndexed\x20access\x20types\x20in\x20function\x20parameters\x20make\x20signatures\x20harder\x20to\x20read\x20and\x20understand.\x0a';var mustNotUseIndexedAccessTypeInFunctionParams = createEslintRule(ruleName,ruleContent,__name(function create(_0x3200e3,_0x2d1cc4){const [_0x30a71e]=_0x2d1cc4;return {[':function\x20>\x20:matches(Identifier,\x20AssignmentPattern,\x20RestElement,\x20ObjectPattern,\x20ArrayPattern).params\x20TSTypeAnnotation\x20TSIndexedAccessType'](_0x526fa4){if(_0x526fa4['objectType']['type']===nodeTypes['TSTypeReference']&&isIdentifier(_0x526fa4['objectType']['typeName'])){const _0x41cc2a=_0x526fa4['objectType']['typeName'];_0x30a71e['includes']['some'](_0x3a217a=>isNameMatch(_0x41cc2a,_0x3a217a))&&_0x3200e3['report']({'node':getRootTSType(_0x526fa4),'messageId':ruleName});}}};},'create'),{'schema':[{'type':'object','properties':{'includes':{'type':jsBasicTypes['array'],'items':{'type':jsBasicTypes['string']}}}}],'defaultOptions':[{'includes':['PropertyMeta']}]});

export { mustNotUseIndexedAccessTypeInFunctionParams as default, ruleName };
