Skip to content

TS Server stats odd seeming file names when resolving json import #52704

Closed as not planned
@mjbvz

Description

@mjbvz

Related to #52695

Bug Report

🔎 Search Terms

  • fs.stat
  • statSync
  • performance

Problem

In a JS file, write:

const a = require('./x.json');

This causes TS Server to stat some odd seeming file paths, such as:

stat /Users/matb/projects/san/x.d.json.ts
stat /Users/matb/projects/san/x.json.ts
stat /Users/matb/projects/san/x.json.tsx
stat /Users/matb/projects/san/x.json.d.ts
stat /Users/matb/projects/san/x.json.js
stat /Users/matb/projects/san/x.json.jsx

Could these calls be avoided? It seems unlikely that you'd want to resolve files with those names in this case

Discovered this while working on project wide IntelliSense for web

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions