diff --git a/README.md b/README.md index 143eb86..1a499cf 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,12 @@ Add the following to your `.eslintrc` config: "import/parsers": { "@typescript-eslint/parser": [".ts", ".tsx"] }, - "import/resolver": { - // use /tsconfig.json - "typescript": {}, - - // use /path/to/folder/tsconfig.json + + // use /tsconfig.json: + "import/resolver": "typescript", + + // use /path/to/folder/tsconfig.json: + "import/resolver: { "typescript": { "directory": "./path/to/folder" } diff --git a/index.js b/index.js index 7a14792..adfd17d 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ function resolveFile(source, file, config) { ); // setup tsconfig-paths - const searchStart = config.directory || process.cwd(); + const searchStart = (config && config.directory) || process.cwd(); const configLoaderResult = tsconfigPaths.loadConfig(searchStart); if (configLoaderResult.resultType === 'success') { const matchPath = tsconfigPaths.createMatchPath(