Specify more eslint rules

This commit is contained in:
Benji Grant 2023-06-20 19:09:58 +10:00
parent 41015bd9b0
commit 9829eeb8a1
8 changed files with 80 additions and 72 deletions

View file

@ -10,7 +10,16 @@
"react-hooks/exhaustive-deps": "off",
"space-infix-ops": "warn",
"comma-spacing": "warn",
"react-hooks/rules-of-hooks": "off"
"react-hooks/rules-of-hooks": "off",
"eqeqeq": "error",
"no-return-await": "warn",
"no-var": "error",
"prefer-const": "warn",
"eol-last": ["warn", "always"],
"indent": ["warn", 2],
"semi": ["error", "never"],
"arrow-parens": ["error", "as-needed"],
"jsx-quotes": ["warn", "prefer-double"]
},
"overrides": [
{

View file

@ -22,12 +22,10 @@ const RecentEvents = ({ eventId, times, onImport }: RecentEventsProps) => {
const { t, i18n } = useTranslation('event')
const allRecents = useStore(useRecentsStore, state => state.recents)
const recents = useMemo(() =>
allRecents
const recents = useMemo(() => allRecents
?.filter(hasAvailability)
.filter(e => e.id !== eventId && e.user.availability.some(a => times.includes(a))) ?? [],
[allRecents]
)
[allRecents])
const [isOpen, setIsOpen] = useState(false)
const [selected, setSelected] = useState<string>()

View file

@ -121,7 +121,7 @@ const Month = ({ value, onChange }: MonthProps) => {
</div>
{hasPastDates && <div className={styles.warningLabel}>
<AlertTriangle size='1.2em' />
<AlertTriangle size="1.2em" />
<span>{t('form.dates.warnings.date_in_past')}</span>
</div>}
</>

View file

@ -20,6 +20,7 @@ export const detectBrowser = () => {
const isChrome = !!window.chrome
// Edge (based on chromium) detection
// eslint-disable-next-line eqeqeq
const isEdgeChromium = isChrome && (navigator.userAgent.indexOf("Edg") != -1)
if (isEdgeChromium) return 'edge_chromium'