Skip to content

Commit c967146

Browse files
committed
Import files with .ts extensions
We have at least one passionate user (because they contributed!) using Bun, so there's probably others. Bun and Deno can run .ts files directly - but if we confuse them with import paths that don't resolve until after a transpile step, they can break. This PR ensures all files are imported as .ts files and then rewritten at build time for compatibility with non-TypeScript runtimes.
1 parent fd8efab commit c967146

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2097
-250
lines changed

eslint.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import tseslint from "typescript-eslint";
44
import globals from "globals";
55
import jsdoc from "eslint-plugin-jsdoc";
66
import prettier from "eslint-plugin-prettier";
7+
import importPlugin from "eslint-plugin-import";
78

89
export default defineConfig(
910
eslint.configs.recommended,
@@ -22,6 +23,7 @@ export default defineConfig(
2223
},
2324
plugins: {
2425
prettier,
26+
import: importPlugin,
2527
},
2628
rules: {
2729
"prettier/prettier": [2, { endOfLine: "auto" }],
@@ -31,6 +33,7 @@ export default defineConfig(
3133
"@typescript-eslint/no-empty-function": 0,
3234
"prefer-template": 2,
3335
"@typescript-eslint/consistent-type-imports": 2,
36+
"import/extensions": 2,
3437
},
3538
},
3639
{

examples/node_simple.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
// Connecting to ROS
4-
import * as ROSLIB from "../src/RosLib";
4+
import * as ROSLIB from "../src/RosLib.ts";
55

66
const ros = new ROSLIB.Ros({
77
url: "ws://localhost:9090",

0 commit comments

Comments
 (0)