Skip to content

Commit 39e33f4

Browse files
authored
improve imports sorting with OXC tools, remove legacy ESLint config (#2133)
1 parent 2d021e1 commit 39e33f4

35 files changed

Lines changed: 89 additions & 248 deletions

.oxfmtrc.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,16 @@
1616
"**/assets",
1717
"README.md",
1818
"next-env.d.ts"
19-
]
19+
],
20+
"experimentalSortImports": {
21+
"groups": [
22+
["side-effect"],
23+
["builtin"],
24+
["external", "external-type"],
25+
["internal", "internal-type"],
26+
["parent", "parent-type"],
27+
["sibling", "sibling-type"],
28+
["index", "index-type"]
29+
]
30+
}
2031
}

.oxlintrc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@
5151
"prefer-promise-reject-errors": "error",
5252
"prefer-rest-params": "error",
5353
"prefer-spread": "error",
54-
54+
"sort-imports": [
55+
"error",
56+
{
57+
"allowSeparatedGroups": true,
58+
"ignoreDeclarationSort": true,
59+
"ignoreCase": true
60+
}
61+
],
5562
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
5663
"import/default": "error",
5764
"import/namespace": "error",

common/styleguide.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { type TextProps } from '@expo/html-elements/build/primitives/Text';
33
import Link from 'next/link';
44
import { type ComponentType, type CSSProperties, type PropsWithChildren, useState } from 'react';
55
import {
6-
StyleSheet,
76
Pressable,
8-
useWindowDimensions,
7+
type PressableProps,
98
type StyleProp,
9+
StyleSheet,
10+
useWindowDimensions,
1011
type ViewStyle,
11-
type PressableProps,
1212
} from 'react-native';
1313
import { type Style } from 'twrnc';
1414

components/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type PropsWithChildren } from 'react';
2-
import { type TextStyle, type StyleProp, type ViewStyle, View } from 'react-native';
2+
import { type StyleProp, type TextStyle, View, type ViewStyle } from 'react-native';
33
import { type Style } from 'twrnc';
44

55
import { A, HoverEffect, P } from '~/common/styleguide';

components/Filters/ClearButton.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { useState } from 'react';
22
import { Pressable, type PressableProps } from 'react-native';
33

4+
import { XIcon } from '~/components/Icons';
5+
import Tooltip from '~/components/Tooltip';
46
import tw from '~/util/tailwind';
57

6-
import { XIcon } from '../Icons';
7-
import Tooltip from '../Tooltip';
8-
98
type ClearButtonProps = Pick<PressableProps, 'onPress'>;
109

1110
export function ClearButton({ onPress }: ClearButtonProps) {

components/Filters/FilterButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { type StyleProp, View, type ViewStyle } from 'react-native';
22

33
import { P } from '~/common/styleguide';
4+
import { Button } from '~/components/Button';
5+
import { Filter as FilterIcon } from '~/components/Icons';
46
import { type Query } from '~/types';
57
import tw from '~/util/tailwind';
68

@@ -13,8 +15,6 @@ import {
1315
FILTER_STATUS,
1416
FILTER_TYPE,
1517
} from './helpers';
16-
import { Button } from '../Button';
17-
import { Filter as FilterIcon } from '../Icons';
1818

1919
type Props = {
2020
query: Query;

components/Filters/ToggleLink.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ import { useState } from 'react';
33
import { View } from 'react-native';
44

55
import { P } from '~/common/styleguide';
6+
import CheckBox from '~/components/CheckBox';
67
import { type FilterParamsType, type Query } from '~/types';
78
import tw from '~/util/tailwind';
89
import urlWithQuery from '~/util/urlWithQuery';
910

10-
import CheckBox from '../CheckBox';
11-
1211
type Props = {
1312
query: Query;
1413
filterParam: FilterParamsType;

components/Filters/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { type Query } from '~/types';
66
import { getPageQuery } from '~/util/search';
77
import tw from '~/util/tailwind';
88

9-
import { ToggleLink } from './ToggleLink';
109
import {
1110
FILTER_COMPATIBILITY,
11+
FILTER_MODULE_TYPE,
1212
FILTER_PLATFORMS,
1313
FILTER_REQUIRES_MAIN_SEARCH,
1414
FILTER_STATUS,
15-
FILTER_MODULE_TYPE,
1615
FILTER_TYPE,
1716
} from './helpers';
17+
import { ToggleLink } from './ToggleLink';
1818

1919
type FiltersProps = {
2020
query: Query;

components/Footer/PlatformTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createElement, type ComponentType } from 'react';
1+
import { type ComponentType, createElement } from 'react';
22
import { View } from 'react-native';
33

44
import { A, P } from '~/common/styleguide';

components/Footer/VercelBanner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Path, Svg, Rect, Line } from 'react-native-svg';
1+
import { Line, Path, Rect, Svg } from 'react-native-svg';
22

33
export default function VercelBanner() {
44
return (

0 commit comments

Comments
 (0)