Skip to content

Commit

Permalink
Merge pull request #858 from laysent/master
Browse files Browse the repository at this point in the history
Fix issue #720
  • Loading branch information
benmosher committed Aug 27, 2017
2 parents cd77133 + 006ddeb commit 57527c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/core/resolve.js
Expand Up @@ -3,6 +3,7 @@ import { expect } from 'chai'
import resolve, { CASE_SENSITIVE_FS, fileExistsWithCaseSync } from 'eslint-module-utils/resolve'
import ModuleCache from 'eslint-module-utils/ModuleCache'

import * as path from 'path'
import * as fs from 'fs'
import * as utils from '../utils'

Expand Down Expand Up @@ -133,6 +134,11 @@ describe('resolve', function () {
expect(fileExistsWithCaseSync(file, ModuleCache.getSettings(testContext)))
.to.be.false
})
it('detecting case does not include parent folder path (issue #720)', function () {
const f = path.join(process.cwd().toUpperCase(), './tests/files/jsx/MyUnCoolComponent.jsx')
expect(fileExistsWithCaseSync(f, ModuleCache.getSettings(testContext), true))
.to.be.true
})
})

describe('rename cache correctness', function () {
Expand Down
1 change: 1 addition & 0 deletions utils/resolve.js
Expand Up @@ -21,6 +21,7 @@ exports.fileExistsWithCaseSync = function fileExistsWithCaseSync(filepath, cache

// null means it resolved to a builtin
if (filepath === null) return true
if (filepath.toLowerCase() === process.cwd().toLowerCase()) return true
const parsedPath = path.parse(filepath)
, dir = parsedPath.dir

Expand Down

0 comments on commit 57527c7

Please sign in to comment.