-
Notifications
You must be signed in to change notification settings - Fork 895
Enable noUncheckedSideEffectImports by default
#2864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jakebailey
merged 6 commits into
microsoft:main
from
Andarist:fix/make-sure-noUncheckedSideEffectImports
Feb 21, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9b31520
Make sure `noUncheckedSideEffectImports` is enabled by default
Andarist 29561a4
fix err message
Andarist beda723
fmt
Andarist f002298
update a thing
Andarist 2617d92
update
Andarist 06e839d
Merge branch 'main' into fix/make-sure-noUncheckedSideEffectImports
Andarist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,8 @@ | ||
| /src/index.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'https://deno.land/std@0.208.0/path/mod.ts'. | ||
|
|
||
|
|
||
| ==== /src/index.ts (1 errors) ==== | ||
| import "https://deno.land/std@0.208.0/path/mod.ts" | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'https://deno.land/std@0.208.0/path/mod.ts'. | ||
|
|
15 changes: 15 additions & 0 deletions
15
testdata/baselines/reference/compiler/importUrlNodeModulesExist.errors.txt
This file contains hidden or 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,15 @@ | ||
| /src/index.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'https://deno.land/std@0.208.0/path/mod.ts'. | ||
|
|
||
|
|
||
| ==== /node_modules/foo/package.json (0 errors) ==== | ||
| { "name": "foo", "version": "1.0.0" } | ||
|
|
||
| ==== /node_modules/foo/index.d.ts (0 errors) ==== | ||
| export declare function useFoo(): string; | ||
|
|
||
| ==== /src/index.ts (1 errors) ==== | ||
| import "https://deno.land/std@0.208.0/path/mod.ts" | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'https://deno.land/std@0.208.0/path/mod.ts'. | ||
|
|
||
|
|
11 changes: 11 additions & 0 deletions
11
testdata/baselines/reference/submodule/compiler/es6ImportWithoutFromClause.errors.txt
This file contains hidden or 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 @@ | ||
| es6ImportWithoutFromClause_1.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClause_0'. | ||
|
|
||
|
|
||
| ==== es6ImportWithoutFromClause_0.ts (0 errors) ==== | ||
| export var a = 10; | ||
|
|
||
| ==== es6ImportWithoutFromClause_1.ts (1 errors) ==== | ||
| import "es6ImportWithoutFromClause_0"; | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClause_0'. | ||
|
|
15 changes: 0 additions & 15 deletions
15
testdata/baselines/reference/submodule/compiler/es6ImportWithoutFromClause.errors.txt.diff
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...es/reference/submodule/compiler/es6ImportWithoutFromClauseInEs5(target=es2015).errors.txt
This file contains hidden or 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 @@ | ||
| es6ImportWithoutFromClauseInEs5_1.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClauseInEs5_0'. | ||
|
|
||
|
|
||
| ==== es6ImportWithoutFromClauseInEs5_0.ts (0 errors) ==== | ||
| export var a = 10; | ||
|
|
||
| ==== es6ImportWithoutFromClauseInEs5_1.ts (1 errors) ==== | ||
| import "es6ImportWithoutFromClauseInEs5_0"; | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClauseInEs5_0'. |
14 changes: 0 additions & 14 deletions
14
...ference/submodule/compiler/es6ImportWithoutFromClauseInEs5(target=es2015).errors.txt.diff
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...s/reference/submodule/compiler/es6ImportWithoutFromClauseNonInstantiatedModule.errors.txt
This file contains hidden or 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 @@ | ||
| es6ImportWithoutFromClauseNonInstantiatedModule_1.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClauseNonInstantiatedModule_0'. | ||
|
|
||
|
|
||
| ==== es6ImportWithoutFromClauseNonInstantiatedModule_0.ts (0 errors) ==== | ||
| export interface i { | ||
| } | ||
|
|
||
| ==== es6ImportWithoutFromClauseNonInstantiatedModule_1.ts (1 errors) ==== | ||
| import "es6ImportWithoutFromClauseNonInstantiatedModule_0"; | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'es6ImportWithoutFromClauseNonInstantiatedModule_0'. |
15 changes: 0 additions & 15 deletions
15
...erence/submodule/compiler/es6ImportWithoutFromClauseNonInstantiatedModule.errors.txt.diff
This file was deleted.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
...ta/baselines/reference/submodule/compiler/es6ImportWithoutFromClauseWithExport.errors.txt
This file contains hidden or 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,10 +1,13 @@ | ||
| client.ts(1,1): error TS1191: An import declaration cannot have modifiers. | ||
| client.ts(1,15): error TS2882: Cannot find module or type declarations for side-effect import of 'server'. | ||
|
|
||
|
|
||
| ==== server.ts (0 errors) ==== | ||
| export var a = 10; | ||
|
|
||
| ==== client.ts (1 errors) ==== | ||
| ==== client.ts (2 errors) ==== | ||
| export import "server"; | ||
| ~~~~~~ | ||
| !!! error TS1191: An import declaration cannot have modifiers. | ||
| !!! error TS1191: An import declaration cannot have modifiers. | ||
| ~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'server'. |
17 changes: 0 additions & 17 deletions
17
...selines/reference/submodule/compiler/es6ImportWithoutFromClauseWithExport.errors.txt.diff
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
testdata/baselines/reference/submodule/compiler/extendGlobalThis.errors.txt
This file contains hidden or 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,20 @@ | ||
| index.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of './extention'. | ||
|
|
||
|
|
||
| ==== extension.d.ts (0 errors) ==== | ||
| declare global { | ||
| namespace globalThis { | ||
| var test: string; | ||
| } | ||
| } | ||
|
|
||
| export {} | ||
|
|
||
| ==== index.ts (1 errors) ==== | ||
| import "./extention"; | ||
| ~~~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of './extention'. | ||
|
|
||
| globalThis.tests = "a-b"; | ||
| console.log(globalThis.test.split("-")); | ||
|
|
24 changes: 0 additions & 24 deletions
24
testdata/baselines/reference/submodule/compiler/extendGlobalThis.errors.txt.diff
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...nes/reference/submodule/compiler/jsxFactoryQualifiedNameWithEs5(target=es2015).errors.txt
This file contains hidden or 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,16 @@ | ||
| index.tsx(1,8): error TS2882: Cannot find module or type declarations for side-effect import of './jsx'. | ||
|
|
||
|
|
||
| ==== index.tsx (1 errors) ==== | ||
| import "./jsx"; | ||
| ~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of './jsx'. | ||
|
|
||
| var skate: any; | ||
| const React = { createElement: skate.h }; | ||
|
|
||
| class Component { | ||
| renderCallback() { | ||
| return <div>test</div>; | ||
| } | ||
| }; |
20 changes: 0 additions & 20 deletions
20
...eference/submodule/compiler/jsxFactoryQualifiedNameWithEs5(target=es2015).errors.txt.diff
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...baselines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.errors.txt
This file contains hidden or 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,13 @@ | ||
| jsxImportForSideEffectsNonExtantNoError.tsx(4,8): error TS2882: Cannot find module or type declarations for side-effect import of './App.css'. | ||
|
|
||
|
|
||
| ==== jsxImportForSideEffectsNonExtantNoError.tsx (1 errors) ==== | ||
| /// <reference path="/.lib/react16.d.ts" /> | ||
| import * as React from "react"; | ||
|
|
||
| import "./App.css"; // doesn't actually exist | ||
| ~~~~~~~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of './App.css'. | ||
|
|
||
| const tag = <div></div>; | ||
|
|
17 changes: 0 additions & 17 deletions
17
...ines/reference/submodule/compiler/jsxImportForSideEffectsNonExtantNoError.errors.txt.diff
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
33 changes: 0 additions & 33 deletions
33
testdata/baselines/reference/submodule/compiler/moduleAugmentationInAmbientModule5.js.diff
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...elines/reference/submodule/compiler/moduleResolutionWithExtensions_unexpected2.errors.txt
This file contains hidden or 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,14 @@ | ||
| /a.ts(1,8): error TS2882: Cannot find module or type declarations for side-effect import of 'foo'. | ||
|
|
||
|
|
||
| ==== /a.ts (1 errors) ==== | ||
| import "foo"; | ||
| ~~~~~ | ||
| !!! error TS2882: Cannot find module or type declarations for side-effect import of 'foo'. | ||
|
|
||
| ==== /node_modules/foo/foo.js (0 errors) ==== | ||
| This file is not read. | ||
|
|
||
| ==== /node_modules/foo/package.json (0 errors) ==== | ||
| { "types": "foo.js" } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.