Open
Description
Problem
JS allows to have multiple imports/exports from the same source within one file. This can reduce readability of code and create some confusion when trying to understand the code.
Example:
import { type UserDto } from "shared";
import { type UserCreateRequestDto } from "shared";
import { type UserCreateResponseDto } from "shared";
Or the same with exports:
export { type UserDto } from "shared";
export { type UserCreateRequestDto } from "shared";
export { type UserCreateResponseDto } from "shared";
Proposal
I propose to add a rule, where combining those imports/exports is mandatory. I believe in one file we should only have one import/export from a particular source file. This will make it easier to understand and see the imports and exports in a file.
import {
type UserDto,
type UserCreateRequestDto,
type UserCreateResponseDto
} from "shared";
And for exports:
export {
type UserDto,
type UserCreateRequestDto,
type UserCreateResponseDto
} from "shared";
Metadata
Metadata
Assignees
Labels
No labels