{"version":3,"file":"vue_file_not_in_tsconfig.mjs","sources":["../../src/rules/vue_file_not_in_tsconfig.ts"],"sourcesContent":["/**\n * @module @nhtio/eslint-config/rules/vue_file_not_in_tsconfig\n */\n\nimport { createRule } from './common'\n\nconst vueFileNotInTsconfigRule = createRule({\n  name: 'vueFileNotInTsconfig',\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'Warn when a Vue SFC is not included in the TypeScript project, causing type-aware lint rules to be skipped',\n    },\n    schema: [],\n    messages: {\n      notInTsconfig:\n        'This file is not included in your tsconfig.json. Add it to the \"include\" array to enable type-aware linting.',\n    },\n  },\n  create(context) {\n    // Only relevant for Vue SFCs — other file types have their own tsconfig handling\n    if (!context.filename.endsWith('.vue')) {\n      return {}\n    }\n    const services = context.sourceCode.parserServices\n    const program = services?.program\n    // No program at all — projectService not configured, nothing to check\n    if (!program) {\n      return {}\n    }\n    // When the project service uses allowDefaultProject for a file not in any tsconfig,\n    // it creates a single-file inferred project containing only the file being linted.\n    // A real tsconfig-backed project will have multiple root files.\n    // Checking rootFileNames.length === 1 identifies this inferred-project case.\n    const rootFileNames = program.getRootFileNames()\n    if (rootFileNames.length !== 1 || rootFileNames[0] !== context.physicalFilename) {\n      return {}\n    }\n    return {\n      Program(node) {\n        context.report({\n          node,\n          messageId: 'notInTsconfig',\n        })\n      },\n    }\n  },\n  defaultOptions: [],\n})\n\nexport default vueFileNotInTsconfigRule\n"],"names":["vueFileNotInTsconfigRule","createRule","context","program","rootFileNames","node"],"mappings":";AAMA,MAAMA,IAA2BC,EAAW;AAAA,EAC1C,MAAM;AAAA,EACN,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,aACE;AAAA,IAAA;AAAA,IAEJ,QAAQ,CAAA;AAAA,IACR,UAAU;AAAA,MACR,eACE;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,OAAOC,GAAS;AAEd,QAAI,CAACA,EAAQ,SAAS,SAAS,MAAM;AACnC,aAAO,CAAA;AAGT,UAAMC,IADWD,EAAQ,WAAW,gBACV;AAE1B,QAAI,CAACC;AACH,aAAO,CAAA;AAMT,UAAMC,IAAgBD,EAAQ,iBAAA;AAC9B,WAAIC,EAAc,WAAW,KAAKA,EAAc,CAAC,MAAMF,EAAQ,mBACtD,CAAA,IAEF;AAAA,MACL,QAAQG,GAAM;AACZ,QAAAH,EAAQ,OAAO;AAAA,UACb,MAAAG;AAAA,UACA,WAAW;AAAA,QAAA,CACZ;AAAA,MACH;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,gBAAgB,CAAA;AAClB,CAAC;"}