error 'document' is not defined : eslint / React

Solution 1:

Add "browser": true your env to include global variables (like document, window, etc.)

See the ESLint environment documentation for more information.

Solution 2:

set an env property in you eslint.rc file, e.g.

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