title: Define WebSocket as a global in ES Lint for a React Native app
body: <p>I get the following eslint error:</p>
  
  <pre><code>42:21  error  'WebSocket' is not defined  no-undef
  </code></pre>
  
  <p>You cannot import WebSocket from <code>react-native</code> because it's a global, but when I add WebSocket as globals to my <code>.eslintrc.yml</code> it doesn't change the outcome of the error:</p>
  
  <pre><code>globals:
     WebSocket: true
  </code></pre>
  
  <p>How do I define WebSocket as a global in ES Lint for a React Native app?</p>
  
  <p>Can this be fixed? Currently my .eslintrc looks like this:</p>
  
  <pre><code>env:
    browser: false
    es6: true
    commonjs: true
    node: true
  extends: 'airbnb'
  parser: babel-eslint
  globals:
      WebSocket: true
  parserOptions:
    ecmaFeatures:
      experimentalObjectRestSpread: true
      jsx: true
    sourceType: module
  plugins:
    - react
    - react-native
  rules:
    indent:
      - error
      - tab
      - {"SwitchCase": 1}
    linebreak-style:
      - error
      - unix
    quotes:
      - error
      - double
    semi:
      - error
      - never
    no-tabs: off
    max-len: off
    no-console: off
    no-plusplus: off
    global-require: off
    import/no-unresolved: off
    import/extensions: off
    class-methods-use-this: off
    react/jsx-no-bind: off
    react/forbid-prop-types: off
    react/prefer-stateless-function: off
    react/jsx-indent: [2, 'tab']
    react/jsx-indent-props: [2, 'tab']
    react/jsx-filename-extension: [1, { extensions: ['.js', '.jsx'] }]
    react/jsx-uses-react: error
    react/jsx-uses-vars: error
    react-native/no-unused-styles: 2
    react-native/split-platform-components: 2
    react-native/no-inline-styles: off
    react-native/no-color-literals: off
  </code></pre>
  
  <p>I can get rid of it using the inline comment</p>
  
  <pre><code>/* globals WebSocket:true */
  </code></pre>
  
  <p>Also when I don't inherit from the airbnb eslint, but I can't figure out which lint rule in Airbnb is responsible for blocking this.</p>