title: ESLint: PayloadAction not found in '@reduxjs/toolkit'(import/named)
body: <p>I'm currently building a React app with Redux-toolkit on TypeScript, which was created using  create-react-app &amp; I'm getting this error in every Reducer file in my project:</p>
  <p><strong>ESLint: PayloadAction not found in '@reduxjs/toolkit'(import/named)</strong></p>
  <p>Here is one described for example</p>
  <p>Code:</p>
  <pre class="lang-js prettyprint-override"><code>import {createSlice, PayloadAction} from &quot;@reduxjs/toolkit&quot; // An error is coming from here
  
  export interface IInitialState {
      isDisSignUp: boolean
  }
  
  const initialState: IInitialState = {
      isDisSignUp: true,
  }
  
  export const buttonSlice = createSlice({
      name: &quot;button&quot;,
      initialState,
      reducers: {
          disSignUpButton(state, action: PayloadAction&lt;boolean&gt;) {
              state.isDisSignUp = action.payload
          },
      },
  })
  
  export default buttonSlice.reducer
  </code></pre>
  <p>My .eslintrc.json</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;env&quot;: {
          &quot;browser&quot;: true,
          &quot;es2021&quot;: true
      },
      &quot;extends&quot;: [
          &quot;eslint:recommended&quot;,
          &quot;plugin:react/recommended&quot;,
          &quot;plugin:@typescript-eslint/recommended&quot;,
          &quot;plugin:import/recommended&quot;,
          &quot;prettier&quot;
      ],
      &quot;parser&quot;: &quot;@typescript-eslint/parser&quot;,
      &quot;parserOptions&quot;: {
          &quot;ecmaFeatures&quot;: {
              &quot;jsx&quot;: true,
              &quot;modules&quot;: true
          },
          &quot;ecmaVersion&quot;: &quot;latest&quot;,
          &quot;sourceType&quot;: &quot;module&quot;,
          &quot;project&quot;: &quot;tsconfig.json&quot;
      },
      &quot;plugins&quot;: [&quot;react&quot;, &quot;@typescript-eslint&quot;, &quot;react-hooks&quot;, &quot;import&quot;],
      &quot;rules&quot;: {
          &quot;indent&quot;: [
              &quot;error&quot;,
              4,
              {
                  &quot;SwitchCase&quot;: 1
              }
          ],
          &quot;linebreak-style&quot;: [&quot;error&quot;, &quot;unix&quot;],
          &quot;quotes&quot;: [&quot;error&quot;, &quot;double&quot;],
          &quot;semi&quot;: [&quot;error&quot;, &quot;never&quot;],
          &quot;react-hooks/rules-of-hooks&quot;: &quot;error&quot;,
          &quot;react-hooks/exhaustive-deps&quot;: &quot;warn&quot;,
          &quot;react/jsx-filename-extension&quot;: [
              1,
              {
                  &quot;extensions&quot;: [&quot;.tsx&quot;]
              }
          ],
          &quot;import/prefer-default-export&quot;: &quot;off&quot;,
          &quot;import/extensions&quot;: [
              &quot;error&quot;,
              &quot;ignorePackages&quot;,
              {
                  &quot;ts&quot;: &quot;never&quot;,
                  &quot;tsx&quot;: &quot;never&quot;
              }
          ]
      },
      &quot;settings&quot;: {
          &quot;import/resolver&quot;: {
              &quot;node&quot;: {
                  &quot;extensions&quot;: [&quot;.jsx&quot;, &quot;.js&quot;, &quot;.ts&quot;, &quot;.tsx&quot;]
              },
              &quot;typescript&quot;: {
                  &quot;alwaysTryTypes&quot;: true
              }
          }
      }
  }
  </code></pre>
  <p>My .tsconfig.json</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;compilerOptions&quot;: {
          &quot;target&quot;: &quot;ES6&quot;,
          &quot;lib&quot;: [&quot;dom&quot;, &quot;dom.iterable&quot;, &quot;esnext&quot;],
          &quot;allowJs&quot;: true,
          &quot;skipLibCheck&quot;: true,
          &quot;esModuleInterop&quot;: true,
          &quot;allowSyntheticDefaultImports&quot;: true,
          &quot;strict&quot;: true,
          &quot;forceConsistentCasingInFileNames&quot;: true,
          &quot;noFallthroughCasesInSwitch&quot;: true,
          &quot;module&quot;: &quot;esnext&quot;,
          &quot;moduleResolution&quot;: &quot;node&quot;,
          &quot;resolveJsonModule&quot;: true,
          &quot;isolatedModules&quot;: true,
          &quot;noEmit&quot;: true,
          &quot;jsx&quot;: &quot;react-jsx&quot;
      },
      &quot;include&quot;: [&quot;src&quot;]
  }
  
  </code></pre>
  <p>My package.json</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;name&quot;: &quot;test_task__myself2&quot;,
      &quot;version&quot;: &quot;0.1.0&quot;,
      &quot;private&quot;: true,
      &quot;dependencies&quot;: {
          &quot;@reduxjs/toolkit&quot;: &quot;^1.8.3&quot;,
          &quot;@testing-library/jest-dom&quot;: &quot;^5.14.1&quot;,
          &quot;@testing-library/react&quot;: &quot;^13.0.0&quot;,
          &quot;@testing-library/user-event&quot;: &quot;^13.2.1&quot;,
          &quot;@types/jest&quot;: &quot;^27.0.1&quot;,
          &quot;@types/node&quot;: &quot;^16.7.13&quot;,
          &quot;@types/react&quot;: &quot;^18.0.0&quot;,
          &quot;@types/react-dom&quot;: &quot;^18.0.0&quot;,
          &quot;@types/react-redux&quot;: &quot;^7.1.24&quot;,
          &quot;@types/react-router-dom&quot;: &quot;^5.3.3&quot;,
          &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^5.30.7&quot;,
          &quot;@typescript-eslint/parser&quot;: &quot;^5.30.7&quot;,
          &quot;axios&quot;: &quot;^0.27.2&quot;,
          &quot;classnames&quot;: &quot;^2.3.1&quot;,
          &quot;dotenv&quot;: &quot;^16.0.1&quot;,
          &quot;email-validator&quot;: &quot;^2.0.4&quot;,
          &quot;eslint-plugin-react&quot;: &quot;^7.20.0&quot;,
          &quot;react&quot;: &quot;^18.2.0&quot;,
          &quot;react-dom&quot;: &quot;^18.2.0&quot;,
          &quot;react-redux&quot;: &quot;^8.0.2&quot;,
          &quot;react-router-dom&quot;: &quot;^6.3.0&quot;,
          &quot;react-scripts&quot;: &quot;5.0.1&quot;,
          &quot;redux&quot;: &quot;^4.2.0&quot;,
          &quot;sass&quot;: &quot;^1.54.0&quot;,
          &quot;typescript&quot;: &quot;^4.4.2&quot;,
          &quot;web-vitals&quot;: &quot;^2.1.0&quot;
      },
      &quot;scripts&quot;: {
          &quot;start&quot;: &quot;react-scripts start&quot;,
          &quot;build&quot;: &quot;react-scripts build&quot;,
          &quot;test&quot;: &quot;react-scripts test&quot;,
          &quot;eject&quot;: &quot;react-scripts eject&quot;
      },
      &quot;eslintConfig&quot;: {
          &quot;extends&quot;: [
              &quot;react-app&quot;,
              &quot;react-app/jest&quot;
          ]
      },
      &quot;browserslist&quot;: {
          &quot;production&quot;: [
              &quot;&gt;0.2%&quot;,
              &quot;not dead&quot;,
              &quot;not op_mini all&quot;
          ],
          &quot;development&quot;: [
              &quot;last 1 chrome version&quot;,
              &quot;last 1 firefox version&quot;,
              &quot;last 1 safari version&quot;
          ]
      },
      &quot;devDependencies&quot;: {
          &quot;eslint&quot;: &quot;^7.2.0&quot;,
          &quot;eslint-config-airbnb&quot;: &quot;^19.0.4&quot;,
          &quot;eslint-config-prettier&quot;: &quot;^8.5.0&quot;,
          &quot;eslint-import-resolver-typescript&quot;: &quot;^2.7.1&quot;,
          &quot;eslint-plugin-import&quot;: &quot;^2.26.0&quot;,
          &quot;eslint-plugin-jsx-a11y&quot;: &quot;^6.3.0&quot;,
          &quot;eslint-plugin-prettier&quot;: &quot;^4.0.0&quot;,
          &quot;eslint-plugin-react-hooks&quot;: &quot;^4&quot;,
          &quot;node-sass&quot;: &quot;^7.0.1&quot;,
          &quot;prettier&quot;: &quot;^2.6.2&quot;
      }
  }
  </code></pre>
  <p><strong>Edit</strong></p>
  <p>This solution helped me:</p>
  <p>Edit .eslintrc.json</p>
  <pre class="lang-json prettyprint-override"><code>    &quot;settings&quot;: {
          &quot;import/parsers&quot;: {
              &quot;@typescript-eslint/parser&quot;: [&quot;.ts&quot;, &quot;.tsx&quot;]
          },
          &quot;import/resolver&quot;: {
              &quot;typescript&quot;: {
                  &quot;alwaysTryTypes&quot;: true
              }
          }
      }
  </code></pre>