|
|
|
|
|
by insin
1977 days ago
|
|
If you're using VS Code or WebStorm/IntelliJ (and doubtless any other editor which has its own internal copy of TypeScript and uses its language service) you can write JavaScript and still get most of the benefits of using TypeScript without buying into the tooling - it's my preferred way to make use of it. e.g. for VS Code, stick a jsconfig.json in your project's root: {
"compilerOptions": {
"checkJs": true,
"target": "es2020"
}
}
If you want TypeScript to know about the types in your project, or help it with stuff it can't figure out on its own you can add them using JSDoc comments:https://www.typescriptlang.org/docs/handbook/jsdoc-supported... The best thing is if TypeScript is being silly about your working code (its type definitions for the DOM can be particularly painful to work with), you can just ignore it :) |
|