Skip to content

Commit

Permalink
🔧 [#445] Add rule for @/ import order
Browse files Browse the repository at this point in the history
Explicit @/ imports are preferred as they deliberately signal that
it's code from our own root/src dir. This will eventually allow us to
clean up the rest of the import sorting config.
  • Loading branch information
sergei-maertens committed Mar 6, 2025
1 parent f954f9d commit c885000
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"importOrder": ["^((api-mocks|components|data|formio|hooks|map|routes|story-utils|types)/(.*)|(api|api-mocks|cache|Context|errors|headers|i18n|routes|sdk|sentry|types|utils))$", "^[./]"],
"importOrder": ["^((api-mocks|components|data|formio|hooks|map|routes|story-utils|types)/(.*)|(api|api-mocks|cache|Context|errors|headers|i18n|routes|sdk|sentry|types|utils))$", "^@/.*", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
2 changes: 1 addition & 1 deletion src/components/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {FormattedMessage} from 'react-intl';

import {getBEMClassName} from 'utils';
import {getBEMClassName} from '@/utils';

export const MODIFIERS = ['centered', 'only-child', 'small', 'gray'] as const;

Expand Down
2 changes: 1 addition & 1 deletion src/components/Price.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {FormattedMessage, FormattedNumber} from 'react-intl';

import {getBEMClassName} from 'utils';
import {getBEMClassName} from '@/utils';

export interface PriceProps {
price?: string | number; // the API serializes decimals to strings to not lose precision
Expand Down

0 comments on commit c885000

Please sign in to comment.