`无法通过反应预设解决参考`eslint警告

时间:2017-10-27 10:48:37

标签: reactjs eslint eslint-config-airbnb

我在使用配置后的配置运行的每个eslint上都会收到以下警告。它是由什么造成的?如何摆脱它?

eslint warnings

can't resolve reference #/definitions/basicConfig from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #
can't resolve reference #/definitions/basicConfigOrBoolean from id #

.eslintrc.js

module.exports = {
  extends: 'airbnb',
  root: true,
  env: {
    browser: true,
    jest: true,
  },
  plugins: ['react', 'jsx-a11y', 'import', 'jest'],
  rules: {
    'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
    'react/jsx-filename-extension': [0],
    'import/prefer-default-export': [0],
  },
  settings: {
    'import/resolver': {
      webpack: {
        config: 'webpack.config.js',
      },
    },
  },
  parser: 'babel-eslint',
};

1 个答案:

答案 0 :(得分:0)

此错误是由eslint-plugin-react包引起的(我在this airbnb config issue之后发现)。

This PR解决了这个问题并包含更多信息。 The gisteslint-plugin-react软件包在<7.2> 中已修复,因此我需要做的只是yarn upgrade eslint-plugin-react