How to use the eslint-module-utils/ModuleCache.getSettings function in eslint-module-utils

To help you get started, we’ve selected a few eslint-module-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benmosher / eslint-plugin-import / tests / src / core / resolve.js View on Github external
it('detects case does not match FS', function () {
      expect(fileExistsWithCaseSync(file, ModuleCache.getSettings(testContext)))
        .to.be.false
    })
    it('detecting case does not include parent folder path (issue #720)', function () {
github benmosher / eslint-plugin-import / src / rules / no-unresolved.js View on Github external
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}'.`)
      }

      else if (shouldCheckCase) {
        const cacheSettings = ModuleCache.getSettings(context.settings)
        if (!fileExistsWithCaseSync(resolvedPath, cacheSettings)) {
          context.report(source,
            `Casing of ${source.value} does not match the underlying filesystem.`)
        }

      }
    }