Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find All References fails for CommonJS named exports in checkJs Mode #60094

Open
golopot opened this issue Sep 29, 2024 · 1 comment
Open

Find All References fails for CommonJS named exports in checkJs Mode #60094

golopot opened this issue Sep 29, 2024 · 1 comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@golopot
Copy link

golopot commented Sep 29, 2024

🔎 Search Terms

"export", "references", "commonjs", "checkJs", "allowJs",

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
    This bugs reproduces in typescript@3,4,5

⏯ Playground Link

No response

💻 Code

Request find all references for the symbol f in f.js

// f.js:
function f() {}
module.exports = {
  f,
};

// main.js
const { f } = require("./f");
f();

Reproduction repo: https://github.com/golopot/testcommonjs

🙁 Actual behavior

Doesn't find the reference from the dependent ./main.js.

🙂 Expected behavior

Do find the reference from the dependent ./main.js.

Additional information about the issue

{
  "compilerOptions": {
    "target": "es2016",                                 
    "module": "commonjs",                                
    "allowJs": true,                                 
    "checkJs": true,                                  
    "noEmit": true,                                  
    "esModuleInterop": true,                            
    "forceConsistentCasingInFileNames": true,            
    "strict": false,                                    
    "skipLibCheck": true                          
  }
}
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Oct 2, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Oct 2, 2024
@heysujal
Copy link

heysujal commented Oct 6, 2024

So we try to find all the occurences where the require syntax is being and it is not able to reference from where it is exported. I want to know what do we intend to do after that? should we convert all of them to import syntax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants