-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Add new option "noUncheckedSideEffectImports" #58941
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
Merged
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
aba9afa
Add new option resolveBareImports
jakebailey b7eda58
Enable this by default for testing
jakebailey dfd0cf4
Revert "Enable this by default for testing"
jakebailey 0a38dcf
Rename to resolveSideEffectImports
jakebailey 6417b99
Merge branch 'main' into resolveBareImports
jakebailey eb5d76d
Update tests
jakebailey 3961061
Ignore implicit any on side effect import
jakebailey 9567523
Test not a module
jakebailey 3dbcad1
Ignore not a module
jakebailey 62c0db0
Force enable again for extended testing
jakebailey f8b65c2
Revert "Force enable again for extended testing"
jakebailey 66e718a
Code tweak
jakebailey 1e566bf
Maybe test
jakebailey 0c311de
Enable this by default for testing
jakebailey 62232b0
Revert "Enable this by default for testing"
jakebailey 84b28c6
Merge branch 'main' into resolveBareImports
jakebailey 9aafd93
Merge branch 'main' into resolveBareImports
jakebailey 0e9b34e
affectsSemanticDiagnostics
jakebailey 36fc8c9
Merge branch 'main' into resolveBareImports
jakebailey 2f0dae1
Add failing suggestion diag test
jakebailey 4999728
Ignore side effect in one more place
jakebailey 0061fa8
program update tests
jakebailey 9ee0e58
Rename to noUncheckedSideEffectImports
jakebailey 1a6695a
Test updates, string
jakebailey dd2b4c2
Get ancestor declaration just like contextSpecifier, check consistent…
jakebailey 8a6a517
Check directly, not using flag
jakebailey 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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
...config/showConfig/Shows tsconfig for single option/resolveSideEffectImports/tsconfig.json
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,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"resolveSideEffectImports": true | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...baselines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=false).js
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
//// [sideEffectImports1.ts] | ||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
||
|
||
//// [sideEffectImports1.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("does-not-exist"); | ||
require("./does-not-exist-either"); | ||
require("./does-not-exist-either.js"); |
8 changes: 8 additions & 0 deletions
8
...ines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=false).symbols
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
8 changes: 8 additions & 0 deletions
8
...elines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=false).types
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
16 changes: 16 additions & 0 deletions
16
...es/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=true).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 @@ | ||
sideEffectImports1.ts(1,8): error TS2307: Cannot find module 'does-not-exist' or its corresponding type declarations. | ||
sideEffectImports1.ts(2,8): error TS2307: Cannot find module './does-not-exist-either' or its corresponding type declarations. | ||
sideEffectImports1.ts(3,8): error TS2307: Cannot find module './does-not-exist-either.js' or its corresponding type declarations. | ||
|
||
|
||
==== sideEffectImports1.ts (3 errors) ==== | ||
import "does-not-exist"; | ||
~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module 'does-not-exist' or its corresponding type declarations. | ||
import "./does-not-exist-either"; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module './does-not-exist-either' or its corresponding type declarations. | ||
import "./does-not-exist-either.js"; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module './does-not-exist-either.js' or its corresponding type declarations. | ||
|
14 changes: 14 additions & 0 deletions
14
.../baselines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=true).js
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
//// [sideEffectImports1.ts] | ||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
||
|
||
//// [sideEffectImports1.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("does-not-exist"); | ||
require("./does-not-exist-either"); | ||
require("./does-not-exist-either.js"); |
8 changes: 8 additions & 0 deletions
8
...lines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=true).symbols
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
8 changes: 8 additions & 0 deletions
8
...selines/reference/sideEffectImports1(module=commonjs,resolvesideeffectimports=true).types
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
14 changes: 14 additions & 0 deletions
14
...baselines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=false).js
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
//// [sideEffectImports1.ts] | ||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
||
|
||
//// [sideEffectImports1.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("does-not-exist"); | ||
require("./does-not-exist-either"); | ||
require("./does-not-exist-either.js"); |
8 changes: 8 additions & 0 deletions
8
...ines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=false).symbols
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
8 changes: 8 additions & 0 deletions
8
...elines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=false).types
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
16 changes: 16 additions & 0 deletions
16
...es/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=true).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 @@ | ||
sideEffectImports1.ts(1,8): error TS2307: Cannot find module 'does-not-exist' or its corresponding type declarations. | ||
sideEffectImports1.ts(2,8): error TS2307: Cannot find module './does-not-exist-either' or its corresponding type declarations. | ||
sideEffectImports1.ts(3,8): error TS2307: Cannot find module './does-not-exist-either.js' or its corresponding type declarations. | ||
|
||
|
||
==== sideEffectImports1.ts (3 errors) ==== | ||
import "does-not-exist"; | ||
~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module 'does-not-exist' or its corresponding type declarations. | ||
import "./does-not-exist-either"; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module './does-not-exist-either' or its corresponding type declarations. | ||
import "./does-not-exist-either.js"; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2307: Cannot find module './does-not-exist-either.js' or its corresponding type declarations. | ||
|
14 changes: 14 additions & 0 deletions
14
.../baselines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=true).js
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
//// [sideEffectImports1.ts] | ||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
||
|
||
//// [sideEffectImports1.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
require("does-not-exist"); | ||
require("./does-not-exist-either"); | ||
require("./does-not-exist-either.js"); |
8 changes: 8 additions & 0 deletions
8
...lines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=true).symbols
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.js"; | ||
|
8 changes: 8 additions & 0 deletions
8
...selines/reference/sideEffectImports1(module=nodenext,resolvesideeffectimports=true).types
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 @@ | ||
//// [tests/cases/compiler/sideEffectImports1.ts] //// | ||
|
||
=== sideEffectImports1.ts === | ||
|
||
import "does-not-exist"; | ||
import "./does-not-exist-either"; | ||
import "./does-not-exist-either.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.