-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Describe the problem
Per @Rich-Harris in nodejs/node#46074 (comment):
. . . allowing modules to import each other without specifying the .js extension was a silly mistake that added untold complexity for no good reason. It makes authored code more ambiguous and less self-explanatory, makes runtimes slower, and adds a complexity tax to tooling that has compounded immeasurably over time. It was a horrible error.
I ran npm create svelte@latest
today and chose “SvelteKit demo app,” “JavaScript with JSDoc comments” and looked around at the files, and many had references to extensionless files. For example, src/routes/sverdle/+page.server.js
has import { Game } from './game';
(instead of ./game.js
) and src/routes/sverdle/game.js
has import { words, allowed } from './words.server';
(instead of ./words.server.js
).
Describe the proposed solution
Let’s ensure that all the example import
statements that refer to individual files (not library exports) include extensions, even for JavaScript files.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response