'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';

var __defProp=Object['defineProperty'],__name=(_0x4b4033,_0x44b0ca)=>__defProp(_0x4b4033,'name',{'value':_0x44b0ca,'configurable':!![]});const ruleName='no-index-import-in-analysis';const ruleContent='\x0a###\x20**Must\x20not**\x20import\x20from\x20`./index`\x20in\x20analysis\x20files.\x0a\x0aImporting\x20from\x20`./index`\x20inside\x20`analysis`\x20is\x20forbidden.\x0a\x0a####\x20Wrong\x0a\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22./index\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/infra/analysis/index\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/analysis/index\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/analysis/subdir/index\x22;\x0a\x0a####\x20Correct\x0a\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22./node-types\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/infra/analysis/node-types\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/analysis/node-types\x22;\x0aimport\x20{\x20nodeTypes\x20}\x20from\x20\x22@flint/analysis/subdir/node-types\x22;\x0a\x0a####\x20Why\x0a\x0aThis\x20can\x20introduce\x20circular\x20dependencies\x20because\x20`index.ts`\x20often\x20re-exports\x20the\x20same\x20file\x20that\x20is\x20trying\x20from\x20it.';var noIndexImportInAnalysis = createEslintRule(ruleName,ruleContent,__name(function create(_0x135866){return {':matches(ImportDeclaration,\x20ExportAllDeclaration,\x20ExportNamedDeclaration)'(_0x23e938){const _0x372c23=_0x23e938['source'];_0x372c23&&isIndexImport(_0x372c23['value'])&&_0x135866['report']({'node':_0x372c23,'messageId':ruleName});}};},'create'));function isIndexImport(_0x545b76){return /(^|\/)index(\.[jt]sx?)?$/['test'](_0x545b76);}__name(isIndexImport,'isIndexImport');

export { noIndexImportInAnalysis as default, ruleName };
