Either I don\'t understand dependencies
vs. devDependencies
in node 100% yet or eslint is just wrong here (not capable of analyzing this correctly):
If you want to allow imports of devDependencies
in test files only you can use an array of globs
, as the documentation of no-extraneous-dependencies
states:
When using an array of globs, the setting will be set to true (no errors reported) if the name of the file being linted matches a single glob in the array, and false otherwise.
The following setting will disable the lint for test files only.
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.ts", "**/*.test.tsx"]}]
That way imports from devDependencies
are still reported as errors.