🚨 Fixes and disables eslint rules
This commit is contained in:
parent
e670c571c7
commit
c747f4548e
@ -1,16 +1,25 @@
|
|||||||
import { dirname } from "path";
|
import { dirname } from 'path'
|
||||||
import { fileURLToPath } from "url";
|
import { fileURLToPath } from 'url'
|
||||||
import { FlatCompat } from "@eslint/eslintrc";
|
import { FlatCompat } from '@eslint/eslintrc'
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
const __dirname = dirname(__filename);
|
const __dirname = dirname(__filename)
|
||||||
|
|
||||||
const compat = new FlatCompat({
|
const compat = new FlatCompat({
|
||||||
baseDirectory: __dirname,
|
baseDirectory: __dirname,
|
||||||
});
|
})
|
||||||
|
|
||||||
const eslintConfig = [
|
const eslintConfig = [
|
||||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
||||||
];
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'react-hooks/rules-of-hooks': 'off',
|
||||||
|
'react-hooks/exhaustive-deps': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'@next/next/no-img-element': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
export default eslintConfig;
|
export default eslintConfig
|
||||||
|
@ -18,7 +18,7 @@ export function SnLoginRouter({
|
|||||||
factorList: SnAuthFactor[]
|
factorList: SnAuthFactor[]
|
||||||
onNext: (val: SnAuthFactor) => void
|
onNext: (val: SnAuthFactor) => void
|
||||||
}) {
|
}) {
|
||||||
const factorTypeIcons = [<PasswordIcon />, <EmailIcon />]
|
const factorTypeIcons = [<PasswordIcon key="password-icon" />, <EmailIcon key="email-icon" />]
|
||||||
const factorTypeLabels = ['Password', 'Email verification code']
|
const factorTypeLabels = ['Password', 'Email verification code']
|
||||||
|
|
||||||
const [error, setError] = useState<string | null>(null)
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
@ -11,7 +11,7 @@ export default async function handler(_: NextApiRequest, res: NextApiResponse) {
|
|||||||
out['authorization_endpoint'] = siteUrl + '/auth/authorize'
|
out['authorization_endpoint'] = siteUrl + '/auth/authorize'
|
||||||
out['jwks_uri'] = siteUrl + '/.well-known/jwks'
|
out['jwks_uri'] = siteUrl + '/.well-known/jwks'
|
||||||
|
|
||||||
for (let [k, v] of Object.entries(out)) {
|
for (const [k, v] of Object.entries(out)) {
|
||||||
if (typeof v === 'string') {
|
if (typeof v === 'string') {
|
||||||
if (v.startsWith('https://id.solsynth.dev/api')) {
|
if (v.startsWith('https://id.solsynth.dev/api')) {
|
||||||
out[k] = v.replace('https://id.solsynth.dev/api', solarNetworkApi + '/cgi/id')
|
out[k] = v.replace('https://id.solsynth.dev/api', solarNetworkApi + '/cgi/id')
|
||||||
|
@ -61,7 +61,7 @@ export default function AccountConfirm() {
|
|||||||
className="animate__animated animate__flash animate__infinite"
|
className="animate__animated animate__flash animate__infinite"
|
||||||
style={{ '--animate-duration': '3s' } as any}
|
style={{ '--animate-duration': '3s' } as any}
|
||||||
>
|
>
|
||||||
Hold on a moment, we're working on it...
|
Hold on a moment, we're working on it...
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
@ -29,9 +29,9 @@ export const getServerSideProps = (async (context) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
let posts: SnPostWithAttachments[] = resp.data as SnPostWithAttachments[]
|
const posts: SnPostWithAttachments[] = resp.data as SnPostWithAttachments[]
|
||||||
for (let idx = 0; idx < posts.length; idx++) {
|
for (let idx = 0; idx < posts.length; idx++) {
|
||||||
let post = posts[idx]
|
const post = posts[idx]
|
||||||
if (post.body.content) {
|
if (post.body.content) {
|
||||||
let processor: any = unified().use(remarkParse)
|
let processor: any = unified().use(remarkParse)
|
||||||
if (post.type != 'article') {
|
if (post.type != 'article') {
|
||||||
|
@ -107,7 +107,7 @@ export default function UserProfile({ user, checkIn }: InferGetServerSidePropsTy
|
|||||||
|
|
||||||
<Box display="flex" flexDirection="column" gap={0.5}>
|
<Box display="flex" flexDirection="column" gap={0.5}>
|
||||||
{user.badges.map((b) => (
|
{user.badges.map((b) => (
|
||||||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'start' }}>
|
<Box sx={{ display: 'flex', gap: 2, alignItems: 'start' }} key={b.id}>
|
||||||
{SnAccountBadgeMapping[b.type].icon}
|
{SnAccountBadgeMapping[b.type].icon}
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="body2">{SnAccountBadgeMapping[b.type].name}</Typography>
|
<Typography variant="body2">{SnAccountBadgeMapping[b.type].name}</Typography>
|
||||||
|
@ -4,7 +4,7 @@ import { hasCookie, getCookie, setCookie } from 'cookies-next/client'
|
|||||||
|
|
||||||
const baseURL = 'https://api.sn.solsynth.dev'
|
const baseURL = 'https://api.sn.solsynth.dev'
|
||||||
|
|
||||||
export let sni: AxiosInstance = (() => {
|
export const sni: AxiosInstance = (() => {
|
||||||
const inst = axios.create({
|
const inst = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user