javascriptstandardjs

standardjs throws 'Blob' is not defined


I have this code

const blobData = new Blob([url])

and when I run standard js it throws "'Blob' is not defined"

Someone have an idea why it's happening?


Solution

  • You can also use Blob inside your browser: https://developer.mozilla.org/en-US/docs/Web/API/Blob. To resolve this lint issue you have to configure your eslint config like this:

    in package.json:

    ...
    "standard": {
      "env": {
        "browser": true
      }
    },
    ...
    

    or in .eslintrc:

    {
      "env": {
        "browser": true
      },
      ...
    }