import-js / eslint-plugin-import
Showing 1 of 4 files from the diff.

@@ -18,14 +18,17 @@
Loading
18 18
    schema: [
19 19
      makeOptionsSchema({
20 20
        caseSensitive: { type: 'boolean', default: true },
21 +
        caseSensitiveStrict: { type: 'boolean', default: false },
21 22
      }),
22 23
    ],
23 24
  },
24 25
25 26
  create(context) {
27 +
    const options = context.options[0] || {};
28 +
26 29
    function checkSourceValue(source) {
27 -
      const shouldCheckCase = !CASE_SENSITIVE_FS
28 -
        && (!context.options[0] || context.options[0].caseSensitive !== false);
30 +
      const caseSensitive = !CASE_SENSITIVE_FS && options.caseSensitive !== false;
31 +
      const caseSensitiveStrict = !CASE_SENSITIVE_FS && options.caseSensitiveStrict;
29 32
30 33
      const resolvedPath = resolve(source.value, context);
31 34
@@ -34,9 +37,9 @@
Loading
34 37
          source,
35 38
          `Unable to resolve path to module '${source.value}'.`
36 39
        );
37 -
      } else if (shouldCheckCase) {
40 +
      } else if (caseSensitive || caseSensitiveStrict) {
38 41
        const cacheSettings = ModuleCache.getSettings(context.settings);
39 -
        if (!fileExistsWithCaseSync(resolvedPath, cacheSettings)) {
42 +
        if (!fileExistsWithCaseSync(resolvedPath, cacheSettings, caseSensitiveStrict)) {
40 43
          context.report(
41 44
            source,
42 45
            `Casing of ${source.value} does not match the underlying filesystem.`
@@ -45,6 +48,6 @@
Loading
45 48
      }
46 49
    }
47 50
48 -
    return moduleVisitor(checkSourceValue, context.options[0]);
51 +
    return moduleVisitor(checkSourceValue, options);
49 52
  },
50 53
};
Files Coverage
resolvers 27.96%
scripts 0.00%
src 98.60%
utils 98.38%
config/typescript.js 100.00%
memo-parser/index.js 0.00%
Project Totals (93 files) 84.28%
45.5
TRAVIS_OS_NAME=osx
6=
45.6
TRAVIS_OS_NAME=osx
4=
45.3
10=0
TRAVIS_OS_NAME=osx
46.6
TRAVIS_OS_NAME=osx
4=
46.5
TRAVIS_OS_NAME=osx
6=
45.2
12=2
TRAVIS_OS_NAME=osx
46.1
TRAVIS_OS_NAME=osx
14=4
46.4
8=
TRAVIS_OS_NAME=osx
46.2
12=2
TRAVIS_OS_NAME=osx
45.1
TRAVIS_OS_NAME=osx
14=4
46.3
10=0
TRAVIS_OS_NAME=osx
45.4
8=
TRAVIS_OS_NAME=osx