forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn on not-yet-supported import.meta usage (vercel#2397)
This implements a warning when `import.meta` is referenced, both as a standalone expression (`import.meta`) and as a member expression (`import.meta.url`, `import.meta.foo`, etc.). To do: * [x] This expression covers both `import.meta` as well as `new.target`. Investigate how this usage is impacted and handle it. Test Plan: * Added a `import.meta` expression and `import.meta.url` member expression in a test app and verified both were flagged (see below) * In the same test app, verified using `new.target` was not flagged. ``` path/to/testapp/src/index.jsx:1:12 error TP1106 import.meta is not yet supported 1 > console.log(import.meta); 2 console.log(import.meta.url); 3 4 function Foo() { 5 new.target; path/to/testapp/src/index.jsx:2:12 error TP1106 import.meta is not yet supported 1 console.log(import.meta); 2 > console.log(import.meta.url); 3 4 function Foo() { 5 new.target; 6 } ```
- Loading branch information
1 parent
90aed6c
commit 75479b0
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters