'use strict';
import { files } from '../../../base-repo/app-constants/project-paths.js';
import { fileExtensions } from '../../../base-repo/app-constants/internal-system-constants.js';
import { jsBasicTypes } from '../../../base-repo/constants/basic-types.js';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { getFileName } from '@flint/infra/analysis';
import { flintConfigFileNames } from '@flint/infra/constants/rule-strings';
import { first } from '../../../fd-toolbox/server/collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0x545671,_0x4f6ac1)=>__defProp(_0x545671,'name',{'value':_0x4f6ac1,'configurable':!![]});const ruleName='must-use-typescript';const ruleContent='\x0a###\x20**Must**\x20use\x20TypeScript\x0a\x0a####\x20Wrong\x0a\x0a//\x20file.js\x0afunction\x20foo(value)\x20{\x20\x20\x20\x20\x0a\x20\x20\x20\x20const\x20bar\x20=\x20value.split(\x22,\x22);\x0a\x20\x20\x20\x20…\x0a}\x0a\x0a####\x20Correct\x0a\x0a//\x20file.ts\x0afunction\x20foo(value:\x20string)\x20{\x0a\x20\x20\x20\x20const\x20bar\x20=\x20value.split(\x22,\x22);\x0a\x20\x20\x20\x20…\x0a}\x0a\x0a####\x20Why\x0a\x0aEnsures\x20consistency\x20among\x20other\x20files,\x20allowing\x20to\x20strictly\x20typify\x20your\x20code,\x20prevent\x20bugs\x20and\x20speed\x20up\x20future\x20debugging\x20or\x20refactoring.',javaScriptExtensionList=[fileExtensions['js'],fileExtensions['jsx'],fileExtensions['mjs'],fileExtensions['cjs']],defaultIgnoredFiles=[files['eslintConfigJs'],flintConfigFileNames['eslintBase'],'eslint-next-web-vitals-temp.config.js',flintConfigFileNames['nonLevelTwo'],flintConfigFileNames['projectSpecific'],'next.config.js','next.config.mjs','vite.config.js','tailwind.config.js','postcss.config.js','jest.config.js','babel.config.js','prettier.config.js','project-paths.js','alias-symbols.js','app-packages-names.js','npm-package.js','messages.js','packages.js','dirname-plugin.js','saas-kit.js','eslint.ref-ai-enable-rule.config.js','command-names.js','app-words.js','resolve-lint-tsconfig-paths.js','flat-compat.js'];var mustUseTypescript = createEslintRule(ruleName,ruleContent,__name(function create(_0x1f6628,_0x5bb5da){const _0x47e113=first(_0x5bb5da)['ignoredFiles'],_0xa0ea2b=_0x1f6628['filename'];return isJavaScriptFile(_0xa0ea2b)&&!isIgnoredFile(_0xa0ea2b,_0x47e113)&&_0x1f6628['report']({'loc':{'line':0x1,'column':0x0},'messageId':ruleName}),{};},'create'),{'schema':[{'type':'object','properties':{'ignoredFiles':{'type':jsBasicTypes['array'],'items':{'type':'string'},'description':'Additional\x20filenames\x20to\x20ignore'}},'additionalProperties':![]}],'defaultOptions':[{'ignoredFiles':[]}]});function isJavaScriptFile(_0x246586){return javaScriptExtensionList['some'](_0x1f39fd=>_0x246586['endsWith'](_0x1f39fd));}__name(isJavaScriptFile,'isJavaScriptFile');function isIgnoredFile(_0x4d98ac,_0x4c3f1a){const _0x123200=[...defaultIgnoredFiles,..._0x4c3f1a],_0x180ce7=getFileName(_0x4d98ac);return _0x123200['includes'](_0x180ce7);}__name(isIgnoredFile,'isIgnoredFile');

export { mustUseTypescript as default, ruleName };
