by bilalq · 3y ago · 0 comments
Before:
import { Node } from 'acorn';
import * as code_red from 'code-red';
export const parse = (source: string): Node =>
code_red.parse(source, {
sourceType: 'module',
ecmaVersion: 13,
locations: true
});
After: import * as code_red from 'code-red';
/**
* @param {string} source
* @returns {any}
*/
export const parse = (source) =>
code_red.parse(source, {
sourceType: 'module',
ecmaVersion: 13,
locations: true
});
But I'm not a Svelte maintainer or user, so if this is their choice, I guess it is what it is. It's not something I'd ever consider. There are other approaches for making linked npm package workflows more manageable. There's the one mentioned by one of the VSCode maintainer, but the simplest setup is to just have a watch process running that recompiles on the fly.EDIT: It'd be a great outcome in the end if this conversion spurs DX improvements in Node/TS.