<commit_before>import React from "react"
import { useApolloClient } from "@apollo/client"
import { Navigate } from "react-router-dom"
import { useLogoutMutation } from "dicty-graphql-schema"
import { useAuthStore, ActionType } from "features/Authentication/AuthStore"

/**
 * Logout handles the user logout process.
 */
const Logout = () => {
  const client = useApolloClient()
  const {
    state: { token },
    dispatch,
  } = useAuthStore()
  const [logout] = useLogoutMutation({
    context: {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    },
  })

  React.useEffect(() => {
    // Empty token results in a 401, causing network errors
    if (!token || token === "") return

    logout()
    dispatch({
      type: ActionType.LOGOUT,
    })
    client.resetStore()
  }, [dispatch, logout, client])

  return <Navigate to="/" />
}
<commit_msg>fix: disable linting for useEffect in Logout<commit_after>import React from "react"
import { useApolloClient } from "@apollo/client"
import { Navigate } from "react-router-dom"
import { useLogoutMutation } from "dicty-graphql-schema"
import { useAuthStore, ActionType } from "features/Authentication/AuthStore"

/**
 * Logout handles the user logout process.
 */
const Logout = () => {
  const client = useApolloClient()
  const {
    state: { token },
    dispatch,
  } = useAuthStore()
  const [logout] = useLogoutMutation({
    context: {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    },
  })

  React.useEffect(() => {
    // Empty token results in a 401, causing network errors
    if (!token || token === "") return

    logout()
    dispatch({
      type: ActionType.LOGOUT,
    })
    client.resetStore()
    // eslint-disable-next-line
  }, [dispatch, logout, client])

  return <Navigate to="/" />
}

{'fraction_non_alphanumeric': 0.14151464897733554, 'fraction_numerical': 0.003316749585406302, 'mean_word_length': 3.0950226244343892, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2350918', 'n_tokens_mistral': 579, 'n_tokens_neox': 562, 'n_words': 147}