{"version":3,"file":"vue_file_not_in_tsconfig.cjs","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":"qJAMMA,EAA2BC,EAAAA,WAAW,CAC1C,KAAM,uBACN,KAAM,CACJ,KAAM,aACN,KAAM,CACJ,YACE,4GAAA,EAEJ,OAAQ,CAAA,EACR,SAAU,CACR,cACE,8GAAA,CACJ,EAEF,OAAOC,EAAS,CAEd,GAAI,CAACA,EAAQ,SAAS,SAAS,MAAM,EACnC,MAAO,CAAA,EAGT,MAAMC,EADWD,EAAQ,WAAW,gBACV,QAE1B,GAAI,CAACC,EACH,MAAO,CAAA,EAMT,MAAMC,EAAgBD,EAAQ,iBAAA,EAC9B,OAAIC,EAAc,SAAW,GAAKA,EAAc,CAAC,IAAMF,EAAQ,iBACtD,CAAA,EAEF,CACL,QAAQG,EAAM,CACZH,EAAQ,OAAO,CACb,KAAAG,EACA,UAAW,eAAA,CACZ,CACH,CAAA,CAEJ,EACA,eAAgB,CAAA,CAClB,CAAC"}