Skip to content
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

Isolated declarations error messages #131

Conversation

dragomirtitian
Copy link

@dragomirtitian dragomirtitian commented Dec 12, 2023

Improved errors.

Copy link

@h-joo h-joo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"category": "Error",
"code": 9019
},
"Enum member initializers must be computable without references to external symbols with --isolatedDeclarations": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this sentence, it might be confusing in the first glance whether the "with" is connected to symbols or the whole sentence. I guess "With --isolatedDeclarations, enum member ..." might be better, but for consistency, maybe it's okay.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did worry about it as well. I'm not sure how to phrase it and make it consistent though

"category": "Error",
"code": 9024
},
"Reference directives are not supported in isolated declaration mode.": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... supported with --isolatedDeclarations for consistency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Will change.

@h-joo
Copy link

h-joo commented Dec 12, 2023

Also, this PR does not seem to build.

src/compiler/utilities.ts:8628:62 - error TS2345: Argument of type '{ target: { dependencies: "module"[]; computeValue: (compilerOptions: Pick<CompilerOptions, "types" | "lib" | "jsx" | "all" | "allowImportingTsExtensions" | "allowJs" | "allowNonTsExtensions" | ... 120 more ... | "useDefineForClassFields">) => ScriptTarget; }; ... 23 more ...; useUnknownInCatchVariables: { ...; }; }' is not assignable to parameter of type '{ types: { dependencies: ("types" | "lib" | "jsx" | "all" | "allowImportingTsExtensions" | "allowJs" | "allowNonTsExtensions" | "allowArbitraryExtensions" | "allowSyntheticDefaultImports" | ... 118 more ... | "useDefineForClassFields")[]; computeValue: (compilerOptions: Pick<...>) => string[]; }; ... 126 more ...; u...'.
  Type '{ target: { dependencies: "module"[]; computeValue: (compilerOptions: Pick<CompilerOptions, "types" | "lib" | "jsx" | "all" | "allowImportingTsExtensions" | "allowJs" | "allowNonTsExtensions" | ... 120 more ... | "useDefineForClassFields">) => ScriptTarget; }; ... 23 more ...; useUnknownInCatchVariables: { ...; }; }' is missing the following properties from type '{ types: { dependencies: ("types" | "lib" | "jsx" | "all" | "allowImportingTsExtensions" | "allowJs" | "allowNonTsExtensions" | "allowArbitraryExtensions" | "allowSyntheticDefaultImports" | ... 118 more ... | "useDefineForClassFields")[]; computeValue: (compilerOptions: Pick<...>) => string[]; }; ... 126 more ...; u...': types, lib, jsx, all, and 99 more.

8628 export const computedOptions = createComputedCompilerOptions({
                                                                  ~
8629     target: {
     ~~~~~~~~~~~~~
 ... 
8846     },
     ~~~~~~
8847 });
     ~

src/compiler/commandLineParser.ts:2522:17 - error TS2322: Type 'string | number | boolean | TsConfigSourceFile | string[] | MapLike<string[]> | PluginImport[]' is not assignable to type 'CompilerOptionsValue'.
  Type 'TsConfigSourceFile' is not assignable to type 'CompilerOptionsValue'.
    Type 'TsConfigSourceFile' is not assignable to type 'MapLike<string[]>'.
      Index signature for type 'string' is missing in type 'TsConfigSourceFile'.

2522                 impliedCompilerOptions[option] = computedOptions[option as keyof typeof computedOptions].computeValue(configParseResult.options);
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors.

Error in build-tsc in 4.6s

@dragomirtitian dragomirtitian force-pushed the isolated-declarations-safety-improvements branch 2 times, most recently from a2fab36 to c45ffaf Compare January 2, 2024 15:37
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
Signed-off-by: Titian Cernicova-Dragomir <[email protected]>
@dragomirtitian dragomirtitian force-pushed the isolated-declarations-error-messages branch from b5dc788 to 857f90b Compare January 2, 2024 16:19
@dragomirtitian dragomirtitian merged commit c223e05 into isolated-declarations-safety-improvements Jan 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants