-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect ignore patterns in FDirSourceFileProvider (#103)
At present, FDirSourceFileProvider does not respect ignore patterns from the input tsconfig. Because of this, we run into issues in owa where, if you build packages in OWA then run good-fences with `-x`, you will get fence errors about non-exported members under `lib`. This change makes FDirSourceFileProvider aware of the ignore patterns in the passed in tsconfig (not recursively, however). As part of this change, I also - add an explicit dependency on @types/picomatch so we can check in our own code - turns on esModuleInterop so we can import picomatch directly - removes deprecated types from @types/commander, since commander ships with types now. - Updates the integration test to handle ignore patterns (in a very artificial way) - Updates the integration test to test the FDir provider, and normalize result orders (since result ordering is nondeterministic in the fdir provider). - Adds a way to clear results so you can run good-fences multiple times in the same process without accumulating errors.
- Loading branch information
1 parent
0278281
commit f39a36d
Showing
12 changed files
with
92 additions
and
19 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
5 changes: 5 additions & 0 deletions
5
sample/src/componentB/ignored/ignoredFileWithIllegalImports.ts
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 @@ | ||
import helperA2 from '../../componentA/helperA2'; | ||
|
||
export default function ignoredComponent() { | ||
helperA2(); | ||
} |
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
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
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
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
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
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
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,12 @@ | ||
// We mock the fs module here because in newer version of node, | ||
// the builtin module epxorts are non-writeable. This means that | ||
// spyOn(fs, 'readFileSync') will error in beforeEach and no mocks | ||
// will actually be set. | ||
// | ||
// By providing a mock module here and calling jest.mock('fs') | ||
// before any imports, we replace any imports of fs with | ||
// this module, which has mutable exports. | ||
|
||
export function readFileSync() { | ||
throw new Error('readFileSync mock was not overridden'); | ||
} |
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
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
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