'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { getFileName } from '@flint/infra/analysis';
import { url, ruleTypes } from '@flint/infra/constants/rules-meta';
import { files } from '../../../base-repo/app-constants/project-paths.js';
import { flintRuleIdentifiers } from '@flint/infra/constants/shared-string-identifiers';
import { firstOrUndefined } from '../../../fd-toolbox/server/collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0x34b112,_0x31d623)=>__defProp(_0x34b112,'name',{'value':_0x31d623,'configurable':!![]});const ruleName='filename-kebab-case';const messageId='useKebabCase',createRule=ESLintUtils['RuleCreator'](_0x3d3d93=>''+url+_0x3d3d93),virtualFilename=flintRuleIdentifiers['inputFile'],ignoredFilenames=['README',files['readMeMd'],files['license'],'Makefile',files['dotEnv'],files['gitIgnore'],'.eslintrc.js','.prettierrc',files['prettierIgnore']],filenameKebabCase=createRule({'name':ruleName,'meta':{'type':ruleTypes['problem'],'docs':{'description':'Enforce\x20kebab\x20case\x20for\x20file\x20names'},'messages':{[messageId]:ruleName+'\x0a###\x20**Must**\x20use\x20kebab-case\x20for\x20file\x20names.\x0a\x0aAvoid\x20camelCase\x20or\x20PascalCase\x20in\x20filenames.\x0a\x0a####\x20Wrong\x0a\x0aMyComponent.ts\x0a\x0a####\x20Correct\x0a\x0amy-component.ts\x0a\x0a####\x20Why\x0a\x0aFilenames\x20should\x20use\x20kebab-case\x20(lowercase\x20and\x20dashes)\x20to\x20maintain\x20consistency\x20through\x20codebase.'},'schema':[]},'create'(_0x426e20){const _0x1dc0be=getFileName(_0x426e20['filename']);return _0x1dc0be!==virtualFilename&&!isKebabCase(_0x1dc0be)&&_0x426e20['report']({'loc':{'line':0x1,'column':0x0},'messageId':messageId,'data':{'fileName':_0x1dc0be}}),{};},'defaultOptions':[]});function isKebabCase(_0x333b51){let _0x3d945c;if(ignoredFilenames['includes'](_0x333b51))_0x3d945c=!![];else {const _0xc71c80=getFileName(_0x333b51),_0x125019=firstOrUndefined(_0xc71c80['split']('.'));!_0x125019?_0x3d945c=![]:_0x3d945c=/^[a-z0-9]+([-.][a-z0-9]+)*(\.[a-z]+)?$/['test'](_0x125019);}return _0x3d945c;}__name(isKebabCase,'isKebabCase');

export { filenameKebabCase as default, ruleName };
