0

我在每次使用配置跟随配置的 eslint 运行时都会收到以下警告。它是由什么引起的,我该如何摆脱它?

警告

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',
};
4

1 回答 1

0

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

此 PR解决了该问题并包含更多信息。要点是它已在包的 7.2.0 版本中修复eslint-plugin-react,所以我需要做的就是yarn upgrade eslint-plugin-react.

于 2017-10-27T10:48:37.207 回答