executor: node

parameters:
  cache-version:
    type: string
  lockfile-parent-path:
    type: string
    default: .
steps:
  - checkout
  - restore-cache:
      version: << parameters.cache-version >>
      cache-name: dependencies
  - restore-cache:
      version: << parameters.cache-version >>
      cache-name: eslint-cache
  - lint:
      step-name: ESLint
      script: eslint --cache --cache-location .eslintcache --cache-strategy content
  - save-cache:
      version: << parameters.cache-version >>
      lockfile-parent-path: << parameters.lockfile-parent-path >>
      cache-name: eslint-cache
      path: .eslintcache
