Skip to content

Commit 28669b9

Browse files
jablkoljharb
authored andcommittedSep 19, 2021
[Tests] no-extraneous-dependencies ignores unresolved imports
1 parent 471790f commit 28669b9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"devDependencies": {
3-
"@types/json-schema": "*"
3+
"a": "*"
44
}
55
}

‎tests/src/rules/no-extraneous-dependencies.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,16 @@ ruleTester.run('no-extraneous-dependencies', rule, {
395395
ruleTester.run('no-extraneous-dependencies', rule, {
396396
valid: [
397397
test(Object.assign({
398-
code: 'import type { JSONSchema7Type } from "@types/json-schema";',
398+
code: 'import type T from "a";',
399399
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
400400
}, parserConfig)),
401401
],
402402
invalid: [
403403
test(Object.assign({
404-
code: 'import { JSONSchema7Type } from "@types/json-schema";',
404+
code: 'import T from "a";',
405405
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
406406
errors: [{
407-
message: "'@types/json-schema' should be listed in the project's dependencies, not devDependencies.",
407+
message: "'a' should be listed in the project's dependencies, not devDependencies.",
408408
}],
409409
}, parserConfig)),
410410
],
@@ -414,17 +414,17 @@ ruleTester.run('no-extraneous-dependencies', rule, {
414414
valid: [],
415415
invalid: [
416416
test(Object.assign({
417-
code: 'import { JSONSchema7Type } from "@types/json-schema"; /* typescript-eslint-parser */',
417+
code: 'import T from "a"; /* typescript-eslint-parser */',
418418
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
419419
errors: [{
420-
message: "'@types/json-schema' should be listed in the project's dependencies, not devDependencies.",
420+
message: "'a' should be listed in the project's dependencies, not devDependencies.",
421421
}],
422422
}, parserConfig)),
423423
test(Object.assign({
424-
code: 'import type { JSONSchema7Type } from "@types/json-schema"; /* typescript-eslint-parser */',
424+
code: 'import type T from "a"; /* typescript-eslint-parser */',
425425
options: [{ packageDir: packageDirWithTypescriptDevDependencies, devDependencies: false }],
426426
errors: [{
427-
message: "'@types/json-schema' should be listed in the project's dependencies, not devDependencies.",
427+
message: "'a' should be listed in the project's dependencies, not devDependencies.",
428428
}],
429429
}, parserConfig)),
430430
],

0 commit comments

Comments
 (0)
Please sign in to comment.