Skip to content

[eslint] Consistent import rules#4087

Open
m-bert wants to merge 3 commits intomainfrom
@mbert/more-eslint
Open

[eslint] Consistent import rules#4087
m-bert wants to merge 3 commits intomainfrom
@mbert/more-eslint

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented Apr 14, 2026

Description

This PR aims to add new eslint rules, that:

  • Require sorted imports
  • Require type when importing only types

As there would be too many changes, I've decided to split this into two PRs. This one will be base, similarly as in monorepo migration.

Test plan

  • yarn lint-js
  • yarn ts-check
image

Copilot AI review requested due to automatic review settings April 14, 2026 12:39
@m-bert m-bert marked this pull request as draft April 14, 2026 12:39
@m-bert m-bert changed the title Consistent import rules [eslint] Consistent import rules Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s root ESLint configuration to enforce more consistent TypeScript import/export patterns and import sorting, as a foundation for a larger import-cleanup effort across packages/apps.

Changes:

  • Enable @typescript-eslint/consistent-type-imports and @typescript-eslint/consistent-type-exports as errors.
  • Enable ESLint core sort-imports as an error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

m-bert added 2 commits April 14, 2026 16:12
## Description

This PR fixes eslint errors in package after enabling new `import` rules

## Test plan

- `yarn ts-check`
- `yarn lint-js`

I've also run Sonnet to make sure that only `imports` were affected:

<img width="1018" height="289" alt="image"
src="https://github.com/user-attachments/assets/bdc7a858-ae67-4fc2-9152-cf12dc8cac38"
/>
## Description

This PR fixes eslint errors in package after enabling new import rules

>[!NOTE]
>`images.d.ts` was added because otherwise it is not possible to import
`*.png` as `import` statement.

## Test plan

- `yarn ts-check`
- `yarn lint-js`

<img width="1053" height="441" alt="image"
src="https://github.com/user-attachments/assets/e4490888-2484-4380-8bd3-92ee57a6ed97"
/>
@m-bert m-bert marked this pull request as ready for review April 14, 2026 14:19
@m-bert m-bert requested review from coado, Copilot and j-piasecki April 14, 2026 14:19
Copy link
Copy Markdown
Contributor

@coado coado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 299 out of 301 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants