Как настроить eslint-плагин-тип потока с помощью @babel/eslint-синтаксического анализатора?

#javascript #babeljs #eslint

Вопрос:

Мой .eslintrc.js файл выглядит так

 module.exports = {
  parser: '@babel/eslint-parser',
  extends: ['eslint:recommended', 'plugin:flowtype/recommended', 'plugin:react/recommended'],
  plugins: ['flowtype', 'react'],
  settings: {
    react: {
      version: 'detect'
    },
    flowtype: {
      onlyFilesWithFlowAnnotation: false
    },
    import: {
      node: {
        extensions: ['.js', '.jsx', '.ts', '.tsx']
      }
    }
  },
  env: {
    es6: true,
    mocha: true,
    node: true
  },
  rules: {
    eqeqeq: ['error', 'always'],
    'no-console': 'off',
    'no-var': 'off',
    'prefer-const': 'off',
    'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
    'flowtype/space-after-type-colon': [2, 'always', { allowLineBreak: true }],
    'flowtype/generic-spacing': 'off',
    'flowtype/no-types-missing-file-annotation': 'off',
    'react/no-deprecated': 'off'
  }
};
 

Но flowtype не работает с eslint. Я получаю следующую ошибку при импорте типов flowtype:

ESLint: Ошибка синтаксического анализа: Неожиданный токен (2:12)

Любая помощь или предложение будут оценены по достоинству.