Skip to content

Commit a810190

Browse files
wagenetclaude
andcommitted
Restore fixture files needed for TypeScript type resolution
The .ts fixture files and usage.gts placeholder are required because: 1. The tsconfig glob must match a physically-existing file for TypeScript to include it in the project. 2. The rule only checks ImportBinding definitions, so TypeScript must resolve the imports and read @deprecated from the source files. Added a comment in the test explaining why these files are needed and why other rules can use virtual filenames without real files. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent a6cd56a commit a810190

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/lib/rules/template-no-deprecated.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ ruleTester.run('template-no-deprecated', rule, {
3838
});
3939

4040
// Block 2: TypeScript project -- full deprecation checking
41+
//
42+
// Unlike most rule tests, this block requires physical fixture files in
43+
// tests/lib/rules-preprocessor/template-no-deprecated/. Two reasons:
44+
//
45+
// 1. The tsconfig uses glob patterns to build its file list. The `filename`
46+
// passed to RuleTester must physically exist so TypeScript includes it.
47+
//
48+
// 2. This rule only checks ImportBinding definitions. To detect @deprecated,
49+
// TypeScript must resolve the import and read the JSDoc from the source
50+
// file. Inline class/function definitions are not checked.
51+
//
52+
// Rules that don't use parserOptions.project, or whose logic doesn't depend
53+
// on TypeScript import resolution, can use any virtual filename.
4154

4255
const PREPROCESSOR_DIR = path.join(__dirname, '../rules-preprocessor');
4356

0 commit comments

Comments
 (0)