'FC' is defined but never used.eslint (no-unused-vars)

Viewed 2708

I am getting this warning from eslint:

X is defined but never used for every type imported from react or react-native. An example with FC and ViewProps (See image below).

Here is my .eslintrc.js:

module.exports = {
  env: {
    browser: true,
    es6: true,
    node: true,
  },
  extends: [
    'airbnb',
    "plugin:import/typescript",
  ],
  parser: "@typescript-eslint/parser",
  globals: {
    Atomics: 'readonly',
    SharedArrayBuffer: 'readonly',
  },
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
    "linebreak-style": 0,
    "jsx-a11y/label-has-associated-control": ["error", {
      "required": {
        "some": ["nesting", "id"]
      }
    }],
    "jsx-a11y/label-has-for": ["error", {
      "required": {
        "some": ["nesting", "id"]
      }
    }],
    "react/jsx-props-no-spreading": [1, {
      "custom": "ignore"
    }],
  },
};

enter image description here

enter image description here

1 Answers

Solved the same issue adding 'plugin:@typescript-eslint/recommended' to 'extends' array in .eslintrc

also, if you'll need it, I have "plugin:react/recommended" and "airbnb" in my extends

Related