Specify more eslint rules
This commit is contained in:
parent
41015bd9b0
commit
9829eeb8a1
|
|
@ -10,7 +10,16 @@
|
||||||
"react-hooks/exhaustive-deps": "off",
|
"react-hooks/exhaustive-deps": "off",
|
||||||
"space-infix-ops": "warn",
|
"space-infix-ops": "warn",
|
||||||
"comma-spacing": "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": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,10 @@ const RecentEvents = ({ eventId, times, onImport }: RecentEventsProps) => {
|
||||||
const { t, i18n } = useTranslation('event')
|
const { t, i18n } = useTranslation('event')
|
||||||
|
|
||||||
const allRecents = useStore(useRecentsStore, state => state.recents)
|
const allRecents = useStore(useRecentsStore, state => state.recents)
|
||||||
const recents = useMemo(() =>
|
const recents = useMemo(() => allRecents
|
||||||
allRecents
|
|
||||||
?.filter(hasAvailability)
|
?.filter(hasAvailability)
|
||||||
.filter(e => e.id !== eventId && e.user.availability.some(a => times.includes(a))) ?? [],
|
.filter(e => e.id !== eventId && e.user.availability.some(a => times.includes(a))) ?? [],
|
||||||
[allRecents]
|
[allRecents])
|
||||||
)
|
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
const [selected, setSelected] = useState<string>()
|
const [selected, setSelected] = useState<string>()
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ const Month = ({ value, onChange }: MonthProps) => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{hasPastDates && <div className={styles.warningLabel}>
|
{hasPastDates && <div className={styles.warningLabel}>
|
||||||
<AlertTriangle size='1.2em' />
|
<AlertTriangle size="1.2em" />
|
||||||
<span>{t('form.dates.warnings.date_in_past')}</span>
|
<span>{t('form.dates.warnings.date_in_past')}</span>
|
||||||
</div>}
|
</div>}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,6 @@ const ToggleField = <TValue extends string>({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
|
|
||||||
export default ToggleField
|
export default ToggleField
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ export const detectBrowser = () => {
|
||||||
const isChrome = !!window.chrome
|
const isChrome = !!window.chrome
|
||||||
|
|
||||||
// Edge (based on chromium) detection
|
// Edge (based on chromium) detection
|
||||||
|
// eslint-disable-next-line eqeqeq
|
||||||
const isEdgeChromium = isChrome && (navigator.userAgent.indexOf("Edg") != -1)
|
const isEdgeChromium = isChrome && (navigator.userAgent.indexOf("Edg") != -1)
|
||||||
|
|
||||||
if (isEdgeChromium) return 'edge_chromium'
|
if (isEdgeChromium) return 'edge_chromium'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue