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

var __defProp=Object['defineProperty'],__name=(_0x1b1f9f,_0x423008)=>__defProp(_0x1b1f9f,'name',{'value':_0x423008,'configurable':!![]});const ruleName='must-create-resources-in-src-dir';const constants={'messageId':'noServerResourceImports'},createRule=ESLintUtils['RuleCreator'](_0x340b74=>''+url+_0x340b74),mustCreateResourcesInSrcDir=createRule({'name':ruleName,'meta':{'type':ruleTypes['problem'],'docs':{'description':'Disallow\x20importing\x20*.resource\x20files\x20from\x20@server.\x20Use\x20@/resources\x20instead.'},'messages':{[constants['messageId']]:'must-create-resources-in-src-dir\x0a###\x20**Must**\x20create\x20resources\x20in\x20src\x20dir.\x0a\x0aMust\x20import\x20resources\x20from\x20\x27@/resources/...\x27\x20instead\x20of\x20\x27@server/...\x27.\x0a\x0a####\x20Wrong:\x0a\x0aimport\x20{\x20Foo\x20}\x20from\x20\x27@server/bar/baz/foo.resource\x27;\x0a\x0a####\x20Correct:\x0a\x0aimport\x20{\x20Foo\x20}\x20from\x20\x27@/resources/foo/foo.resource\x27;\x0a\x0a####\x20Why:\x0a\x0aFrontend\x20cannot\x20use\x20files\x20from\x20server\x20directory,\x20so\x20all\x20resources\x20should\x20be\x20created\x20in\x20frontend\x20directories.'},'schema':[]},'defaultOptions':[],'create'(_0x5a7874){return {'ImportDeclaration'(_0x32aedc){const _0x4da989=_0x32aedc['source']['value'];isServerResource(_0x4da989)&&_0x5a7874['report']({'node':_0x32aedc['source'],'messageId':constants['messageId']});}};}});function isServerResource(_0x330ee4){return /^@server\/.*\.resource(\.|$)/['test'](_0x330ee4);}__name(isServerResource,'isServerResource');

export { mustCreateResourcesInSrcDir as default, ruleName };
