'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { nodeTypes, isStringLiteral } from '@flint/infra/analysis';
import { url, ruleTypes } from '@flint/infra/constants/rules-meta';

var __defProp=Object['defineProperty'],__name=(_0x17cc87,_0x1e6b2a)=>__defProp(_0x17cc87,'name',{'value':_0x1e6b2a,'configurable':!![]});const ruleName='no-duplicate-imports';const duplicateImportsMessageId='noDuplicateImports',createRule=ESLintUtils['RuleCreator'](_0x37ed00=>''+url+_0x37ed00),noDuplicateImports=createRule({'name':ruleName,'meta':{'type':ruleTypes['problem'],'docs':{'description':'Disallow\x20duplicate\x20imports\x20from\x20the\x20same\x20module'},'messages':{[duplicateImportsMessageId]:'no-duplicate-imports\x0aDuplicate\x20import\x20from\x20\x27{{source}}\x27\x0a\x0a###\x20**Must**\x20Don\x27t\x20duplicate\x20imports\x20from\x20the\x20same\x20module.\x0a\x0a####\x20Wrong\x0a\x0aimport\x20{\x20foo\x20}\x20from\x20\x27module-a\x27;\x0aimport\x20{\x20bar\x20}\x20from\x20\x27module-a\x27;\x0a\x0a####\x20Correct\x0a\x0aimport\x20{\x20foo,\x20bar\x20}\x20from\x20\x27module-a\x27;\x0a\x0a####\x20Why\x0a\x0aDuplicate\x20imports\x20clutter\x20code\x20and\x20reduce\x20readability.'},'schema':[]},'defaultOptions':[],'create'(_0x16b45a){const _0x113f0f=new Map();return {[nodeTypes['importDeclaration']](_0x321698){if(!isStringLiteral(_0x321698['source']))return;const _0x25ef3b=_0x321698['source']['value'];checkSource(_0x25ef3b,_0x321698,_0x113f0f,_0x16b45a);},[nodeTypes['exportNamedDeclaration']](_0x39a725){checkExportAllSource(_0x39a725,_0x113f0f,_0x16b45a);},[nodeTypes['exportAllDeclaration']](_0xda519b){checkExportAllSource(_0xda519b,_0x113f0f,_0x16b45a);}};}});function checkSource(_0x5d5cb8,_0x5b5e75,_0x584603,_0x4aa760){_0x584603['has'](_0x5d5cb8)?_0x4aa760['report']({'node':_0x5b5e75,'messageId':duplicateImportsMessageId,'data':{'source':_0x5d5cb8}}):_0x584603['set'](_0x5d5cb8,_0x5b5e75);}__name(checkSource,'checkSource');function checkExportAllSource(_0x1c69d8,_0x1efa88,_0x41b906){if(!_0x1c69d8['source']||_0x1c69d8['source']['type']!==nodeTypes['literal']||typeof _0x1c69d8['source']['value']!=='string')return;const _0x124665=_0x1c69d8['source']['value'];checkSource(_0x124665,_0x1c69d8,_0x1efa88,_0x41b906);}__name(checkExportAllSource,'checkExportAllSource');

export { noDuplicateImports as default, ruleName };
