This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NA): enables isolatedModules on base tsconfig file (elastic#144841
) This PR enables `isolatedModules` on our `tsconfig.base.json`. Enabling this means that our codebase is safe for tools that use TypeScript APIs like `transpileModule` or alternative compilers like Babel. The requirements introduced by enabling `isolatedModules` were already in place for every piece of code transpiled with babel so we feel like its time to make it the default across the board inside our repository. The DX shouldn't be impacted negatively by these change as we introduced a lint rule verification for the critical part around `isolatedModules` which is around `const enums`. The PR also has a couple of `TODOs` to be removed once we upgrade into typescript v4.8 where we would be able to say everything that is typescript inside our repo should be consider a module by default. More information about `isolatedModules` can be found at https://www.typescriptlang.org/tsconfig#isolatedModules Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
9a0622b
commit 016e3e0
Showing
68 changed files
with
174 additions
and
120 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
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
7 changes: 0 additions & 7 deletions
7
packages/kbn-securitysolution-list-hooks/src/use_api/types.ts
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,10 @@ | |
* Side Public License, v 1. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
jest.mock('../../../../contexts/editor_context/editor_registry', () => ({ | ||
instance: { | ||
setInputEditor: () => {}, | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,10 @@ | |
|
||
// TODO: implement this on the server | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
// import { StartServicesAccessor } from '@kbn/core/server'; | ||
// import { EventAnnotationStartDependencies } from '../plugin'; | ||
|
||
|
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 |
---|---|---|
|
@@ -1211,6 +1211,13 @@ | |
"strict": true, | ||
// for now, don't use unknown in catch | ||
"useUnknownInCatchVariables": false, | ||
// enabled to point out not supported features when emitting in an isolated module environment | ||
"isolatedModules": true, | ||
// TODO(jbudz): should be uncommented when upgrading to [email protected] | ||
// | ||
// ensures every non-declaration file is treated as a module | ||
// "moduleDetection": "force", | ||
// | ||
// disabled for better IDE support, enabled when running the type_check script | ||
"composite": false, | ||
// enabled for improved performance | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
window.matchMedia = jest.fn().mockImplementation((query) => ({ | ||
matches: false, | ||
media: query, | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
// Careful of exporting anything from this file as any file(s) you export here will cause your functions to be exposed as public. | ||
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths | ||
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here. | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
jest.mock('../../../app/services/breadcrumbs', () => { | ||
const original = jest.requireActual('../../../app/services/breadcrumbs'); | ||
|
||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
jest.mock('../../../app/services/track_ui_metric', () => { | ||
const original = jest.requireActual('../../../app/services/track_ui_metric'); | ||
|
||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
// Need to wait for https://github.com/elastic/eui/pull/3173/ | ||
// to unit test this component | ||
// basic interaction is covered in end-to-end tests | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,10 @@ | |
* 2.0. | ||
*/ | ||
|
||
// TODO(jbudz): should be removed when upgrading to [email protected] | ||
// this is a skip for the errors created when typechecking with isolatedModules | ||
export {}; | ||
|
||
jest.mock('../../..', () => ({ | ||
EnginesLogic: { actions: { deleteEngine: jest.fn() } }, | ||
})); |
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
Oops, something went wrong.