Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing test for no-extraneous-dependencies
While writing imports in VSCode recently, I started to get errors throwm from eslint that appear to originate from eslint-plugin-import. Here's the strack trace from the output panel: ``` [Error - 3:52:43 PM] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at validateString (internal/validators.js:124:11) at isAbsolute (path.js:1029:5) at isAbsolute (/path/to/repo/node_modules/eslint-plugin-import/src/core/importType.js:17:10) at typeTest (/path/to/repo/node_modules/eslint-plugin-import/src/core/importType.js:92:7) at resolveImportType (/path/to/repo/node_modules/eslint-plugin-import/src/core/importType.js:105:10) at reportIfMissing (/path/to/repo/node_modules/eslint-plugin-import/src/rules/no-extraneous-dependencies.js:170:7) at commonjs (/path/to/repo/node_modules/eslint-plugin-import/src/rules/no-extraneous-dependencies.js:267:7) at checkSourceValue (/path/to/repo/node_modules/eslint-module-utils/moduleVisitor.js:29:5) at checkSource (/path/to/repo/node_modules/eslint-module-utils/moduleVisitor.js:34:5) at /path/to/repo/node_modules/eslint/lib/linter/safe-emitter.js:45:58 ``` I am able to trigger this consistently when writing an import, before I start the open quote, like this: ``` import foo from ``` I found #1931 which pointed at a problem in the resolvers causing this problem. We do use some custom resolvers with this plugin, so I tried disabling that but the problem persisted. Thankfully, I was able to reproduce this error in the test suite. It would be good if this plugin handled this scenario gracefully instead of throwing an error.
- Loading branch information