module.exports = {
  /*
   * Imports should always come first
   */
  'import/first': 'error',

  /*
   * Reports if a module's default export is unnamed. This includes several types of unnamed data types;
   * literals, object expressions, arrays, anonymous functions, arrow functions, and anonymous class declarations.
   *
   * Ensuring that default exports are named helps improve the grepability of the codebase by encouraging the re-use
   * of the same identifier for the module's default export at its declaration site and at its import sites.
   */
  'import/no-anonymous-default-export': 'error',

  /*
   * With both CommonJS' require and the ES6 modules' import syntax, it is possible to import a module but not to use its result.
   * This can be done explicitly by not assigning the module to as variable. Doing so can mean either of the following things:
   *
   *   1. The module is imported but not used
   *   2. The module has side-effects (like should). Having side-effects, makes it hard to know whether the module is actually used or can be removed. It can also make it harder to test or mock parts of your application.
   *
   * This rule aims to remove modules with side-effects by reporting when a module is imported but not assigned.
   */
  'import/no-unassigned-import': 'error',

  /*
   * When there is only a single export from a module, prefer using default export over named export.
   */
  'import/prefer-default-export': 'error',

  /*
   * this doesn't work nicely with how we export React Components
   * https://github.com/benmosher/eslint-plugin-import/issues/544
   */
  'import/no-named-as-default': 'off',

  'import/no-unresolved': [
    'error',
    { ignore: ['^brickblock-platform-types$', '^ethereum-types$'] }
  ]
}
