From 7e6dc2a536742ba4b21be01db2107f2b43589c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Fri, 15 May 2026 21:26:03 +0400 Subject: [PATCH] lint: fix lint errors --- components/auth-form/index.js | 1 - components/versions/list-versions.js | 9 +++++++-- lib/directus.js | 2 -- lib/format.js | 2 +- next.config.mjs | 2 +- package.json | 3 ++- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/components/auth-form/index.js b/components/auth-form/index.js index 03b2e8f..1455694 100644 --- a/components/auth-form/index.js +++ b/components/auth-form/index.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import PropTypes from 'prop-types' import Link from 'next/link' import {useState} from 'react' diff --git a/components/versions/list-versions.js b/components/versions/list-versions.js index d598a83..81f57af 100644 --- a/components/versions/list-versions.js +++ b/components/versions/list-versions.js @@ -1,4 +1,9 @@ -import {forwardRef, useRef, useState, useEffect} from 'react' +import { + forwardRef, + useRef, + useState, + useEffect +} from 'react' import PropTypes from 'prop-types' import Table from '@mui/material/Table' import TableBody from '@mui/material/TableBody' @@ -300,8 +305,8 @@ export default function ListVersions({ color='primary' size='small' value={viewMode} - onChange={handleViewModeChange} sx={{alignSelf: {xs: 'center', sm: 'auto'}}} + onChange={handleViewModeChange} > diff --git a/lib/directus.js b/lib/directus.js index cef8777..1540c5c 100644 --- a/lib/directus.js +++ b/lib/directus.js @@ -1,4 +1,3 @@ -/* eslint-disable camelcase */ import { createDirectus, rest, authentication, withToken, createItem, readUser, createContentVersion, readContentVersions, saveToContentVersion, @@ -141,7 +140,6 @@ export async function listVersions({ return versions } catch (error) { - if (error) { countdownRef.current.startCountdown() } else { diff --git a/lib/format.js b/lib/format.js index 3563d53..2689912 100644 --- a/lib/format.js +++ b/lib/format.js @@ -25,7 +25,7 @@ export function formatDate(date, formatStr = 'PP', {withTimezone = false} = {}) }) if (withTimezone) { - const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone + const timezone = new Intl.DateTimeFormat().resolvedOptions().timeZone return `${formatted} (${timezone})` } diff --git a/next.config.mjs b/next.config.mjs index 0d77d83..66579ef 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -27,7 +27,7 @@ const cspDirectives = [ `default-src ${SELF}`, `script-src ${SELF} ${UNSAFE_INLINE}`, `style-src ${SELF} ${UNSAFE_INLINE}`, - `connect-src ${SELF} ${apiUrl} ${wsUrl} ${derivedWsUrl}`.trim().replace(/ {2,}/g, ' '), + `connect-src ${SELF} ${apiUrl} ${wsUrl} ${derivedWsUrl}`.trim().replaceAll(/ {2,}/g, ' '), `img-src ${SELF} data: blob:`, `font-src ${SELF}`, `object-src ${NONE}`, diff --git a/package.json b/package.json index 4f3179f..91d032e 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,8 @@ ], "n/prefer-global/process": "off", "comma-dangle": "off", - "unicorn/prevent-abbreviations": "off" + "unicorn/prevent-abbreviations": "off", + "camelcase": ["error", {"properties": "never"}] }, "overrides": [ {