Skip to content

Commit 399d8cc

Browse files
committed
fix: lint, use typescript-eslint rule instead
1 parent 5816dd7 commit 399d8cc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@ const config = {
6060
{
6161
files: ['**/*.tsx', '**/*.jsx'],
6262
rules: {
63-
'no-restricted-imports': [
63+
'@typescript-eslint/no-restricted-imports': [
6464
'error',
6565
{
6666
paths: [
6767
{
6868
name: '~/env.mjs',
6969
importNames: ['env'],
70+
allowTypeImports: true,
7071
message:
7172
'Please use `hooks/useEnv` hook instead. This prevents unusable env variables in client-side code.',
7273
},

src/components/AppProviders/EnvProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Used to allow overriding of environment variables in storybook tests.
33
import { createContext, type PropsWithChildren } from 'react'
44

5-
import { type env } from '~/env.mjs'
5+
import type { env } from '~/env.mjs'
66

77
// Typescript magic to only select keys from object T that start with a prefix S.
88
type PickStartsWith<T extends object, S extends string> = {

src/pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { EnvProvider, FeatureProvider } from '~/components/AppProviders'
1212
import { DefaultFallback } from '~/components/ErrorBoundary/DefaultFallback'
1313
import Suspense from '~/components/Suspense'
1414
import { VersionWrapper } from '~/components/VersionWrapper'
15-
// eslint-disable-next-line no-restricted-imports
15+
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
1616
import { env } from '~/env.mjs'
1717
import { LoginStateProvider } from '~/features/auth'
1818
import { type NextPageWithLayout } from '~/lib/types'

0 commit comments

Comments
 (0)