/**
 * @fileOverview Ensures that an imported path exists, given resolution rules.
 * @author Ben Mosher
 */

import resolve, { CASE_SENSITIVE_FS, fileExistsWithCaseSync } from 'eslint-module-utils/resolve'
import ModuleCache from 'eslint-module-utils/ModuleCache'
import moduleVisitor, { makeOptionsSchema } from 'eslint-module-utils/moduleVisitor'



module.exports = {
  meta: {
    schema: [ makeOptionsSchema({
      caseSensitive: { type: 'boolean', default: true },
    })],
  },

  create: function (context) {

    function checkSourceValue(source) {
      const shouldCheckCase = !CASE_SENSITIVE_FS &&
        (!context.options[0] || context.options[0].caseSensitive !== false)

      const resolvedPath = resolve(source.value, context)

      if (resolvedPath === undefined) {
        context.report(source,
          `Unable to resolve path to module '${source.value}'.`)
      }
import { isAbsolute } from '../core/importType'
import moduleVisitor, { makeOptionsSchema } from 'eslint-module-utils/moduleVisitor'

module.exports = {
  meta: {
    docs: {},
    schema: [ makeOptionsSchema() ],
  },

  create: function (context) {
    function reportIfAbsolute(source) {
      if (isAbsolute(source.value)) {
        context.report(source, 'Do not import modules using an absolute path')
      }
    }

    const options = Object.assign({ esmodule: true, commonjs: true }, context.options[0])
    return moduleVisitor(reportIfAbsolute, options)
  },
}