Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

1006 - A file cannot have a reference to itself.

🔍 Regex Patterns

regexFind: /(.*)/
regexReplace: $1

💡 Suggestion

Remove self-reference. Files cannot reference themselves.

📝 Examples

Example 1: Remove self-reference entirely

- /// <reference path="./index.ts" />
+ // Remove self-reference

Explanation: Remove triple-slash directive that references the same file

Example 2: Change reference to different file

- /// <reference path="./index.ts" />
+ /// <reference path="./other-file.ts" />

Explanation: Change reference to point to a different file

🖼️ Visual Output

Command

npx tsc ./docs/1006/index.ts --noEmit --pretty
docs/1006/index.ts:1:22 - error TS1006: A file cannot have a reference to itself.

1 /// <reference path="./index.ts" />
                       ~~~~~~~~~~

OR (without --pretty flag):

Result

docs/1006/index.ts(1,22): error TS1006: A file cannot have a reference to itself.