Skip to content

Commit b5a8cde

Browse files
authored
Require file extensions on non-package imports (#468)
1 parent c480474 commit b5a8cde

File tree

4 files changed

+907
-12
lines changed

4 files changed

+907
-12
lines changed

typescript/packages/jumble/eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import js from "@eslint/js";
22
import globals from "globals";
33
import reactHooks from "eslint-plugin-react-hooks";
44
import reactRefresh from "eslint-plugin-react-refresh";
5+
import importPlugin from "eslint-plugin-import";
56
import tseslint from "typescript-eslint";
67

78
export default tseslint.config(
@@ -16,6 +17,7 @@ export default tseslint.config(
1617
plugins: {
1718
"react-hooks": reactHooks,
1819
"react-refresh": reactRefresh,
20+
"import": importPlugin
1921
},
2022
rules: {
2123
"@typescript-eslint/no-explicit-any": "off",
@@ -24,6 +26,13 @@ export default tseslint.config(
2426
"warn",
2527
{ allowConstantExport: true },
2628
],
29+
"import/extensions": [
30+
"error",
31+
"always",
32+
{
33+
"ignorePackages": true,
34+
}
35+
],
2736
},
2837
},
2938
);

typescript/packages/jumble/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"cmdk": "^1.0.4",
5252
"csstype": "^3.1.3",
5353
"emoji-picker-react": "^4.12.0",
54+
"eslint-plugin-import": "^2.31.0",
5455
"json5": "^2.2.3",
5556
"merkle-reference": "^2.0.1",
5657
"react": "^18.3.1",

typescript/packages/jumble/src/views/CharmList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { useCell } from "@/hooks/use-cell";
1+
import { useCell } from "@/hooks/use-cell.ts";
22
import { NavLink } from "react-router-dom";
33
import { NAME, UI } from "@commontools/builder";
44
import { useCharmManager } from "@/contexts/CharmManagerContext.tsx";
5-
import { Charm, CharmManager } from "@commontools/charm";
5+
import { Charm } from "@commontools/charm";
66
import { charmId } from "@/utils/charms.ts";
77
import { useEffect, useRef, useState } from "react";
88
import { Card } from "@/components/Card.tsx";
@@ -11,7 +11,7 @@ import { render } from "@commontools/html";
1111
import { Cell } from "@commontools/runner";
1212
import ShapeLogo from "@/assets/ShapeLogo.svg";
1313
import { MdOutlineStar } from "react-icons/md";
14-
import { useSyncedStatus } from "@/hooks/use-synced-status";
14+
import { useSyncedStatus } from "@/hooks/use-synced-status.ts";
1515

1616
export interface CommonDataEvent extends CustomEvent {
1717
detail: {

0 commit comments

Comments
 (0)