'F C' определено, но никогда не используется. Eslint (no-unused-vars) - PullRequest
0 голосов
/ 23 марта 2020

Я получаю это предупреждение от eslint:

X определено, но никогда не используется для каждого типа, импортируемого из реагирования или нативного реагирования. Пример с FC и ViewProps (см. Изображение ниже).

Вот мой .eslintr c. 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

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...