This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3979) * feature - no-implicit-dependencies - add whitelist (#3839) This allows you to specify a whitelist of modules that will not be part of package.json such as project-relative aliases * feature - no-implicit-dependencies - add whitelist (#3839) Use Set for whitelist package name comparison instead of Array.
- Loading branch information
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
test/rules/no-implicit-dependencies/whitelist-with-dev/test.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as ts from 'typescript'; | ||
~~~~~~~~~~~~ [err % ('typescript')] | ||
|
||
import * from 'src/a'; | ||
|
||
import * from 'app/b'; | ||
|
||
import * from 'notapp/c'; | ||
~~~~~~~~~~ [err % ('notapp')] | ||
|
||
[err]: Module '%s' is not listed as dependency in package.json |
5 changes: 5 additions & 0 deletions
5
test/rules/no-implicit-dependencies/whitelist-with-dev/tslint.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"no-implicit-dependencies": [true, "dev", ["src", "app"]] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
test/rules/no-implicit-dependencies/whitelist/test.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as ts from 'typescript'; | ||
|
||
import * from 'src/a'; | ||
|
||
import * from 'app/b'; | ||
|
||
import * from 'notapp/c'; | ||
~~~~~~~~~~ [err % ('notapp')] | ||
|
||
[err]: Module '%s' is not listed as dependency in package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"no-implicit-dependencies": [true, ["src", "app"]] | ||
} | ||
} |