Does anyone know how to restrict importing `.js` extensions on `.ts` files?
I need some kind of ESLint plugin/TS rule for this so that Node's TS runner doesn't crash at runtime
I need some kind of ESLint plugin/TS rule for this so that Node's TS runner doesn't crash at runtime
Comments
"typescript.preferences.importModuleSpecifierEnding": "ts"
Do you mean that you have a foo.ts file but you have `import foo from 'foo.js'`?
As a result, my IDE consistently tries to import `.ts` files as `.js` extensions, but Node's new --strip-t runtime crashes when it can't find the JS file
https://www.typescriptlang.org/tsconfig/#allowImportingTsExtensions
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
I would be inclined to try configuring lint rules to enforce imports without file extensions.