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

const ruleName='must-use-camelcase-for-html-items-id-attribute';const constants={'messageIds':{'mustUseCamelcaseForHtmlItemsIdAttribute':'mustUseCamelcaseForHtmlItemsIdAttribute'},'meta':{'type':ruleTypes['problem'],'docs':{'description':'Must\x20use\x20camelCase\x20in\x20html\x20items\x20id\x20attributes','recommended':!![]},'messages':{'mustUseCamelcaseForHtmlItemsIdAttribute':'must-use-camelcase-for-html-items-id-attribute\x0a###\x20**Must**\x20use\x20camelCase\x20in\x20html\x20element\x20id\x20attribute.\x0a\x0a####\x20Wrong\x0a\x0a<div\x20id\x20=\x20\x22snake_case\x22>\x0a\x0a####\x20Correct\x0a\x0a<div\x20id\x20=\x20\x22camelCase\x22>\x0a\x0a####\x20Why\x0a\x0aIn\x20code\x20rules\x20we\x20name\x20consts\x20in\x20the\x20camelCase'},'schema':[]},'attrName':wellKnownProps['id']},createRule=ESLintUtils['RuleCreator'](_0x44ffb3=>''+url+_0x44ffb3),mustUseCamelcaseForHtmlItemsIdAttribute=createRule({'name':ruleName,'meta':constants['meta'],'defaultOptions':[],'create'(_0x19cc32){return {'JSXAttribute'(_0x1cd1f4){const _0x1306bc=_0x1cd1f4['value'];if(_0x1cd1f4['name']['name']!==constants['attrName']||!_0x1306bc)return;let _0x30a81b,_0x40b8eb=![];if(isStringLiteral(_0x1306bc))_0x30a81b=_0x1306bc['value'];else {if(_0x1306bc['type']===nodeTypes['JSXExpressionContainer']){const _0x3a18f0=_0x1306bc['expression'];if(isStringLiteral(_0x3a18f0))_0x30a81b=_0x3a18f0['value'];else {if(_0x3a18f0['type']===nodeTypes['templateLiteral']){const _0x21cfbb=_0x3a18f0['quasis']['map'](_0x2579db=>_0x2579db['value']['cooked']??'')['join']('${}');if(_0x3a18f0['expressions']['length']===0x159f+0x1*0x4c1+0x4*-0x698)_0x30a81b=_0x21cfbb;else (/[_-]/['test'](_0x21cfbb)||startsWithUpperCasePattern['test'](_0x21cfbb))&&(_0x40b8eb=!![]);}else _0x3a18f0['type']===nodeTypes['identifier']&&!isCamelCase(_0x3a18f0['name'])&&(_0x40b8eb=!![]);}}}(_0x40b8eb||_0x30a81b!==void(0xb2*-0x4+-0x23a9+0x2671)&&!isCamelCase(_0x30a81b))&&_0x19cc32['report']({'node':_0x1cd1f4,'messageId':constants['messageIds']['mustUseCamelcaseForHtmlItemsIdAttribute']});}};}});

export { mustUseCamelcaseForHtmlItemsIdAttribute as default, ruleName };
