Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import sorting #14031

Closed
AdamSchinzel opened this issue Aug 30, 2024 · 1 comment · Fixed by #15264
Closed

Import sorting #14031

AdamSchinzel opened this issue Aug 30, 2024 · 1 comment · Fixed by #15264

Comments

@AdamSchinzel
Copy link
Contributor

AdamSchinzel commented Aug 30, 2024

I really like when imports are sorted since you know what are you importing from libraries, files etc. This makes even more sense to our repo because we would be able to differentiate imports from external libraries, @trezor packages, @suite-common packages, @suite-native packages and files. To what and how many groups we will divide imports is for sure open for a discussion.

There are multiple tools for import sorting that work nicely out of the box (for example this one).

// 🔴 not that clean
import { decode, verify } from 'jws';
import { jws as configJwsLocal } from '../files/config.v1';
import { ACTION_PREFIX, messageSystemActions } from './messageSystemActions';
import { getJWSPublicKey, isCodesignBuild, isNative } from '@trezor/env-utils';
import { memoize, memoizeWithArgs } from 'proxy-memoize';

// 🟢 nice and clean
import { decode, verify } from 'jws';
import { memoize, memoizeWithArgs } from 'proxy-memoize';

import { getJWSPublicKey, isCodesignBuild, isNative } from '@trezor/env-utils';

import { jws as configJwsLocal } from '../files/config.v1';
import { ACTION_PREFIX, messageSystemActions } from './messageSystemActions';
@AdamSchinzel AdamSchinzel added the code Code improvements label Aug 30, 2024
@github-project-automation github-project-automation bot moved this to 🎯 To do in Suite Desktop Aug 30, 2024
@AdamSchinzel AdamSchinzel removed the code Code improvements label Aug 30, 2024
@Nodonisko
Copy link
Contributor

This is already enabled in most of repo, it's only disabled for package/suite here https://vscode.dev/github/trezor/trezor-suite/blob/feat/flashlist-bottom-sheet/.eslintrc.js#L346

Feel free to enable it for everything.

@github-project-automation github-project-automation bot moved this from 🎯 To do to 🤝 Needs QA in Suite Desktop Nov 6, 2024
@bosomt bosomt moved this from 🤝 Needs QA to ✅ Approved in Suite Desktop Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants