Skip to content

Commit a4a152f

Browse files
committed
enable eslint warning for import order (autofixable)
Don't worry, it ignores bare imports if you're doing a side-effect thing. Also, avoid doing side-effect things.
1 parent e790644 commit a4a152f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+119
-101
lines changed

.eslintrc.cjs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,27 @@ module.exports = {
1818
fixStyle: 'inline-type-imports',
1919
},
2020
],
21-
'import/no-duplicates': 'warn',
21+
'import/no-duplicates': ['warn', { 'prefer-inline': true }],
22+
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
23+
'import/order': [
24+
'warn',
25+
{
26+
alphabetize: { order: 'asc', caseInsensitive: true },
27+
groups: [
28+
'builtin',
29+
'external',
30+
'internal',
31+
'parent',
32+
'sibling',
33+
'index',
34+
],
35+
pathGroups: [
36+
{ pattern: '~/**', group: 'internal' },
37+
{ pattern: 'test/**', group: 'internal' },
38+
{ pattern: '@/icon-name', group: 'internal' },
39+
],
40+
},
41+
],
2242
},
2343
overrides: [
2444
{

app/components/forms.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useInputEvent } from '@conform-to/react'
22
import React, { useId, useRef } from 'react'
3+
import { Checkbox, type CheckboxProps } from '~/components/ui/checkbox.tsx'
34
import { Input } from '~/components/ui/input.tsx'
45
import { Label } from '~/components/ui/label.tsx'
5-
import { Checkbox, type CheckboxProps } from '~/components/ui/checkbox.tsx'
66
import { Textarea } from '~/components/ui/textarea.tsx'
77

88
export type ListOfErrors = Array<string | null | undefined> | null | undefined

app/components/search-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Form, useSearchParams, useSubmit } from '@remix-run/react'
2+
import { useDebounce, useIsSubmitting } from '~/utils/misc.tsx'
23
import { Icon } from './ui/icon.tsx'
34
import { Input } from './ui/input.tsx'
45
import { Label } from './ui/label.tsx'
56
import { StatusButton } from './ui/status-button.tsx'
6-
import { useDebounce, useIsSubmitting } from '~/utils/misc.tsx'
77

88
export function SearchBar({
99
status,

app/components/ui/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from 'react'
21
import { Slot } from '@radix-ui/react-slot'
32
import { cva, type VariantProps } from 'class-variance-authority'
3+
import * as React from 'react'
44

55
import { cn } from '~/utils/misc.tsx'
66

app/components/ui/checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as React from 'react'
21
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
2+
import * as React from 'react'
33

44
import { cn } from '~/utils/misc.tsx'
55

app/components/ui/dropdown-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as React from 'react'
21
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
2+
import * as React from 'react'
33

44
import { cn } from '~/utils/misc.tsx'
55

app/components/ui/icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { type SVGProps } from 'react'
2+
import { type IconName } from '@/icon-name'
23
import { cn } from '~/utils/misc.tsx'
34
import href from './icons/sprite.svg'
45

5-
import { type IconName } from '@/icon-name'
66
export { href }
77
export { IconName }
88

app/components/ui/label.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from 'react'
21
import * as LabelPrimitive from '@radix-ui/react-label'
32
import { cva, type VariantProps } from 'class-variance-authority'
3+
import * as React from 'react'
44

55
import { cn } from '~/utils/misc.tsx'
66

app/components/ui/status-button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react'
2-
import { Button, type ButtonProps } from './button.tsx'
3-
import { cn } from '~/utils/misc.tsx'
42
import { useSpinDelay } from 'spin-delay'
3+
import { cn } from '~/utils/misc.tsx'
4+
import { Button, type ButtonProps } from './button.tsx'
55
import { Icon } from './icon.tsx'
66
import {
77
Tooltip,

app/components/ui/toast.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from 'react'
21
import * as ToastPrimitives from '@radix-ui/react-toast'
32
import { cva, type VariantProps } from 'class-variance-authority'
3+
import * as React from 'react'
44
import { cn } from '~/utils/misc.tsx'
55
import { Icon } from './icon.tsx'
66

0 commit comments

Comments
 (0)