iisaduan / ts-fix Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
You can get this from project.ts.version
It's because cli.ts
has side effects (running codefixes), but you try to import makeOptions
from it. So when the import gets evaluated, it's like you're actually running the CLI. You should separate makeOptions
(and anything else you could need to import) into a different file.
We're not actually writing files, but on the second pass, the TS project reads the original files from disk instead of reading our virtual changes. We need to make TS read those virtual changes.
Missing ()
here to actually call the anonymous async function:
Line 101 in 74b8516
I think we should do away with the default of applying all available fixes. It’s bound to produce a ton of undesired changes.
This is what I get on my machine:
● option_empty_argv
expect(received).toEqual(expected) // deep equality
Expected: "/Users/anbranc/Developer/microsoft/TS-transform-project/C:\\TSuser\\src\\tsconfig.json"
Received: "/Users/anbranc/Developer/microsoft/TS-transform-project/C:\\TSuser\\src/tsconfig.json"
Both the expected and received look fishy to me. We should probably avoid hard-coding Windows-style paths into tests as they’ll behave differently on different OSes.
interface I {}
declare const obj: I;
obj.foo;
// ^^^ Property 'aa' does not exist on type 'I'.ts(2339)
This error returns two fixes:
For each, the fixName is fixMissingMember
. They represent two different ways of fixing the same thing. I believe the current code will try to apply them both. Unfortunately, there’s not actually a way to differentiate them besides their description
property, which is dynamic.
A minimal fix, probably good enough to start with, would be to only apply the first fix returned for a given error, since we try to sort the most likely fixes first. If we need more granularity, we’d need an API change from TypeScript itself.
The number of diagnostics the tool reports is way higher than what tsc -p
reports because the LS host seems to have a wrong implementation of getDefaultLibFileName
.
This will never be true since arrays are compared by reference equality. I don’t think the condition is needed, though?
Line 70 in 90a7e5c
It’s a multi-pass one and it only shows one update right now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.