-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental-utils) console.warn on import of experimental-utils
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
// TODO (#4139): Once typescript-eslint hits v7, this package will console.warn to switch... | ||
/* eslint-disable no-console */ | ||
console.warn( | ||
'This package is purely a re-export of `@typescript-eslint/utils`.', | ||
); | ||
console.warn( | ||
'You should switch to importing from that non-experimental package instead.', | ||
); | ||
export * from '@typescript-eslint/utils'; |
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 @@ | ||
describe('importing', () => { | ||
it('should console a warning', () => { | ||
const warn = jest.spyOn(console, 'warn').mockImplementation(() => {}); | ||
require('../src/index'); | ||
expect(warn).toHaveBeenCalledTimes(2); | ||
expect(warn).toHaveBeenLastCalledWith( | ||
'You should switch to importing from that non-experimental package instead.', | ||
); | ||
}); | ||
}); |