Comments (4)
Hey!
After some investigation, it looks like the main use case of reading the tsconfig for type checking is only the module resolution (baseUrl
is another example).
I don't know if it's the goal or not, but being able to run ezno
against existing code base would be really nice, and without tsconfig
I think it would be impossible.
Introducing it only for reading the compilerOptions.module
would be nice imo. It's quite simple and straightforward to implement.
About the 2nd use case, Implementing Typescript alias system would be nice, but imo it would require to refactor the module resolution into another mod as it'll start to get bigger
from ezno.
Interesting. I had in plan to use oxc's resolver for files. I think it implements some of tsconfig parsing, so hopefully should have the same features of TSC.
For the moment I think adding checking for things like Promise
and 'for loops' have priority before importing packages that use all those features, so will postpone this for now 👍
from ezno.
Interesting. This is one of the things I haven't looked at TSC's implementation. I should note Ezno does not currently read a tsconfig and doesn't have a lot of the same config.
The current relative importing logic looks at the path. If the path has an extension then it tries to read it directly. If it does not have an extension it looks for path.ts
, then path.tsx
and path.js
until it gets a file
Lines 299 to 312 in 0b5f688
I haven't done a lot of investigation. Let me know if the current thing breaks or doesn't do quite the right thing under certain circumstances. If so maybe porting "module" from TypeScript's configuration might be needed?
from ezno.
Well imo this could be a good starting point to introduce reading the tsconfig. The module resolution is one use case, but another one would be to handle the aliases as for now it would break everything I think.
E.g:
"paths": {
"@modules/*": ["src/modules/*"],
"@services/*": ["src/services/*"]
}
from ezno.
Related Issues (20)
- More configuration and per file options/configuration
- Implement destructuring assignment (declaration works already)
- feat(ci): auto-fix formatting and linting on new PRs HOT 1
- Improve fuzzing tests HOT 11
- Check using the type annotation for default parameter value and try-catch variable HOT 2
- Typescript definition for wasm target HOT 4
- Is there still a way to convert from OXC parsed AST to Ezno? HOT 1
- Crates in this repository have a different versions HOT 2
- Missing `Console` methods HOT 3
- Class types and class extends
- Allow for more than u16::MAX types HOT 1
- Merge Ezno runtime definitions with existing TS definition files HOT 3
- Narrowing
- Interface extends and type parameters extends
- Closure TDZ HOT 1
- Nominal classes
- `console.log` not variadic HOT 2
- Bug: Unsound checking of function calls with array parameters HOT 3
- `never` type lookup - "Cannot find type never" HOT 4
- Proposal: Support `unknown`, rename `TypeId::ANY_TYPE` -> `TypeId::UNKNOWN_TYPE` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ezno.