---
  extends: airbnb-typescript

  settings:
    react:
      version: detect

  rules:
    '@typescript-eslint/lines-between-class-members':
      - error
      - exceptAfterSingleLine: true
    '@typescript-eslint/naming-convention': off # TODO: reenable
    '@typescript-eslint/no-unused-vars': off # TODO: reenable
    '@typescript-eslint/no-unused-expressions': off # TODO: reenable
    '@typescript-eslint/no-use-before-define':
      - error
      - variables: true
        functions: false # disable. i love hoisting functions
        classes: false #
    '@typescript-eslint/semi': # don't allow semicolons
      - error
      - never
    class-methods-use-this:
      - off
    default-case: off
    function-paren-newline: off # TODO: really tripping up. REENABLE
    guard-for-in: off # TODO: reenable
    import/no-cycle: off # TODO: reenable. disabled because circular deps are hard to fix right now
    import/prefer-default-export: off # named exports much better for .d.ts files
    import/export: off # kept saying 'Multiple exports of name...'. why?
    jsx-a11y/anchor-is-valid: off
    jsx-a11y/click-events-have-key-events: off
    jsx-a11y/no-static-element-interactions: off
    max-len:
      - error
      - code: 140
    new-cap: off
    no-cond-assign:
      - error
      - except-parens
    no-console:
      - error
      - allow: ['warn', 'error']
    no-multi-assign: off
    no-nested-ternary: off
    no-param-reassign: off
    no-restricted-globals: off # waiting for IE11 death b/c isNaN is needed (not Number.isNaN)
    no-restricted-syntax: off # was restricting for...of statements. a mistake it seems. REVISIT
    no-return-assign:
      - error
      - except-parens
    no-underscore-dangle: off # important for pseudo-private properties
    object-curly-newline:
      - error
      - ImportDeclaration: # newlines were required within `import` statements? disable. pretty sure this was a mistake
          multiline: true
    operator-linebreak: off # prevents JSX if statements looking correct. REVISIT for other uses
    prefer-const: off # TODO: revisit
    prefer-destructuring: off # is too aggressive, sometimes doesn't make sense
    prefer-template: off
    react/destructuring-assignment: off
    react/jsx-props-no-spreading: off # more acceptable in preact, b/c no proptype filtering
    react/prop-types: off # preact doesn't care about proptypes
    react/react-in-jsx-scope: off # because we use preact
    react/sort-comp: off
    react/static-property-placement: off # typescript transpilation makes this a non-issue

  overrides:
    # indentation of TS defs is wonkily linted. disable for specific files.
    # https://github.com/typescript-eslint/typescript-eslint/issues/1824
    - files:
        - packages/common/src/options.ts
        - packages-premium/resource-common/src/reducers/resource-action.ts
        - packages-premium/timeline/src/TimelineLaneSlicer.ts
        - packages/__tests__/src/legacy/header-rendering.ts
      rules:
        '@typescript-eslint/indent': off
