Skip to content

Commit

Permalink
fixed type check linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoren committed Dec 1, 2023
1 parent ef24ade commit b8c250e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
32 changes: 31 additions & 1 deletion heat-stack/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import fontStyleSheetUrl from './styles/font.css'
import tailwindStyleSheetUrl from './styles/tailwind.css'
import { Links, Scripts } from '@remix-run/react'

Check warning on line 4 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`@remix-run/react` import should occur before import of `./styles/font.css`
import { href as iconsHref } from './components/ui/icon.tsx'

Check warning on line 5 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./components/ui/icon.tsx` import should occur before import of `./styles/font.css`
import { type LinksFunction } from '@remix-run/node'
import { DataFunctionArgs, json, type LinksFunction } from '@remix-run/node'

Check warning on line 6 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

Import "DataFunctionArgs" is only used as types

Check warning on line 6 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`@remix-run/node` import should occur before import of `./styles/font.css`

import { CaseSummary } from './components/CaseSummary.tsx'

Check warning on line 8 in heat-stack/app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

`./components/CaseSummary.tsx` import should occur before import of `./styles/font.css`
import './App.css'
import { useNonce } from './utils/nonce-provider.ts'
import { makeTimings } from './utils/timing.server.ts'
import { combineHeaders, getDomainUrl } from './utils/misc.tsx'
// import { csrf } from './utils/csrf.server.ts'
import { getEnv } from './utils/env.server.ts'

export const links: LinksFunction = () => {
return [
Expand Down Expand Up @@ -37,6 +41,32 @@ export const links: LinksFunction = () => {
].filter(Boolean)
}

export async function loader({ request }: DataFunctionArgs) {
const timings = makeTimings('root loader')
// const honeyProps = honeypot.getInputProps()
// const [csrfToken, csrfCookieHeader] = await csrf.commitToken()

return json(
{
requestInfo: {
// hints: getHints(request),
origin: getDomainUrl(request),
path: new URL(request.url).pathname,
userPrefs: {},
},
ENV: getEnv(),
// honeyProps,
// csrfToken,
},
{
headers: combineHeaders(
{ 'Server-Timing': timings.toString() },
// csrfCookieHeader ? { 'set-cookie': csrfCookieHeader } : null,
),
},
)
}

export default function HeatStack({ env = {} }) {
const nonce = useNonce()
return (
Expand Down
4 changes: 2 additions & 2 deletions heat-stack/app/utils/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function userHasPermission(
) {
if (!user) return false
const { action, entity, access } = parsePermissionString(permission)
return user.roles.some(role =>
return user.roles.some((role: { permissions: any[] }) =>
role.permissions.some(
permission =>
permission.entity === entity &&
Expand All @@ -97,5 +97,5 @@ export function userHasRole(
role: string,
) {
if (!user) return false
return user.roles.some(r => r.name === role)
return user.roles.some((r: { name: string }) => r.name === role)
}

0 comments on commit b8c250e

Please sign in to comment.