I really like type imports that are unambiguous. For this reason, I've made use of the "importsNotUsedAsValues": "error"
option in tsconfig.json
for a while now. This option has been deprecated in TypeScript 5.0.0, and will be removed in TypeScript 5.5.0. This post will look at what you can do instead.
33 posts tagged with "javascript"
View All TagsMigrating Azure Functions from JSDoc JavaScript to TypeScript
I wrote previously about how to implement a dynamic redirect mechanism for Azure Static Web Apps using Azure Functions. I implemented this using JSDoc JavaScript. I've since migrated this to TypeScript and I thought it would be interesting to share the process.
TypeScript 4.7 and ECMAScript Module Support
As part of the TypeScript 4.7 release comes a major upgrade to ECMAScript Module Support for Node.js. This post takes a look at what that means.
Type annotations: strong types, weakly held
Recently, a new ECMAScript proposal called "Type Annotations" (originally named "Types as Comments") was revealed. The purpose is to allow type annotations to be valid JavaScript syntax. Albeit syntax that is ignored by JavaScript engines. The proposal is being worked on by Gil Tayar, Daniel Rosenwasser, Romulo Cintra, Rob Palmer, and others. Many of these people are from TypeScript community - however this proposal intentionally does not exist to benefit TypeScript alone.
ESLint your C# in VS Code with Roslyn Analyzers
ESLint provides a great linting experience for TypeScript and JavaScript in VS Code. The suggestions, fixes and ignore options make creating clean code a joy. A similar experience is available for C# in VS Code through Roslyn Analyzers - this post tells us more.
TypeScript vs JSDoc JavaScript
There's a debate to be had about whether using JavaScript or TypeScript leads to better outcomes when building a project. The introduction of using JSDoc annotations to type a JavaScript codebase introduces a new dynamic to this discussion. This post will investigate what that looks like, and come to an (opinionated) conclusion.
Using TypeScript and ESLint with webpack (fork-ts-checker-webpack-plugin new feature!)
The fork-ts-checker-webpack-plugin
has, since its inception, performed two classes of checking:
TypeScript 2.0, ES2016 and Babel
TypeScript 2.0 has shipped! Naturally I'm excited. For some time I've been using TypeScript to emit ES2015 code which I pass onto Babel to transpile to ES "old school". You can see how here.
The Ternary Operator <3 Destructuring
I'm addicted to the ternary operator. For reasons I can't explain, I cannot get enough of:
Creating an ES2015 Map from an Array in TypeScript
I'm a great lover of ES2015's Map
. However, just recently I tumbled over something I find a touch inconvenient about how you initialise a new Map
from the contents of an Array
in TypeScript.
ES6 + TypeScript + Babel + React + Flux + Karma: The Secret Recipe
I wrote a while ago about how I was using some different tools in a current project:
Things Done Changed
Some people fear change. Most people actually. I'm not immune to that myself, but not in the key area of technology. Any developer that fears change when it comes to the tools and languages that he / she is using is in the wrong business. Because what you're using to cut code today will not last. The language will evolve, the tools and frameworks that you love will die out and be replaced by new ones that are different and strange. In time, the language you feel you write as a native will fall out of favour, replaced by a new upstart.
(Top One, Nice One) Get Sorted
I was recently reading a post by Jaime González García which featured the following mind-bending proposition:
Angular UI Bootstrap Datepicker Weirdness
The Angular UI Bootstrap Datepicker is fan-dabby-dozy. But it has a ... pecularity. You can use the picker like this:
Using Gulp in Visual Studio instead of Web Optimization
Journalling the Migration of Jasmine Tests to TypeScript
I previously attempted to migrate my Jasmine tests from JavaScript to TypeScript. The last time I tried it didn't go so well and I bailed. Thank the Lord for source control. But feeling I shouldn't be deterred I decided to have another crack at it.
Running JavaScript Unit Tests in AppVeyor
With a little help from Chutzpah...
My Unrequited Love for Isolate Scope
I wrote a little while ago about creating a directive to present server errors on the screen in an Angular application. In my own (not so humble opinion), it was really quite nice. I was particularly proud of my usage of isolate scope. However, pride comes before a fall.
The Surprisingly Happy Tale of Visual Studio Online, Continous Integration and Chutzpah
Going off piste
Using Bootstrap Tooltips to display jQuery Validation error messages
I love jQuery Validation. I was recently putting together a screen which had a lot of different bits of validation going on. And the default jQuery Validation approach of displaying the validation messages next to the element being validated wasn't working for me. That is to say, because of the amount of elements on the form, the appearance of validation messages was really making a mess of the presentation. So what to do?